OSPF Single Area

Document Sample
OSPF Single Area Powered By Docstoc
					Advanced Routing
OSPF, Single Area




                    1
                       Cisco IP Routing: Packet   Routing TCP/IP           OSPF, Anatomy of
                       Forwarding & Intra-        Volume I by Jeff Doyle   an Internet Routing
Interconnections :     domain Routing Protocols                            Protocol by John
Bridges and Routers    by Alex Zinin                                       Moy (creator of
by Radia Perlman                                                           OSPF)
                       This book has been
                       especially helpful for
                       information contained in
                       these presentations.


                 • For more information on OSPF, link-state routing protocol,
                   Dijkstra‘s algorithm and routing in general, check out
                   these sources.                                           2
     OSPF Exam Objectives
 Explain why OSPF is better than RIP in large
  internetwork
 Explain how OSPF discovers, chooses, and
  maintains routes.
 Explain how OSPF operates in a single area
  NBMA environment
 Configure OSPF for proper operation in a single
  area
 Configure a single-area OSPF environment
 Configure OSPF for an NBMA environment


                                                    3
             OSPF Overview
• OSPF does not gather routing table information,
  but routers and the status of their connections,
  links.
• OSPF routers use this information to build a
  topological data base (link state database), runs
  the Shortest Path First (SPF), Dijkstra‘s algorithm,
  and creates a SPF tree. From that SPF tree, a
  routing table is created.




                                                    4
OSPF is a link state protocol
• Link: interface on a router
• Link state: the status of a link between two
  routers.




                                                 5
6
Link-State Routing Protocols
 The first type of routing protocol we discussed was distance vector.
 The second type of routing protocol that we will examine is link-state.
 In this presentation we will only examine the very basic concepts of link-
   state routing protocols.
 In CCNP Advanced Routing we examine the link state routing protocol
   OSPF in detail.
 I have added a presentation, Introduction to OSPF, which we will discuss
   at the end of this semester.




                                                                               7
Distance Vector Routing Protocols
 Distance vector routing protocols like RIP and IGRP do not know the exact
   topology of a network.
 All distance vector routing decisions are made from information from
   neighboring routers – routing by rumor.
 The only information the router has about a route is how far away the
   network is in hops or using another cost (distance) and which interface to
   send forward the packet out of (vector).
 The router has no way to make its own decision on which direction is
   ultimately the best way to send the packets.




                                                                                8
Link-State Routing Protocols - History
 The first link-state routing protocol was implemented and deployed in the
   ARPANET (Advanced Research Project Agency Network), the predecessor
   to later link-state routing protocols.
 Next, DEC (Digital Equipment Corporation) proposed and designed a link-
   state routing protocol for ISO‘s OSI networks, IS-IS (Intermediate System-
   to-Intermediate System).
    • The OSI protocol stack is what the OSI model was based on. The OSI
        protocol stack was designed to be the protocol of the Internet, but to
        make a long story short, TCP/IP became the Internet protocol instead.
 Later, IS-IS was extended by the IETF to carry IP routing information.




                                                                             9
Link-State Routing Protocols - History
 An IETF working group designed a routing protocol specifically
   for IP routing, OSPF (Open Shortest Path First).
 For most network administrators they had two open-standard
   routing protocols to choose from: RIP, simple but very limited, or
   OSPF, robust but more sophisticated to implement.
    • IGRP and EIGRP are Cisco proprietary
    • IS-IS is used in IP networks, but not as common as OSPF




                                                                    10
OSPF - Open Shortest Path First
 OSPF is covered in detail in CCNP Advanced Routing.
 We will have a presentation on an Introduction to OSPF later this semester,
  just enough to give you a taste.




                                                                           11
Theory of Link-State Routing Protocols
 In this presentation we will examine ―some‖ of the theory behind link-state
   routing protocols.
 This will only be a brief introduction to the link-state theory, requiring much
   more time and perhaps even some requisite knowledge of algorithms.
 At the end of this presentation will be some suggested resources for
   leaning more about the theory of link-state routing and Dijkstra‘s algorithm.




                                                                                    12
Mathematical point of view
• Link-state routing is not based on IP addresses, subnets and network
   information!
• Link-state routing has a mathematical point of view, looking at the network
   as nothing more than a graph with vertices and the costs to these vertices.
• Okay, I’m losing you and I said I wouldn’t get mathematical.
• Link-state routing is based on a very simple algorithm known as Dijkstras’s
   algorithm, invented by Edsger Wybe Dijkstra
• This algorithm can and has been used in many areas of human activity, not
   just for routing.




                                                                            13
Link-State Theory
•   The network is viewed as a graph, showing the complete topology of the
    network.
•   How do routers build this topology?
1 – Flooding of link-state information
•   The first thing that happens is that each node, router, on the network
    announces its own piece of link-state information to other all other routers
    on the network: who their neighboring routers are and the cost of the link
    between them.
•   Example: ―Hi, I‘m RouterA, and I can reach RouterB via a T1 link and I can
    reach RouterC via an Ethernet link.‖
•   Each router sends these announcements to all of the routers in the
    network.




                                                   1 – Flooding of link-state
                                                   information

                                                                                   14
2. Building a Topological Database
 Each router collects all of this link-state information from other routers and
    puts it into a topological database.

3. Shortest-Path First (SPF), Dijkstra’s Algorithm
 Using this information, the routers can recreate a topology graph of the
    network.
 Believe it or not, this is actually a very simple algorithm and I highly suggest
    you look at it some time, or even better, take a class on algorithms. (Radia
    Perlman‘s book, Interconnections, has a very nice example of how to build
    this graph – she is one of the contributers to the SPF and Spanning-Tree
    algorithms.)
                                                                       1 – Flooding of
                                                                       link-state
                                                                       information
                                2 – Building a
                                Topological
                                Database



                                                        3 – SPF
                                                        Algorithm



                                                                                   15
4. Shortest Path First Tree
 This algorithm creates an SPF tree, with the router making itself the root
    of the tree and the other routers and links to those routers, the various
    branches.
      • Note: Just a reminder that the link-state algorithm and graph it
         creates is mathematically based and although we are mentioning
         routers and their links, it has nothing to do with IP addresses or other
         network information.
5. Routing Table
 Using this information, the router creates a routing table.
I bet you can create this tree given the link-state information!


                                             1 – Flooding of link-state
                                             information


2 – Building a
Topological
                                                        5 – Routing Table
Database
                           3 – SPF Algorithm



                                                    4 – SPF Tree
                                                                                    16
Exercise: From link-state flooding to routing tables - Lets try it…
 For this exercise we will not worry about the individual, leaf, networks attached
   to each node or router (shown as a blank line), but focus on how the topology
   is built to find the the shortest path between each router.
 In order to keep it simple, we will take some liberties with the actual
   process and algorithm, but you will get the basic idea!
 You are RouterA and you have a link to RouterB with a cost of 15, a link to
   RouterC with a cost of 2, a link to RouterD with a cost of 5, and a leaf network
   ―apple.‖
 This is your own link-state information, which you will flood to all other
   routers so they can do the same thing we will be doing for RouterA.


                                                      B
         “Leaf”
         networ                            15
         k
         apples                              2
                                   A                  C

                                            5

                                                      D
                                                                               17
    We now get the following link-state information from RouterB
    • RouterB has a link to RouterA with a cost of 15.
    • RouterB has a link to RouterE with a cost of 2.
    • And information about its own ―leaf‖ network ―bananas.‖

                                                           bananas
                                           B
                                                   2
                                  15


                         A                                  E


     Now lets attach the two graphs…
            B
                                                                              B
     15                                B                                          2
                                                                         15

A
       2
            C   +            15
                                               2
                                                                =    A
                                                                          2
                                                                              C        E
      5
                     A                                 E                 5
            D
                                                                              D




                                                                                      18
     We now get the following link-state information from RouterC
     • RouterC has a link to RouterA with a cost of 2.
     • RouterC has a link to RouterD with a cost of 2.
     • And information about its own ―leaf‖ network ―cherries.‖

                                           2
                                   A               C

                                                       2       cherries

                                                   D

         Now lets attach the two graphs…
                                                                               B
             B                                                                         2
                                                                          15
                   2                   2
    15                         A               C


A
     2
             C         E   +                       2       =         A
                                                                           2
                                                                               C                E

                                               D                          5        2
    5

             D                                                                 D




                                                                                           19
         We now get the following link-state information from RouterD
         • RouterD has a link to RouterA with a cost of 5.
         • RouterD has a link to RouterC with a cost of 2.
         • RouterD has a link to RouterE with a cost of 10.
         • And information about its own ―leaf‖ network ―donuts.‖

                             A               C                     E

                                     5           2           10

                                             D
                                                                  donuts

          Now lets attach the two graphs…
                                                                                            B
                                                                                                    2
             B                                                                         15
                                 A                   C                     E
                     2
    15                                                                                  2
                                                                                   A        C            E
                                         5               2         10
A

    5
     2
             C

                 2
                         E
                             +                       D                         =       5

                                                                                            D
                                                                                                2   10



             D




                                                                                                    20
     We now get the following link-state information from RouterE
     • RouterE has a link to RouterB with a cost of 2.
     • RouterE has a link to RouterD with a cost of 10.
     • And information about its own ―leaf‖ network ―eggs.‖
                              B
                                      2            eggs

                                           E

                                  2   10

                              D

Now lets attach the two graphs and we have all the nodes, their links between them
  and their and leafs!

         B                    B
                                                                   B
                 2                     2
    15                                                                     2
                                                              15

A

    5
     2
         C

             2   10
                      E
                          +                    E
                                                      =   A

                                                              5
                                                               2
                                                                   C            E

                                                                       2   10
                                  2   10
         D                                                         D
                              D




                                                                                    21
Topology
• Using the topological information we listed, RouterA has now
  built a complete topology of the network.
• The next step is for the link-state algorithm to find the best path
  to each node and leaf network.

                                    bananas

                                B
                                               2
                      15

    apples              2               cherries
                                                   E
                                                       eggs
               A                C

                       5            2         10

                                D

                                    donuts
                                                                  22
Choosing the best path
 Using the link-state algorithm RouterA can now proceed to find
  the shortest path to each leaf network.
 Try doing it on your own!


                                  bananas

                              B
                                             2
                    15

   apples             2               cherries
                                                 E
                                                     eggs
              A               C

                     5            2         10

                              D

                                  donuts
                                                              23
Choosing the best path
• Now RouterA knows the best path to each network.



                               bananas

                           B
                                         2
                  15

   apples          2               cherries
                                              E
                                                  eggs
            A              C

                  5            2         10

                           D

                               donuts
                                                         24
   OSPF vs RIP (no contest)
 OSPF is link-state, where RIP is distance-vector.
 OSPF has faster convergence - Because of RIP‘s hold-down
  timer, RIP can be quite slow to converge.
 OSPF has no hop restriction - RIP to limited to 15 hops, OSPF
  does not use hops.
 OSPF supports VLSM; RIPv1 doesn‘t
 Cisco‘s OSPF metric is based on bandwidth, RIP‘s is based on
  hop count
 Update efficiency - RIP sends entire routing table every 30
  seconds, where OSPF only sends out changes when they occur.
    • Note: OSPF does flood LSAs when it age reaches 30 minutes
      (later)
 OSPF also uses the concept of area to implement hierarchical
  routing


                                                            25
Cisco’s OSPF’s metric is based
           on cost
 Cost: The outgoing cost for packets transmitted from
   this interface.
 • Cost is an OSPF metric expressed as an unsigned
   16-bit integer, from 1 to 65,535.




                                                    26
Cisco’s OSPF’s metric is based on
              cost
• Cisco uses a default cost of 108/BW, where BW is the
  configured bandwidth (bandwidth command) of the interface and
  108 (100,000,000) as the reference bandwidth.
• Example: A serial link with a configured bandwidth of 128K
  would have a cost of: 100,000,000/128,000 = 781
• More on the cost metric later…
• Note: Bay and some other vendors use a default cost of 1 on all
  interfaces, essentially making the OSPF cost reflect hop counts.

RFC 2328, OSPF version 2, J. Moy
• ―A cost is associated with the output side of each router
  interface. This cost is configurable by the system administrator.
  The lower the cost, the more likely the interface is to be used to
  forward data traffic.‖
• RFC 2328 does not specify any values for cost.
                                                                 27
     Areas make OSPF scalable
 Area: collection of OSPF routers.
 Every OSPF router must belong to at least one area
 Every OSPF network must have an Area 0 (backbone area)
 All other Areas should ―touch‖ Area 0
   • There are exceptions to this rule – virtual link (later)
 Routers in the same area have the same link-state information
 Much more on areas in the next chapter, OSPF Multiple Areas




                                                                  28
      OSPF neighbor relationships
 OSPF is capable of sophisticated communication between
  neighbors.
 OSPF uses 5 different types of packets to communicate
  information.




                                                           29
OSPF packet types




       OSPF Type-2 (DBD)


       OSPF Type-3 (LSR)


       OSPF Type-4 (LSU)



        OSPF Type-5 (LSAck)




                              30
 OSPF packet types – More later

OSPF Type-4 packets have 7 LSA packets (later)




                                            31
OSPF Hello Subprotocol


                         OSPF
                         Header




                         Hello
                         Header




                                  32
Example Hello packet (Type 1 OSPF packet)




                                      33
        OSPF Hello Subprotocol




Hello subprotocol is intended to perform the following tasks within OSPF:
• Means for dynamic neighbor discovery
• Detect unreachable neighbors within a finite period of time
• Ensure two-way communications between neighbors
• Ensure correctness of basic interace parameters between neighbors
• Provide necessary information for the election of the Designated and
   Backup Designated routers on a LAN segement

                                                                            34
    The OSPF Hello Protocol


 OSPF routers send Hellos on OSPF enabled interfaces:
   • default every 10 seconds on broadcast and point-to-point segments
   • Default every 30 seconds on NBMA segments
 Most cases OSPF Hello packets are sent as multicast to ALLSPFRouters
  (224.0.0.5)
 HelloInterval - Cisco default = 10 seconds/30 seconds and can be
  changed with the command ip ospf hello-interval.
 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.
• Note: For routers to become adjacent, the Hello, DeadInterval and
  network types must be identical between routers or Hello packets get
  dropped!


                                                                       35
 Steps to OSPF Operation
1.   Establishing router adjacencies
2.   Electing DR and BDR
3.   Discovering Routes
4.   Choosing Routes
5.   Maintaining Routing Information




                                       36
                  OSPF States
States of the OSPF neighbor FSM (Finite State
  Machine)
• Every OSPF router represents its communications with other OSPF
  routers in the form of neighbor data structures.
• Every neighbor can be in one of many states
   – Down State
   – Attempt State
   – Init State
   – Two-way State
   – ExStart State
   – Exchange State
   – Loading State
   – Full Adjacency State

                                                             37
Steps to OSPF Operation with OSPF States
    1. Establishing router adjacencies
        • Down State
        • Init State
        • Two-way State
        • (ExStart State unless DR/BDR election needed)
    2. Electing DR and BDR
        • ExStart State with DR and BDR
        • Two-way State with all other routers
    3. Discovering Routes
        • ExStart State
        • Exchange State
        • Loading State
        • Full State
    4. Choosing Routes
    5. Maintaining Routing Information
                                                          38
        1.Establishing Adjacencies
 Initially, an OSPF router interface is in the down state.
 An OSPF interface can transition back to this state if it has not
  received a Hello packet from a neighbor within the
  RouterDeadInterval time (40 seconds unless NBMA, 120
  seconds).
 In the down state, the OSPF process has not exchanged
  information with any neighbor.
 OSPF is waiting to enter the init state.
 An OSPF router tries to form an adjacency with at least one
  neighbor for each IP network it‘s connected to.




                                                                      39
            1.Establishing Adjacencies
 The process of establishing adjacencies is asymmetric, meaning
  the states between two adjacent routers may be different as they
  both transition to full state.
 RTB perspective and assuming routers are configured correctly.
 Trying to start a relationship and wanting to enter the init state or
  really the two-way-state
 RTB begins multicasts OSPF Hello packets (224.0.0.5,
  AllSPFRouters), advertising its own Router ID.
   • 224.0.0.5: All OSPF routers should be able to transmit and
      listen to this address.




                                                                          40
     1. Establishing Adjacencies
 Router ID = Highest loopback address else highest active IP
  address.
 Loopback address has the advantage of never going down, thus
  diminishing the possibility of having to re-establish adjacencies.
  (more in a moment)
 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.
 RTA and RTC receive Hello packets from RTB
 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.




                                                                     41
1. Establishing Adjacencies
                    Hello 10.6.0.1 10.5.0.1
                      Hello 10.6.0.1
          Down
           Init
         2-way                          Down
                                         Init
                                       2-way



                  Hello 10.5.0.1

           Hello 10.5.0.1 10.6.0.1
  Init State
   Init State - OSPF routers sent Type 1 Hello packets at regular intervals
      (10 sec.) to establish neighbors.
   When a router receives its first Hello packet, it enters the init state,
      indicating that the Hello packet was received but did not contain the
      Router ID of the receiving router in the list of neighbors, so two-way
      communications is not yet ensured.
   As soon as the router sends a Hello packet to the neighbor with its
      RouterID and the neighbor sends a Hello packet packet back with that
      Router ID, the router‘s interface will transition to the two-way state.
   Now, the router is ready to take the relationship to the next level.

                                                                      42
1. Establishing Adjacencies
                     Hello 10.6.0.1 10.5.0.1
                       Hello 10.6.0.1
           Down
            Init
          2-way                          Down
                                          Init
                                        2-way



                   Hello 10.5.0.1

            Hello 10.5.0.1 10.6.0.1


 From init state to the two-way state
  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.
  RTB declares takes the relationship to a new level, and declares a two-
    way state between itself and RTA, and itself and RTC.
  As soon as the router sends a Hello packet to the neighbor with its
    RouterID and the neighbor sends a Hello packet packet back with that
    Router ID, the router‘s interface will transition to the two-way state.
  Now, the router is ready to take the relationship to the next level.

                                                                     43
      1. Establishing Adjacencies
Two-way state (and adjacency)
 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.
 Among other information, these Hello packets include a list of the sender‘s
  known OSPF neighbors.
 A router enters the two-way state when it sees itself in a neighbor‘s Hello
  packet.
 As we will see later, a router may stay in this state if it is on a broadcast
  segment and it is neither the DR or the BDR. (later)
 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.




                                                                             44
  1. Establishing Adjacencies
Two-way state
 RTB now decides who to establish a ―full adjacency‖ with
  depending upon the type of network that the particular interfaces
  resides on.
 Note: The term adjacency is used to both describe routers
  reaching 2-way state and when they reach full-state. Not to go
  overboard on this, but technically OSPF routers are adjacent
  when the FSM reaches full-state and IS-IS is considered adjacent
  when the FSM reaches 2-way state.

Two-way state to ExStart state
 If the interface is on a point-to-point link, the routers becomes
  adjacent with its sole link partner (aka ―soul mates‖), and take the
  relationship to the next level by entering the ExStart state.
  (coming soon)
Remaining in the two-way state
 If the interface is on a multi-access link (Ethernet, Frame Relay,
  …) RTB must enter an election process to see who it will establish
  a full adjacency with, and remains in the two-way state. (Next!)45
Steps to OSPF Operation with OSPF States
  1. Establishing router adjacencies
       Down State – No Hello received
       Init State – Hello received, but not with this router‘s Router ID
       Two-way State – Hello received, and with this router‘s Router
        ID
       (ExStart State unless DR/BDR election needed)
  2. Electing DR and BDR – Broadcast segments only
       ExStart State with DR and BDR
       Two-way State with all other routers
  3. Discovering Routes
       ExStart State
       Exchange State
       Loading State
       Full State
  4. Calculating the Routing Table
  5. Maintaining the LSDB and Routing Table
                                                                   46
        2. Electing a DR and BDR
• 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.
• On multi-access networks,OSPF elects a DR and BDR to limit
  the number of adjacencies using OSPF Hello packets.
   – Reduce routing update traffic




                                                                  47
          2. Electing a DR and BDR
• DR - Designated Router
• BDR – Backup Designated Router
• DR‘s serve as collection points for Link State Advertisements
  (LSAs)
• A BDR back ups the DR.
• 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).




                                                                 48
              2. Electing a DR and BDR
 The formation of an adjacency between every attached router would create
  many unncessary LSA (Link State Advertisements), n(n-1)/2 adjacencies.
 Flooding on the network itself would be chaotic.
 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.
 To prevent this problem, a Designate Router (DR) is elected on multi-
  access networks.
 Not knowing any different, at first all routers declare themselves the DR
  until it learns differently.
 Technical Note: In reality the BDR selection process happens first to
  ensure the BDR takes over the DR responsibilities when the DR fails.




                                                                        49
      2. Electing a DR and BDR



Designated Router
 A DR (Designated Router) and perhaps a BDR (Backup Designated
   Router) is elected for every multi-access network, using Hello packets as
   ―ballots.‖
 Router with the highest Router ID is elected the DR.
 But like other elections, this one can be rigged.
 The router’s priority field can be set to either ensure that it becomes the
   DR or prevent it from being the DR.
 Rtr(config-if)# ip ospf priority <0-255>
    • Higher priority becomes DR/BDR
    • Default = 1
    • 0 = Ineligible to become DR/BDR
 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.)
                                                                      50
       2. Electing a DR and BDR




Backup Designated Router
 BDR (Backup Designated Router) is elected in addition to the
  DR in case the DR fails.
 The BDR is the router that wins second place in the previous
  process.
 If a multi-access network only has one router, it will be the DR
  and there will be no BDR.
 NOTE: On an multi-access stub network, there is no DR or
  BDR. I am still investigating this, but the DR does not show in
  the show ip ospf commands. This may be a function of the
  output command and not the election process. This will be
  updated when I find out more information.
                                                                51
            2. Electing a DR and BDR
 All other routers, ―DRother‖, establish adjacencies with only the DR and BDR.
 DRother routers multicast LSAs to only the DR and BDR
    • (224.0.0.6 - all DR routers)
 DR sends LSA to all adjacent neighbors
    • (224.0.0.5 - all OSPF routers)
Backup Designated Router - BDR
 Listens, but doesn‘t act.
 If LSA is sent, BDR sets a timer.
 If timer expires before it sees the reply from the DR, it becomes the DR and
   takes over the update process.
 The process for a new BDR begins.




                                                       DRother Routers


                                                                           52
       2. Electing a DR and BDR

A new router enters the network
 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. (Bug in early IOS 12.0)
 There is a valid condition where this may arise, but it is unlikely.
   (If a router enters a network and does not hear a hello from
   routers already on the network.)
 If DR fails, BDR takes over as DR and selection process for new
   BDR begins.
 State of the relationship
    • DROthers enter ExStart state with DR and BDR and two-
        way state with all other routers
    • DR and BDR enter ExStart state with all routers


                                                                  53
    2. Electing a DR and BDR
DR - Summary
DR Election
 Router with the highest interface priority (0 = cannot become DR or
   BDR)
 Router with the highest router ID.
    • Loopback address used first
    • IP Address on active interface used second
 BDR is the second highest
Adjacencies and multicasting
 All other routers, DRother, establish adjacencies with only the DR and
   BDR.
 All routers continue to multicast Hello packets to AllSPFRouters
   (224.0.0.5) so they can track neighbors.
 But updates (LSAs) are multicast to DR and BDR only (224.0.0.6 -
   AllDRrouters) and in turn
 DR floods updates (LSAs) to all adjacent neighbors (224.0.0.5 -
   AllSPFRrouters)

                                                                     54
        2. Electing a DR and BDR
BDR
 Listens, but doesn‘t act.
 If LSA is sent, BDR sets a timer.
 If timer expires before it sees the reply from the DR, it
  becomes the DR and takes over the update process and the
  process for a new BDR begins.




                                                              55
      2. Electing a DR and BDR
                    Hello DR 10.6.0.1
         2-way
        ExStart                        2-way
                                      ExStart


         BDR                            DR
                  Hello DR 10.5.0.1




DR and BDR get elected and FSM interface transitions from two-
  way state to the ExStart state
Note: Any DROther routers remain in two-way state with each
  other, but ExStart state with DR and BDR.




                                                            56
Steps to OSPF Operation with OSPF States
    1. Establishing router adjacencies
         Down State – No Hello received
         Init State – Hello received, but not with this router‘s Router ID
         Two-way State – Hello received, and with this router‘s Router ID
         (ExStart State unless DR/BDR election needed)
    2. Electing DR and BDR – Broadcast segments only
         ExStart State – Router interfaces with DR and BDR
         Two-way State – Router interfaces with all other routers
    3. Discovering Routes
         ExStart State –Starts LSDB synchronization process between
           neighbors. Decide on Master/Slave.
         Exchange State – Routers exchange DBD packets and determines
           if there is anything in its Link State Request list.
         Loading State – If entries in LSR list, exchange LSUs.
         Full State – Once LSDBs are synchronized.
    4. Calculating the Routing Table
    5. Maintaining the LSDB and Routing Table


                                                                      57
3. Discovering Routes and reaching Full
                 State
                               “adjacent”



                              OSPF Type-2 (DBD)

                              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)

                             “full adjacency”

                                                58
3. Discovering Routes and reaching Full
    ExStart State
                  State
    This state starts the LSDB (Link State Data Base) synchronization
     process.
    This will prepare for initial database exchange.
    Routers are now ready to exchange routing information.
       • Between routers on a point-to-point network
       • On a multi-access network between the DRothers and the DR and
          BDR.
    Formally, routers in ExStart state are characterized as adjacent, but have
     not yet become ―fully adjacent‖ as they have not exchanged data base
     information.

   But who goes first in the exchange?
    ExStart is established by exchanging OSPF Type-2 DBD (Database
      Description) packets (I believe the curriculum says LSA type 2 which is
      something else).
    Purpose of ExStart is to establish a master/slave relationship between the
      two routers decided by the higher router id.
    Once the roles are established they enter the Exchange state.

                                                                        59
OSPF packet types




              OSPF Type-2 (DBD)



      OSPF Type-3 (LSR)



   OSPF Type-4 (LSU)



     OSPF Type-5 (LSAck)



                                  60
OSPF DBD packet format
   0                   1                    2                    3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    Version #   |        2       |          Packet length         |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                            Router ID                             |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                             Area ID                              |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |            Checksum             |              AuthType            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                         Authentication                           |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                         Authentication                           |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |          Interface MTU          |    Options     |0|0|0|0|R|I|M|MS
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                       DD sequence number                         |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                                  |
 +-                                                                -+
 |                                                                  |
 +-                        An LSA Header                           -+
 |                                                                  |
 +-                                                                -+
 |                                                                  |
 +-              (LSA descriptions)                                -+
 |                                                                  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                ...                               |

                                                                          61
3. Discovering Routes and reaching Full
                 State
                              “adjacent”



                              OSPF Type-2 (DBD)
                              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)


                                             62
3. Discovering Routes and reaching Full
                 State
 Exchange State
  Exchange state - Routers exchange one or more Type-2 DBDs (Database
    Description) packets, which is a summary of the link-state database
     • send LSAcks to verify
  Routers compare these DBDs with information in its own database.
  When a DBD packet is received the router looks through the LSA (Link
    State Advertisement) headers and identifies LSAs that are not in the
    router‘s LSDB or are a different version from its LSDB version (older or
    newer).
  If the LSA is not in its LSDB or the LSA is a more recent version, the router
    adds an entry to its Link State Request list.
  This process ends when both routers stop have sent and received
    acknowledgements for all their DBD packets – that is they have
    successfully sent all their DBD packets to each other.




                                                                             63
    3. Discovering Routes and reaching
                 Full State
Exchange State
 If a router has entries in its Link State Request list, meaning that it needs
   additional information from the other router for routes that are not in its
   LSDB or has more recent versions, then it enters the loading state.
 If there are no entries in its Link State Request list, than the router‘s
   interface can transition directly to full state.
 Complete routing information is exchanged in the loading state, discussed
   next.




                                                                                  64
3. Discovering Routes and reaching Full
                 State
                               “adjacent”



                              OSPF Type-2 (DBD)

                              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)


                                            65
3. Discovering Routes and reaching Full
Loading State    State
 If a router has entries in its Link State Request list, meaning that it needs
  additional information from the other router for routes that are not in its
  LSDB or has more recent versions, then it enters the loading state.
 The router needing additional information sends LSR (Link State Request)
  packets using LSA information from its LSR list.


                        OSPF packet types



                                                                  OSPF Type-2
                                                                  (DBD)
                                                                  OSPF Type-3
                                                                  (LSR)
                                                                  OSPF Type-4
                                                                  (LSU)
                                                                  OSPF Type-5
                                                                  (LSAck)
                                                                            66
          OSPF LSR packet format
        0                   1                    2                  3
        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |    Version #   |        3       |         Packet length        |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                            Router ID                           |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                             Area ID                             |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |            Checksum             |             AuType           |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         Authentication                         |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         Authentication                         |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                            LS type                             |
LSR   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         Link State ID                          |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                       Advertising Router                       |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                   (LSRs)
      |                              ...                                    |


                                                                                67
3. Discovering Routes and reaching
Loading State Full State
 The other routers replies by sending the requested LSAs in the Link State
  Update (LSU) packet.
 The receiving router sends LSAck to acknowledge receipt.
 When all LSAs on the neighbors Link State Request list have been
  received, the ―neighbor FSM‖ transitions this interface to Full state.

                     OSPF packet types



                                                                 OSPF Type-2
                                                                 (DBD)

                                                                 OSPF Type-3
                                                                 (LSR)

                                                                  OSPF Type-4
                                                                  (LSU)

                                                                 OSPF Type-5
                                                                 (LSAck)
                                                                        68
          OSPF LSU packet format
         0                   1                   2                   3
         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |    Version #   |       4       |         Packet length          |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                           Router ID                             |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                            Area ID                              |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |            Checksum            |             AuType             |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                        Authentication                           |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                        Authentication                           |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                             # LSAs                              |
                    LSAs: Types 1, 2, 3, 4, or
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                                                                 |
LSAs   +-                     5                                        +-+
       |                              LSAs                               |
       +-                                                              +-+
       |                               ...                               |



                                                                             69
OSPF packet types – More later
                        OSPF Type-4 packets have
                        7 LSA packets (later)




                                             70
3. Discovering Routes and reaching
             Full State
  Full State
   Full state - after all LSRs have been updated.
   At this point the routers should have identical LSDBs (link-state
     databases).

  Flooding LSAs
   Once this interface transitions to or from Full state the router
     originates a new version of a Router LSA (coming) and floods it to its
     neighbors, distributing the new topological information – out all OSPF
     enabled interfaces.
   Broadcast networks:
      • DR: If the LSA was received on this interface, send it out this
         interface so DROthers receive it (224.0.0.5 - all OSPF routers)
      • BDR/DROther: If the LSA was received on this interface, do not
         send out this interface (received from DR).

  Calculating Routing Table
   The router still must calculate its routing table – Next!


                                                                        71
3. Discovering Routes and reaching Full
                 State
                              “adjacent”



                              OSPF Type-2 (DBD)

                              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)




                                             72
Steps to OSPF Operation with OSPF
              States
 1. Establishing router adjacencies
      Down State – No Hello received
      Init State – Hello received, but not with this router‘s Router ID
      Two-way State – Hello received, and with this router‘s Router ID
      (ExStart State unless DR/BDR election needed)
 2. Electing DR and BDR – Broadcast segments only
      ExStart State – Router interfaces with DR and BDR
      Two-way State – Router interfaces with all other routers
 3. Discovering Routes
      ExStart State –Starts LSDB synchronization process between
        neighbors. Decide on Master/Slave.
      Exchange State – Routers exchange DBD packets and determines if
        there is anything in its Link State Request list.
      Loading State – If entries in LSR list, exchange LSUs.
      Full State – Once LSDBs are synchronized.
 4. Calculating the Routing Table
 5. Maintaining the LSDB and Routing Table

                                                                   73
     4. Calculating the Routing Table
 The router now has a complete link-state database
 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.
 Dijkstra’s algorithm is used to calculate the Shortest Path Tree
  from the LSAs in the link state database.
 SPF, Shortest Path First calculations places itself as the root
  and creating a ―tree diagram‖ of the network.




                                                                   74
     4. Calculating the Routing Table
 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).
 We will not go into the details here, but the books mentioned
  earlier all some excellent examples on this process.
 Also, remember the link-state exercise we did earlier!
   Exercise: From link-state flooding to routing tables

                   B                B
                                                             B
                                        2
              15               15                                2
                                                        15


          A
               2
                   C
                       +   A                E
                                                =        2
                                                    A        C            E
              5
                                                        5

                   D
                                                             D



                                                                     75
   4. Calculating the Routing Table
Cost = 108/BW
 OSPF basis routing metrics on cost.
 Cisco routers, cost = 108/BW
 Note for both IGRP and EIGRP it is 107, whereas OSPF is 108
 BW is the configured bandwidth for an interface (See CCNA IGRP
  information)
 Cisco uses a default cost of 108/BW, where BW is the configured
  bandwidth (bandwidth command) of the interface and 108
  (100,000,000) as the reference bandwidth.
 Example: A serial link with a configured bandwidth of 128K would
  have a cost of: 100,000,000/128,000 = 781
 The cost of a route is the sum of the costs of all the outgoing
  interfaces to a destination.
 In general, cost decreases as the speed of the link increases.
 RTB‘s 10 Mbps Ethernet interface has a lower cost than its T-1,
  1.544 Mbps interface.

                                                             76
4. Calculating the Routing Table
Cisco default interface costs:
 56-kbps serial link—Default cost is 1785
 64-kbps serial link—Default cost is 1562
 T1 (1.544-Mbps serial link)—Default cost is 65
 E1 (2.048-Mbps serial link)—Default cost is 48
 4-Mbps Token Ring—Default cost is 25
 Ethernet—Default cost is 10
 16-Mbps Token Ring—Default cost is 6
 FDDI—Default cost is 1
Notes:
•   Cisco routers default to T1 (1.544 Mbps) on all serial interfaces and require
    manual modification with the bandwidth command.
•   ospf auto-cost reference-bandwidth ref-bw can be used to modify the
    reference-bandwidth for higher speed interfaces
                                                                         77
4. Calculating the Routing Table
  Modifying the cost
   bandwidth command can be used to change the bandwidth
    metric on an interface and used in the 108/BW calculation:
   RTB(config)# inter s 0
   RTB(config-if)# bandwidth 56 (in Kbps)
   Note: The metric for this interface is now 1785.

   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. Bay Networks and some other
     vendors use a default cost of 1 on all interfaces, essentially making the
     OSPF cost reflect hop counts.
   RTB(config)# inter s 0
   RTB(config-if)# ip ospf cost 1000
     Note: The metric for this interface is now 1000.

  Note: For the Cisco IOS cost formula to be accurate it is important
    to have appropriate costs on both sides of a link.
                                                                                 78
      4. Calculating the Routing Table
 In the next chapter we will discuss OSPF and multiple areas.
 Here is some information regarding the routing table calculation that we will
  discuss again in the chapter on OSPF multiple areas:
 OSPF areas are designed to keep issues like flapping links within an area.
 SPF is not recalculated if the topology change is in another area.
 The interesting thing is that OSPF distributes inter-area (between areas)
  topology information using a distance-vector method.
 OSPF uses link-state principles only within an area.
 ABRs relay routing information between areas via distance vector technique
  similar to RIP or IGRP.




                                                                            79
     4. Calculating the Routing Table
FYI: The rest of the story, which will be discussed in OSPF multiple
   areas.
OSPF areas are designed to keep issues like flapping links within an area.
   SPF is not recalculated if the topology change is in another area. The
   interesting thing is that OSPF distributes inter-area (between areas)
   topology information using a distance-vector method. OSPF uses link-
   state principles only within an area. ABRs do not announce topological
   information between areas, instead, only routing information is injected
   into other areas. ABRs relay routing information between areas via
   distance vector technique similar to RIP or IGRP. This is why show ip
   ospf does not show a change in the number of times SPF has been
   executed when the topology change is in another area.

   Note: It is still a good idea to perform route summarization between
   areas, announcing multiple routes as a single inter-area route. This will
   hide any changes in one area from affecting routing tables in other areas.

   For more information, look at Cisco IP Routing by Alex Zinin.



                                                                              80
    4. Calculating the Routing Table
SPF Holdtime
• SPF algorithm is CPU intensive and takes some time depending upon the
  size of the area (coming next week), the number of routers, the size of the
  link state database.
• A flapping link can cause an OSPF router to keep on recomputing a new
  routing table, and never converge.
• To minimize this problem:
    – SPF calculations are delayed by 5 seconds after receiving an LSU
       (Link State Update)
    – Delay between consecutive SPF calculations is 10 seconds
• 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).
Router(config-router)#timers spf spf-delay spf-holdtime



                                                                           81
  4. Calculating the Routing Table
RTB#show ip ospf 1
Routing Process "ospf 1" with ID 10.6.0.1
<OUTPUT OMITTED>
  Area BACKBONE(0)
    Number of interfaces in this area is 2
    Area has no authentication
    SPF algorithm executed 5 times
    Area ranges are
    Number of LSA 4. Checksum Sum 0x1D81A
    Number of opaque link LSA 0. Checksum Sum 0x0
    Number of DCbitless LSA 0
    Number of indication LSA 0
    Number of DoNotAge LSA 0
    Flood list length 0

                                                    82
   5.Maintaining the LSDB and the Routing
                    Table
Routes are kept in the IP routing table (show ip route)
• Note: There is a routing table which is internal to the OSPF process. This
   internal routing table contains information used as an intermediate result
   for inter-area and external route calculations and contains routes to ABRs
   and ASBRs. (Just a technical note and fyi.)

    RouterA#show ip route
    Codes: I - IGRP derived, R - RIP derived, O - OSPF derived, C - connected, S - static, E -
        EGP derived, B - BGP derived, * - candidate default route, IA - OSPF inter area route, i
        - IS-IS derived, U - per-user static route, o - on-demand routing, D - EIGRP, EX - EIGRP
        external, E1 - OSPF external type 1 route, E2 - OSPF external type 2 route, N1 -
        OSPF NSSA external type 1 route, N2 - OSPF NSSA external type 2 route
    2.0.0.0/8 is subnetted, 1 subnets
    C      2.2.202.0 is directly connected, Loopback0
    O IA 206.202.0.0/24 [110/84] via 206.202.2.1, 00:10:45, Ethernet0
    O 206.202.1.0/24 [110/74] via 206.202.2.1, 00:10:46, Ethernet0
    C 206.202.2.0/24 is directly connected, Ethernet0
    O E2 10.0.0.0/8 [110/500] via 206.202.2.1, 00:10:46, Ethernet0
    O E2 162.10.0.0/16 [110/500] via 206.202.2.1, 00:10:46, Ethernet0
    O IA 192.10.10.0/24 [110/148] via 206.202.2.1, 00:10:46, Ethernet0
    O IA 192.10.5.0/24 [110/158] via 206.202.2.1, 00:10:46, Ethernet0
                                                                                           83
5.Maintaining the LSDB and the Routing
                 Table
Convergence

OSPF convergence time for intra-area routing is determined by the amount of
  time routers spend on:
 Link-failure or neighbor unreachability detection
 Origination of the new LSA
 Flooding the new version of the LSA to all routers
 SPF calculation on all routers

When inter-area routing is considered, installation or removal of a route in the
  routing table may trigger the need to send LSAs to other areas.
 New inter-area routes may need to be calculated in the other areas.
 Remember, OSPF distributes inter-area (between areas) topology
  information using a distance-vector method.
 OSPF uses link-state principles only within an area, so changes in other
  areas to not cause the router to re-run the SPF algorithm.


                                                                             84
5.Maintaining the LSDB and the Routing
                 Table

Convergence
Link-failure or neighbor unreachability detection
 In OSPF, link failure can be determined by:
    • Physical layer or data link layer – directly reporting a state
      change on a directly connected interface.
    • The Hello subprotocol – The router‘s interface has not
      received a Hello packet from an adjacent neighbor within the
      OSPF RouterDeadInterval time (40 seconds or 120
      seconds on NBMA links).




                                                                85
       5.Maintaining the LSDB and the Routing
     Convergence        Table
     Origination of the new LSA
     • Creating the new LSA (Router LSA – Type 1) is quick and simple.
     • The LSA (Router LSA - Type 1) is sent in an LSU (OSPF Type 4).
     • More in the next chapter on LSA types.
                                                                                           Router LSA
                                                                        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
                   LSU packet                                           +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |              LS age              |     Options    |    1      |
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
                                                                        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |                          Link State ID                        |
|   Version #   |       4       |         Packet length         |
                                                                        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |                       Advertising Router                      |
|                          Router ID                            |
                                                                        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |                       LS sequence number                      |
|                           Area ID                             |
                                                                        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |           LS checksum            |              length        |
|           Checksum            |             AuType            |
                                                                        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |    0      |V|E|B|        0       |             # links        |
|                       Authentication                          |
                                                                        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |                             Link ID                           |
|                       Authentication                          |
                                                                        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |                            Link Data                          |
|                            # LSAs                             |
                                                                        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |      Type       |     # TOS      |             metric         |
|                                                               |
                                                                        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-                                                            +-+
                                                                        |                                 ...                           |
|                             LSAs                                  |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |       TOS       |        0       |          TOS metric        |
+-                                                            +-+
                                                                        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             ...                               |
                                                                        |                             Link ID                           |
                                                                        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |                            Link Data                          |
                                                                        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |                                 ...                           |




                                                                                                                                        86
 OSPF packet types – More later

OSPF Type-4 packets have 7 LSA packets
(later)




                                         87
       5.Maintaining the LSDB and the Routing
     Convergence        Table
     Origination of the new LSA (continued)
     • FYI: LSAs are not originated any faster than every 5 seconds (MinLSInterval) to prevent
         flooding storms in unstable networks.
     • When the router wants to report a down link, it sets the LS Age field to the MaxAge value
         (3,600 seconds), which tells routers to flush this entry from their LSDB.
                                                                        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
                  LSU                                    Router         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |              LS age              |     Options    |    1      |

                  packet                                 LSA            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |                          Link State ID                        |
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+       |                       Advertising Router                      |
|   Version #   |       4       |         Packet length         |       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+       |                       LS sequence number                      |
|                          Router ID                            |       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+       |           LS checksum            |              length        |
|                           Area ID                             |       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+       |    0      |V|E|B|        0       |             # links        |
|           Checksum            |             AuType            |       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+       |                             Link ID                           |
|                       Authentication                          |       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+       |                            Link Data                          |
|                       Authentication                          |       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+       |      Type       |     # TOS      |             metric         |
|                            # LSAs                             |       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+       |                                 ...                           |
|                                                               |       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-                                                            +-+       |       TOS       |        0       |          TOS metric        |
                                                                        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             LSAs                                  |
                                                                        |                             Link ID                           |
+-                                                            +-+       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             ...                               |       |                            Link Data                          |
                                                                        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                                                        |                                 ...                           |




                                                                                                                                        88
5.Maintaining the LSDB and the Routing Table
     Convergence
     Flooding the new version of the LSA to all routers
      The router detecting the link failure floods the LSA (Router LSA type-1)
        using the LSU (OSPF type 4) as previously discussed (and will be
        discussed again next chapter).
      Note: OSPF represents intra-area network topology using a type-1
        Router LSA or type-2 Network LSA (next chapter).
      The time it takes to flood an LSA depends on:
         • Complexity of the network topology
         • Bandwidth of the links
         • CPU power of the router
      OSPF relies on hop-by-hop flooding - it does not try to send LSAs
        directly to all routers in the OSPF domain.
      This means that any router receiving an LSA will flood them out all other
        OSPF interfaces (not out the interface it was received) -so that LSAs are
        not flooded back to the sending neighbors.
      The age field is incremented by 1.

                                                                            89
5.Maintaining the LSDB and the Routing
                 Table
Convergence
Flooding the new version of the LSA to all routers
 The LSA (Router LSA type-1) containing the new link-state
   information using the LSU (OSPF type 4) and sends it to:
    • Point-to-point links (No DR/BDR): LSU sent to 224.0.0.5
       AllSPFRouters
    • Multi-access networks: LSU sent to 224.0.0.6 AllDRrouters
       (DR/BDR)
        • When DR receives and acknowledges LSU, it floods the
           LSU to 224.0.0.5 AllSPFRouters.
        • Each router acknowledges the receipt of the of the LSU
           with a LSAck back to the DR.


                                                            90
  5.Maintaining the LSDB and the Routing
Convergence        Table
Flooding the new version of the LSA to all routers

Receiving Router: LSA Installation and SPF Scheduling
Upon receiving an LSU with new information, the OSPF router:
 Sends an LSAck (LSA Acknowledgement) packet to the sender.
 Determines if the it has this information in its LSDB. (This happens if
  the LSA is received or originated by the router.)
    • For Intra-area routes: (Type 1, Router and Type 2, Network LSAs)
• If the LSA does not exist in the LSDB or is a newer version, the router
  schedules the SPF calculation.
    • For Inter-area routes: (Type 3, 4, 5 LSAs - later)
        • Inter-area routes (announced by the ABR – later) are
          distributed using a distance vector technique. What is
          important here is that this does not cause the router to
          schedule the SPF calculation.
                                                                     91
5.Maintaining the LSDB and the Routing Table
  OSPF Type 5 – Link State Acknowledgement
                       0                   1                    2                  3
  Packet               0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
                     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                     |    Version #   |       5       |           Packet length        |
                     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                     |                           Router ID                             |
                     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                     |                            Area ID                              |
                     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                     |            Checksum            |               AuType           |
                     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                     |                        Authentication                           |
                     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 OSPF packet types   |                        Authentication                           |
                     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                     |                                                                 |
                     +-                                                              -+
                     |                                                                 |
                     +-                                      An LSA Header           -+
                     |                                                                 |
                     +-                                                              -+
                     |                                                                 |
                     +-                                                              -+
                     |                                                                 |
                     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                     |                               ...                               |




                                                                                 92
5.Maintaining the LSDB and the Routing Table
     Receiving Router: LSA Installation and SPF Scheduling
       (cont.)
      After SPF hold timer expires (5 seconds), router runs SPF
       algorithm and creates a new routing table
      Router uses new routing table

     Periodic updates
      Each LSA entry in the link-state database has its own age
       timer, with a default of 60 minutes (3,600 seconds). – this is
       known as the MaxAge value of the LSA entry.
      When an LSA reaches MaxAge, it is flushed from the LSDB.
      Before this happens the LSA has a Link State Refresh Time
       (LSRefreshTimer), 30 minutes, (1,800 seconds) and when
       this time expires the router that originated the LSA will
       floods a new LSA to all its neighbors, who will reset the age of
       the LSA in its LSDB.
      This is also known as the ―paranoid update.‖ or ―periodic
       update.‖
      These updates do not trigger recalculation of the routing table.
                                                                  93
States of the OSPF neighbor FSM (Finite State Machine)
 Every OSPF router represents its communications with other OSPF routers
   in the form of neighbor data structures.
 Every neighbor can be in one of many states
1. Establishing router adjacencies
     • Down State – No Hello received
     • Init State – Hello received, but not with this router‘s Router ID
     • Two-way State – Hello received, and with this router‘s Router ID
     • (ExStart State unless DR/BDR election needed)
2. Electing DR and BDR – Broadcast segments only
     • ExStart State – Router interfaces with DR and BDR
     • Two-way State – Router interfaces with all other routers
3. Discovering Routes
     • ExStart State –Starts LSDB synchronization process between
        neighbors. Decide on Master/Slave.
     • Exchange State – Routers exchange DBD packets and determines if
        there is anything in its Link State Request list.
     • Loading State – If entries in LSR list, exchange LSUs.
     • Full State – Once LSDBs are synchronized.
4. Calculating the Routing Table
5. Maintaining the LSDB and Routing Table

                                                                    94
Configuring OSPF within a
       Single Area




                            95
Configuring OSPF within a Single Area
 Rtr(config)# router ospf process-id
 Rtr(config-router)#network address wildcard-mask area area-id
 Rtr(config-router)# area area authentication [message-digest]



 Rtr(config)# interface type slot/port
 Rtr(config-if)# ip ospf priority <0-255>
 Rtr(config-if)# bandwidth kbps
 RTB(config-if)# ip ospf cost cost
 Rtr(config-if)# ip ospf hello-interval seconds
 Rtr(config-if)# ip ospf dead-interval seconds
 Rtr(config-if)# ip ospf authentication-key passwd
 Rtr(config-if)# ip ospf message-digest-key key-id md5 [encryption-
    type] password
                                                              96
Configuring the Process ID

Rtr(config)# router ospf process-id

 process-id: 1 - 65,535
 Cisco feature, which allows you to run multiple, different OSPF
  routing processes on the same router.
 Note: FYI - Cisco IOS limits the number of dynamic routing
  processes to 30. This is because it limits the number of protocol
  descriptors to 32, using one for connected route sources, one
  for static route sources, and 30 for dynamic route sources.
 Process-id is locally significant, and does not have to be the
  same number on other routers (they don‘t care).
 This is different than the process-id used for IGRP and EIGRP
  which must be the same on all routers sharing routing
  information.

                                                               97
Network command
Rtr(config)# router ospf process-id
Rtr(config-router)#network address wildcard-mask area area-id

• Tells OSPF which interfaces to send and receive updates on,
  matching the address and wildcard mask..
• Wildcard is necessary because OSPF supports CIDR and VLSM
• Most of the time you can just use an inverse-mask (like access-
  lists) as the network wildcard mask.

Rtr(config-if)#ip add 10.5.1.1 255.255.255.0

Rtr(config)# router ospf 10
Rtr(config-router)#network 10.5.1.0 0.0.0.255 area 0


                                                           98
Other times you may wish to get more specific or less specific.

Rtr(config-if)#ip add 10.5.1.1 255.255.255.0

Rtr(config)# router ospf 10
Rtr(config-router)#network 0.0.0.0 255.255.255.255 area 0
• Matches all interfaces on this router

Rtr(config)# router ospf 10
Rtr(config-router)#network 10.5.1.2 0.0.0.0 area 0
• Matches only the interface 10.5.1.2 and not any other 10.5.1.n
   interfaces.

• Let‘s take a look at an example from Jeff Doyle‘s book,
  Routing TCP/IP Volume I.
• We will use Jeff‘s diagram and some of his explanations.
• Note: This is not a template of how to use the network
  command, but is an example showing you various options.

                                                                  99
From Routing TCP/IP Vol. I, Jeff Doyle


              192.168.30.0/29                            192.168.20.0/30                192.168.10.0/27             192.168.10.0/26


         .1                  .9          .10             .1            .2          .1                .2               .65

                                                                                                   .33
                Rubens                         Chardin                      Goya                          Matisse
                                                                                        192.168.10.0/28

                   Area 1                                     Area 0               Area 192.168.10.0

                    Rubens
                    router ospf 10
                       network 0.0.0.0 255.255.255.255 area 1

                     This will match all interfaces on the router.
                     The address 0.0.0.0 is just a placeholder, the inverse mask of
                      255.255.255.255 does the actual matching with ―don‘t care‖ bits
                      placed across the entire four octets of the address.
                     This method provides the least precision control and is generally
                      discouraged against, as you may bring up another interface on the
                      router and you did not mean to run OSPF on that interface.


                                                                                                                             100
From Routing TCP/IP Vol. I, Jeff Doyle


              192.168.30.0/29                            192.168.20.0/30                192.168.10.0/27             192.168.10.0/26


         .1                  .9          .10             .1            .2          .1                .2               .65

                                                                                                   .33
                Rubens                         Chardin                      Goya                          Matisse
                                                                                        192.168.10.0/28

                   Area 1                                     Area 0               Area 192.168.10.0



                   Chardin
                   router ospf 20
                     network 192.168.30.0 0.0.0.255 area 1
                     network 192.168.20.0 0.0.0.255 area 0

                    Chardin is a ABR (Area Border Router) which we will discuss next
                     chapter, and belongs to two different areas.
                    We need to be more specific here as each interface belongs to a
                     different area.
                    Here we are saying that any interface that has 192.168.30.n in the first
                     three octets belongs to area 1 and any interface that has 192.168.20.n in
                     the first three octets belongs to area 0.
                    Notice that the inverse mask does not have to inversely match the
                     subnet mask of the interface (255.255.255.248 and 255.255.255.252).

                                                                                                                            101
From Routing TCP/IP Vol. I, Jeff Doyle


              192.168.30.0/29                            192.168.20.0/30                192.168.10.0/27             192.168.10.0/26


         .1                  .9          .10             .1            .2          .1                .2               .65

                                                                                                   .33
                Rubens                         Chardin                      Goya                          Matisse
                                                                                        192.168.10.0/28

                   Area 1                                     Area 0               Area 192.168.10.0

                   Goya
                   router ospf 30
                      network 192.168.20.0 0.0.0.3 area 0.0.0.0
                      network 192.168.10.0 0.0.0.31 area 192.168.10.0

                    Goya is also an ABR.
                    The network statements will only match the specific subnets configured
                      on the two interfaces.
                    /30 = 255.255.255.252 = 11111100 00 = host bits
                     3 = 00000011 - Match last two bits of subnet mask

                        /27 = 255.255.255.224 = 11100000 00000 = host bits
                        31 = 00011111 - Match last five bits of subnet mask



                                                                                                                            102
From Routing TCP/IP Vol. I, Jeff Doyle


              192.168.30.0/29                            192.168.20.0/30                192.168.10.0/27             192.168.10.0/26


         .1                  .9          .10             .1            .2          .1                .2               .65

                                                                                                   .33
                Rubens                         Chardin                      Goya                          Matisse
                                                                                        192.168.10.0/28

                   Area 1                                     Area 0               Area 192.168.10.0


                   Goya
                   router ospf 30
                      network 192.168.20.0 0.0.0.3 area 0.0.0.0
                      network 192.168.10.0 0.0.0.31 area 192.168.10.0

                    Goya is also an ABR.
                    Also notice that you can use an dotted decimal notation to represent an
                     area.
                    In my experience it is not very common, but when it is used, most people
                     use the network address.
                    Area 0 can be represented as 0 or 0.0.0.0.
                      – When the dotted decimal is used OSPF packets are converted to ―0‖
                         so the two can be compatible.

                                                                                                                            103
From Routing TCP/IP Vol. I, Jeff Doyle


              192.168.30.0/29                            192.168.20.0/30                192.168.10.0/27             192.168.10.0/26


         .1                  .9          .10             .1            .2          .1                .2               .65

                                                                                                   .33
                Rubens                         Chardin                      Goya                          Matisse
                                                                                        192.168.10.0/28

                   Area 1                                     Area 0               Area 192.168.10.0


               Matisse
               router ospf 40
                  network 192.168.10.2 0.0.0.0 area 192.168.10.0
                  network 192.168.10.33 0.0.0.0 area 192.168.10.0

                Matisse has one interface, 192,168,10.65/26, which is not running OSPF.
                The network statements for this router are configured specifically for the
                 individual addresses and the inverse mask indicates that all 32 bits must
                 match exactly.
                This method provides the most precise control over which interfaces will
                 run OSPF.




                                                                                                                             104
Bandwidth command

Rtr(config-if)# bandwidth 128 (in Kbps)

 Set the bandwidth metric on a specific interface.


ip ospf cost command

RTB(config-if)# ip ospf cost 1000

 Configures the cost metric for a specific interface




                                                        105
Loopback interface

Rtr(config)# interface loopback 0
Rtr(config-if)# ip add 10.1.1.1 255.255.255.0
 Very useful in setting Router IDs.


Configuring OSPF Router Priority (DR/BDR)

Rtr(config)# interface fastethernet 0
Rtr(config-if)# ip ospf priority <0-255>
 Higher priority becomes DR/BDR
 Default = 1
 0 = Ineligible to become DR/BDR


                                                106
Configuring Authentication
Rtr(config-if)# ip ospf authentication-key passwd
or
Rtr(config-if)# ip ospf message-digest-key key-id md5
   [encryption-type] password
 password = Clear text unless message-digest is used.
 Key-id = 1 to 255, must match on each router to authenticate.
 Encryption-type = 0 to 7, 0 is default, 7 is Cisco proprietary
   encryption
 After a password is configured, you enable authentication for
   the area on all participating area routers with:
Rtr(config-router)# area area authentication [message-digest]
 message-digest option must be used if using message-
   digest-key
 If optional message-digest is used, a message digest, or hash,
   of the password is sent.
                                                            107
Configuring timers

Rtr(config-if)# ip ospf hello-interval seconds
Rtr(config-if)# ip ospf dead-interval seconds

 For OSPF routers to be able to exchange information, the must
  have the same hello intervals and dead intervals.
 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)

Defaults
 On broadcast networks hello interval = 10 seconds, dead
  interval 40 seconds.
 On non-broadcast networks hello interval = 30 seconds, dead
  interval 120 seconds.
                                                               108
         Show commands
 We will be looking at these commands in much
  more detail in the next chapter on Multi-area
  OSPF.
 Many of these commands give us specific
  information about areas and the routes in those
  areas.
 Since we have not discussed areas yet, we will
  only take a brief look at the command now.



                                                109
OSPF Routing Protocol Information

Rtr# show ip protocols


OSPF Specific Information

Rtr# show ip ospf

• Number of SPF calculations, timers, area information,...


OSPF Routing Table

Rtr# show ip route


                                                             110
   OSPF Interface Information
Rtr# show ip ospf interface
Ethernet0 is up, line protocol is up
 Internet Address 206.202.2.1/24, Area 1
 Process ID 1, Router ID 1.2.202.206, Network Type BROADCAST, Cost: 10
 Transmit Delay is 1 sec, State BDR, Priority 1
 Designated Router (ID) 2.2.202.206, Interface address 206.202.2.2
 Backup Designated router (ID) 1.2.202.206, Interface address 206.202.2.1
 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
  Hello due in 00:00:00
 Neighbor Count is 1, Adjacent neighbor count is 1
  Adjacent with neighbor 2.2.202.206 (Designated Router)
 Suppress hello for 0 neighbor(s)
Serial0 is up, line protocol is up
 Internet Address 206.202.1.2/24, Area 1
 Process ID 1, Router ID 1.2.202.206, Network Type POINT_TO_POINT, Cost: 64
 Transmit Delay is 1 sec, State POINT_TO_POINT,
 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
  Hello due in 00:00:04
 Neighbor Count is 1, Adjacent neighbor count is 1
  Adjacent with neighbor 2.0.202.206
 Suppress hello for 0 neighbor(s)

                                                                         111
  Displaying adjacencies

RouterB#show ip ospf neighbor

Neighbor ID    Pri   State          Dead Time   Address
   Interface
1.5.202.206      1   FULL/DROTHER   00:00:33    206.202.0.3
   Ethernet0
1.10.202.206     1   FULL/BDR       00:00:32    206.202.0.4
   Ethernet0
1.0.202.206      1   FULL/DROTHER   00:00:30    206.202.0.1
   Ethernet0
1.2.202.206      1   FULL/   -      00:00:32    206.202.1.2
   Serial0


          •OSPF routers keep a list of all neighbors
          that they have established bi-directional
          communication with.
                                                              112
Displaying the Link State Database

Rtr# show ip ospf database

• Displays the link state database
• OSPF routers keep track of all other routers in the internetwork.
• Much more next chapter on multi-area ospf.




                                                               113
                        NBMA
• Non-Broadcast Multi-access Access Networks.
   – Frame Relay
   – X.25
• NOTE: Consult CCNA Semester 4 or CCNP Remote
  Access information for specifics on Frame Relay and
  X.25 router configurations.
• OSPF over Frame Relay
  http://www.cisco.com/warp/public/104/22.html
  http://www.cisco.com/warp/public/125/26.html


                                                    114
NBMA Networks and OSPF




                         115
      NBMA Networks and OSPF
Two issues of concern regarding Frame Relay and OSPF:
• network type mismatches
• hello and dead timer mismatches

• Both ends of the PVC must be configured the same.




                                                        116
     NBMA Networks and OSPF
Network Types
Router# show ip ospf interface interface number
Router(config-if)# ip ospf network ?
   – Broadcast
   – nonbroadcast
   – point-to-point
   – point-to-mulitpoint
   – loopback




                                             117
         NBMA Networks and OSPF
Network Types
Cisco routers can treat NBMA interfaces using any of the following:
Non-Broadcast
• OSPF is aware that multicast packets cannot be sent over the interface and
   sends OSPF packets directly to neighbors using unicast addresses.
• DR and BDR are elected
• DR represent the NBMA cloud as a transit network, using network LSAs
• Suitable only for when the VCs are fully meshed

Broadcast
• OSPF tread the interface as belonging to a broadcast segment, thus using
   multicasts to send OSPF packets.
• DR and BDR are elected
• Suitable only for when the VCs are fully meshed.




                                                                        118
        NBMA Networks and OSPF
Network Types
Cisco routers can treat NBMA interfaces using any of the following:

Point-to-multipoint
• OSPF treats the interface as a placeholder for a set of point-to-
  point adjacencies.
• No DR/BDR is elected
• Very much like point-to-point interfaces, except that every router
  announces a host route to its own IP address.

Point-to-point
• OSPF treats the interface as a set of point-to-point adjacencies
• No DR/BDR is elected.



                                                                 119
         NBMA Networks and OSPF
So, which should I use?
• ―It depends.‖
• It is important that the network type match on all interfaces in the NBMA
   network or you will get a ‗network type mismatch‘ error message.
Fully meshed
• Can use Broadcast or Non-broadcast.
• The main difference between these two is in the way routers discover their
   neighbors.
• Broadcast – routers send broadcast packets and the data link layer is
   responsible for replicating them.
• Non-broadcast – the list of neighbors must be configured manually.




                                                                          120
          NBMA Networks and OSPF
Partial Meshed
• Can use point-to-point or point-to-multipoint.

• For most Hub/Spoke, partial meshed, networks (unless there is a
  large number of routers), configuring the network type as point-
  to-multipoint on all interfaces works just fine.




                                                               121
            NBMA Networks and OSPF
Interface         Hello/Dead Interval Elects DR/BDR?
Broadcast            10/40         DR/BDR
Point-to-Point       10/40         no DR/BDR
Non-Broadcast (Def.)     30/120        DR/BDR
Point-to-Multipoint    30/120        no DR/BDR
• If timers don‘t match, routers can‘t form adjacencies!
Router(config-if)# ip ospf network ?
    – Broadcast
    – nonbroadcast
    – point-to-point
    – point-to-mulitpoint
    – loopback




                                                           122
               Troubleshooting

Why Are OSPF Neighbors Stuck in Exstart/Exchange State?
• http://www.cisco.com/warp/public/104/12.html
• The problem occurs most frequently when attempting to run
  OSPF between a Cisco router and another vendor's router. The
  problem occurs when the maximum transmission unit (MTU)
  settings for neighboring router interfaces don't match. If the
  router with the higher MTU sends a packet larger that the MTU
  set on the neighboring router, the neighboring router ignores the
  packet.
• Since the problem is caused by mismatched MTUs, the solution
  is to change either router's MTU to match the neighbor's MTU.
  Note that Cisco IOS doesn't support changing the physical MTU
  on a LAN interface (such as Ethernet or Token Ring).


                                                              123
                              Troubleshooting
Why Does the show ip ospf neighbor Command Reveal Neighbors Stuck
          in 2-Way State? (This is normal in this situation.)
  In the following topology, all routers are running OSPF neighbors over the Ethernet network:


  Following is sample output of the show ip ospf neighbor command on R7:
  router-7#show ip ospf neighbor

  Neighbor ID Pri      State    Dead Time Address     Interface
  170.170.3.2  1       FULL/BDR   00:00:37 170.170.3.2 Ethernet0
  170.170.3.3  1       2WAY/DROTHER 00:00:30 170.170.3.3 Ethernet0
  170.170.10.8  1      FULL/DR    00:00:39 170.170.3.8 Ethernet0
  170.170.7.4  1       2WAY/DROTHER 00:00:39 170.170.3.4 Ethernet0
  router-7#
  Notice that R7 establishes full adjacency only with the Designated Router (DR) and the Backup
      Designated




                                                                                             124
Issues with large OSPF networks

• Frequent SPF calculations
• Large routing table
• Large link-state table


• This will be discussed next week as we discuss the
  advantages of OSPF and multiple areas!




                                                125

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:15
posted:7/26/2011
language:English
pages:125