Wednesday, April 30, 2014

OSPF Convergence Timers:

Lessons Learned:
----------------------- 
Convergence Timers

Convergence based on hello and dead timer
-Suports sub-second timers

Different timers for different network types 
-#Sh ip ospf Interface 

Changing hello time automatically adjusts dead time
-# ip ospf hello-interval
-# ip ospf dead-interval 


The OSPF timers are mainly going to be based on how long before we can detect the neighbor is down, then how long until we can flood the LSU and then run the SPF. 

One problem we can run into is if the layer two link status to the neighbor is not a good indication of the connectivity - we would then need to reply on the layer 3 timers to figure out if they're down. 

The other issue we run into if we have a switch in the middle is we don't have a direct link to the line protocol status of the other link side because of the layer two path. 

Ideally - before implementing OSPF, we would want to implement some sort of mechanism that can keep track of the layer 2 status end to end of the neighbors. Typically BFD - bidirectional forward direction is used for this. 
This will enable an additional keep alive on the Ethernet link between tow neighbors. 

Ospf Timers - by default 
FastEthernet0/0 is up, line protocol is up 
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 -- By default it will take up 40 seconds to find out if the neighbor is down. 
 
Note: Also if we lower the timers it's very process or intensive for the control plane. 

If we wanted to change the hello -interval we can do the under the interface. 
Example:

We can under the interface - 
R5(config)#interface fa0/0

R5(config-if)#ip ospf hello-interval ?
  <1-65535>  Seconds
to say one second. 

We can also change the dead-interval to minimal - which will by default change the hell-timers to one second. 

R5(config-if)#ip ospf dead-interval minimal 
or
R5(config-if)#ip ospf dead-interval minimal hello-multiplier ?
  <3-20>  Number of Hellos sent within 1 second

The dead interval minimal will change the hello timer to one second, the hello-multiplier - is how many hellos in time will we send within the second. 

Sh ip OSPF interface will show what the timer will be on the link. This is also negotiated during the adjacency so bot sides do need to agree to form the ADJ. 

OSPF Path Selection

Lessons Learned:
-----------------------------------------------------       
OSPF Path Selection
Once databases are synchronized, path selection begins.
Each router’s LSAs include a “cost” attribute for each described link
Best path to that link is the lowest end-to-end cost

Cisco’s implementation uses bandwidth based cost, But per RFC it is arbitrary.
--default cisco cost = 100Mbps / Link bandwidth
--reference bandwidth can be modified to accommodate higher speeds links (e.g Gigabit Ethernet)
This is with the reference bandwidth command under the process.
----------------------------------------------------- 

OSPF Path Selection Order:

Per RFC, OSPF path selection state machine prefers….
-intra area routes (O) – Will always choose these routes over all others, despite the cost of the link.
-Inter area routes (O IA)
-External Tyoe 1 (E1)
-External Type 2 (E2)
-NSSA Type 1 (N1)
-NSSA Type 2 (N2)
Cannot be modified with metric or distance – because we need to make sure all the devices come up with the same
Shorten path tree based on the link state database.

Note we will still use the longest match in the routing table to figure out where the traffic is going to go. If there is equal longest matches – one intra and one Inter area routes, OSPF will still always choose the Intra area. Regardless of metric or distance.


Path selection Topology:
-------------------------------------

















Sh ip ospf int bri
R2#sh ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Gi0/0        10    0               192.168.24.2/24    1     DR    1/1
Fa1/0        10    0               192.168.12.2/24    1     BDR   1/1
Fa1/1        10    5               10.1.5.2/24        1     DR    1/1
R2#

We see here that I have 3 interfaces running OSPF. We can also see that int FA1/1 is in Are 5.
This means that  R2 is not an area border router. It should now be generating two separate router LSA’s.
One for area 5 and one for are 0.

Additionally any routes that are leaned in the are 5 links – those routes will be sent into Area 0 using the LSA Type 3 or Network summary LSA. This is considered a summary because we’re not summarizing  the NLRI – the actual prefixes – we are summarizing the topology information.

So when we do Intra area lookups, we’re going the run SPF for the destination. For Inter area lookups, between the area’s. we will use the OSPF cost derived to the are border router PLUS whatever values they are reporting in with the summary LSA.

Now let’s look at the Database.

============== 
R2#sh ip ospf database

            OSPF Router with ID (192.168.24.2) (Process ID 10) – For the part we can see all the routers in Area 0 and their respective links in area 0


                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.1.11.1       10.1.11.1       434         0x80000009 0x0006E4 3
192.168.24.2    192.168.24.2    374         0x80000009 0x0021E5 3
192.168.34.3    192.168.34.3    426         0x80000008 0x00666E 3
192.168.34.4    192.168.34.4    366         0x80000007 0x00227C 4

                Net Link States (Area 0) If we did not see this link state – it would mean that there is no designated router on these segments (ex: all P2P links) These are the DR’s.

Link ID         ADV Router      Age         Seq#       Checksum
192.168.12.1    10.1.11.1       470         0x80000001 0x00EA27
192.168.13.1    10.1.11.1       434         0x80000001 0x007095
192.168.24.2    192.168.24.2    374         0x80000001 0x00AB74

                Summary Net Link States (Area 0) – These are the Inter area routes that are generated by the Area Border routers. These are the LSA type 3’s – they are used to describe the Inter are routes.

Link ID         ADV Router      Age         Seq#       Checksum
6.6.6.0         192.168.34.4    218         0x80000003 0x00ADE9
7.7.7.0         192.168.34.3    141         0x80000001 0x00EDA0
10.1.5.0        192.168.24.2    459         0x80000003 0x00099D
10.1.6.0        192.168.34.4    366         0x80000002 0x00ADEC
10.1.7.0        192.168.34.3    425         0x80000003 0x00018F

                Router Link States (Area 5)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.1.5.5        10.1.5.5        207         0x80000008 0x00D307 1
192.168.24.2    192.168.24.2    323         0x80000004 0x00C043 1

                Net Link States (Area 5)

Link ID         ADV Router      Age         Seq#       Checksum
10.1.5.2        192.168.24.2    323         0x80000001 0x007E8D

                Summary Net Link States (Area 5)

Link ID         ADV Router      Age         Seq#       Checksum
1.1.1.0         192.168.24.2    465         0x80000001 0x00B8FB
2.2.2.0         192.168.24.2    465         0x80000001 0x008A28
4.4.4.0         192.168.24.2    355         0x80000003 0x004861
6.6.6.0         192.168.24.2    220         0x80000001 0x000E96
7.7.7.0         192.168.24.2    135         0x80000001 0x00A8E5
10.1.6.0        192.168.24.2    355         0x80000003 0x00089C
10.1.7.0        192.168.24.2    415         0x80000003 0x00BBD4
192.168.12.0    192.168.24.2    466         0x80000001 0x009CA6
192.168.13.0    192.168.24.2    466         0x80000001 0x00F542
192.168.24.0    192.168.24.2    466         0x80000001 0x00181F
192.168.34.0    192.168.24.2    361         0x80000003 0x0028C2
R2#

So when a router wants to get to an Inter area route  - it will basically look in the database. Ex: the router will
Do a #sh ip ospf database summary 6.6.6.0 –

R2#sh ip ospf database summary 6.6.6.6

            OSPF Router with ID (192.168.24.2) (Process ID 10)
R2#sh ip ospf database summary 6.6.6.0

            OSPF Router with ID (192.168.24.2) (Process ID 10)

                Summary Net Link States (Area 0)

Note: we can see this route is being advertised by two routers R4 and R2.

  Routing Bit Set on this LSA
  LS age: 569
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 6.6.6.0 (summary Network Number)
  Advertising Router: 192.168.34.4 – Says’ this route is being originated by this router (R4)
  LS Seq Number: 80000003
  Checksum: 0xADE9
 Length: 28
  Network Mask: /24
        TOS: 0  Metric: 2  - this route has a metric of 2 to reach the destination


                Summary Net Link States (Area 5)

  LS age: 570
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 6.6.6.0 (summary Network Number)
  Advertising Router: 192.168.24.2 Says’ this route is being originated by this router (R2)
  LS Seq Number: 80000001
  Checksum: 0xE96
  Length: 28
  Network Mask: /24
        TOS: 0  Metric: 3  this route has a metric of 3 to reach the destination

Based on this output we can’t determine which path we’re going to choose. We will then need to look at what is the SPF cost inside out own area in order to reach the ABR’s.

S we would look at our SFP cost to reach these routers then add that the metric these routers are advertising. This would be the total cost that would what get installed in the routing table.

So from each advertising router:

R2#sh ip route 6.6.6.0
Routing entry for 6.6.6.0/24
  Known via "ospf 10", distance 110, metric 3, type inter area – R2 is using a metric of “3”
  Last update from 192.168.24.4 on GigabitEthernet0/0, 00:18:34 ago
  Routing Descriptor Blocks:
  * 192.168.24.4, from 192.168.34.4, 00:18:34 ago, via GigabitEthernet0/0
      Route metric is 3, traffic share count is 1

------------------------------------------------------------------------------------------------ 

R4#sh ip route 6.6.6.0
Routing entry for 6.6.6.0/24
  Known via "ospf 10", distance 110, metric 2, type intra area R4 is using a metric of “2”
  Last update from 10.1.6.6 on FastEthernet2/0, 00:19:37 ago
  Routing Descriptor Blocks:
  * 10.1.6.6, from 10.1.6.6, 00:19:37 ago, via FastEthernet2/0
      Route metric is 2, traffic share count is 1


Note: So to truly figure out the cost to the route we need to add the cost of the advertising router and the summary cost.

Traffic Engineering –
If we wanted to them modify the path section – we could change the value the ABR is reporting in. Or we can change the local SPF cost in order to reach them. Again whatever is the lowest end-to-end cost will be the path.

Summary – the inter area lookups, the routers DO NOT know what’s going on in the topology beyond the ABR.
This adds to the stability of OSPF because the intra are feature will determine the flooding domain. So for example,
If there’s a change in one of the other areas’ the local area doesn't need to do anything, it just needs to know about the new Inter area metric. Etc.

Modifying OSPF Path Selection:

OSPF uses bandwidth based cost
--COST = Reference _ BW / Interface BW – if we change the bandwidth, it will change the cost. 
The only issue is the Bandwidth statement can affect other operations in the network.

Cost can be modified with
-interface bandwidth                
                   
-Interface ip ospf cost - would be the best way to change the cost. 

-Process auto-cost - This will change the reference bandwidth, EX; i the REF bandwidth is 100Mbps and th einterface bandwidth is 100Mbps a second. The result would be a cost of 1. 

Process neighbor (address) cost

More examples: lets say we want to change the cost of a 10Gig link. The Cost of that link will be a cost of 5. 
You can use the Show commands on the router to help figure this out. Or remember the formula of how OSPF does the calculation. #Cost = reference
 BW / Interface BW. This is why the default 100 Mbps OSPF cost and a 100MB link are a cost of =1. 

Ex: if I were to go to my router 4 in the topology and change the bandwidth on my FastEthernet2/0 Link to 10 GB - and we can see the result of the cost is. 

R4(config)#interface fastEthernet 2/0
R4(config-if)#bandwidth 10000000

R4#sh ip ospf interface fa2/0 | in Cost
  Process ID 10, Router ID 4.4.4.4, Network Type BROADCAST, Cost: 1

The Cost value is set at one. That is because anytime we go over 100Mbps everything is going to be a cost of 1. 

So we would then need to go under the OSPF process and cahge the auto-cost reference bandwidth. 
EX:
R4(config)#router ospf 10
R4(config-router)#au
R4(config-router)#auto-cost re
R4(config-router)#auto-cost reference-bandwidth ?
  <1-4294967>  The reference bandwidth in terms of Mbits per second

R4(config-router)#auto-cost reference-bandwidth 4294967 - I set this to the maximum to see what the new cost of the link would be --

R4#sh ip ospf interface fa2/0 | in Cost
  Process ID 10, Router ID 4.4.4.4, Network Type BROADCAST, Cost: 429
R4#

So if i want the cost the link to be "5", I will need to change / find the auto-cost ref bandwidth. 
By trial and error a ref bandwicth of 50000 set the cost of the link to "5"

R4(config)#router ospf 10                    
R4(config-router)#auto-cost reference-bandwidth 50000

R4#sh ip ospf interface fa2/0 | in Cost
  Process ID 10, Router ID 4.4.4.4, Network Type BROADCAST, Cost: 5
R4#

Note: if you change the auto cost - you will need to change it everywhere of you will have errors in the calculation. Typically in today's network you would want to change the auto-cost ref, because otherwise anything over 100Mb will be a cost of 1. 

FastEthernet2/0 is up, line protocol is up 
  Internet Address 10.1.6.4/24, Area 6 
  Process ID 10, Router ID 4.4.4.4, Network Type BROADCAST, Cost: 5 - We can see the link i changes has thecost we wanted of 5 

Serial1/0 is up, line protocol is up 
  Internet Address 192.168.34.4/24, Area 0 
  Process ID 10, Router ID 4.4.4.4, Network Type POINT_TO_POINT, Cost: 32383 - But because we didn't change the reference bandwidth everywhere we can see the cost of the other links has dramatically changed. 

GigabitEthernet0/0 is up, line protocol is up 
  Internet Address 192.168.24.4/24, Area 0 
  Process ID 10, Router ID 4.4.4.4, Network Type BROADCAST, Cost: 50

Note: if bandwidth is Kilobits. a bandwidth - so 2000 would equal a 2MB connection. 
The more 0's we ad the higher the BANDWIDTH
EX: 
2000 - 2 mb
20000 - 20 mb
200000 - 200 mb
2000000 - 2 GB
20000000 - 20 GB 

 Compared to EIGRP the patch selections straight forward. We simply add the cost value on a hop-by-hop basis

Note: Remember though, if its a different type of router there's no was we can change that. EX:
Intra area Vs Inter area. the "O" or intra will always win over the "O IA" routes. 

Friday, April 25, 2014

OSPF Network type Loopback:

Lessons Learned:

OSPF Network Loopback
Special case for loopback and Looped-back interfaces

Advertises link as /32 stub host route

#ip ospf network point-top-point
Used to disable this behavior
------------------------------------------------------------------

In ospf – a software loopback (loopback interface) can be configured locally with a /24. But when we go to another routers routing table we should see it as a /32


Local Router:
R1#sh run interface lo1

interface Loopback1
 ip address 1.1.1.1 255.255.255.0
end

Adj Router:

R2#sh ip route 1.1.1.1

Routing entry for 1.1.1.1/32
  Known via "ospf 1234", distance 110, metric 2, type intra area
  Last update from 192.168.12.1 on FastEthernet0/0, 00:02:36 ago
  Routing Descriptor Blocks:
  * 192.168.12.1, from 1.1.1.1, 00:02:36 ago, via FastEthernet0/0
      Route metric is 2, traffic share count is 1

The reason for this is if we s hip ospf interface for the local loopback. We will see the Network type is “loopback”. It’s treated as a /32

R1#sh ip ospf interface lo1
Loopback1 is up, line protocol is up
  Internet Address 1.1.1.1/24, Area 0
  Process ID 1234, Router ID 1.1.1.1, Network Type LOOPBACK, Cost: 1
  Loopback interface is treated as a stub Host
R1#

If we do not want it to be treated as a /32, we need to disable the network type at the link level.

Ex:

R1(config)#interface loopback 1
R1(config-if)#ip ospf network point-to-point

Now if we look at the interface again we should see the netwokr tyoe as P2P and the /24 mask

R1#sh ip ospf interface lo1
Loopback1 is up, line protocol is up
  Internet Address 1.1.1.1/24, Area 0
  Process ID 1234, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 1
  Transmit Delay is 1 sec, State POINT_TO_POINT
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 0
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
R1#

If we look at the routing table from the ADJ router –
We now see it advertised as a /24 prefix, instead of the previous /32

R2#sh ip route 1.1.1.1
Routing entry for 1.1.1.0/24
  Known via "ospf 1234", distance 110, metric 2, type intra area
  Last update from 192.168.12.1 on FastEthernet0/0, 00:01:44 ago
  Routing Descriptor Blocks:
  * 192.168.12.1, from 1.1.1.1, 00:01:44 ago, via FastEthernet0/0

      Route metric is 2, traffic share count is 1

OSPF Network Type Point-to-Multipoint / Non-Broadcast, OSPF Per neighbor costs.

Lessons Learned:

Point-to-Multipoint Non-Broadcast
Same as point-to-multipoint, but sends hellos as unicast
--manually defined address with neighbor command
--Allows for per –VC OSPF cost over NBMA
No DR/ BDR Election
Special Next-hop processing

--------------------------------------------------

Point-to-multipoint non broadcast –
We would want to use this where we have a partial mesh of layer 2 circuits But the underlying network is made up of different bandwidth values on the circuits.
Normally in a frame relay or ATM design.

For example: A frame relay cloud – hub and spoke and the VC’s are all different bandwidth speeds.
So the case where the main interface does not reflect the cost of the underlying circuits – that’s what Point-to-multipoint non broadcast is for.

Now – We can change the cost of the links – The cost value is part of the ospf calculation.
We can change the cost with an ospf neighbor statement under the interface and under the process we change  the cost with a neighbor statement.

Example:
R7#sh ip int brief | ex una
Interface                  IP-Address      OK? Method Status                Protocol
Serial0/0                  10.1.57.7       YES NVRAM  up                    up     
Serial0/1                  10.1.67.7       YES NVRAM  up                    up

The interface is currently point to point with a cost of 64

Serial0/0 is up, line protocol is up
  Internet Address 10.1.57.7/24, Area 10.1.0.0
  Process ID 1234, Router ID 10.1.67.7, 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
    oob-resync timeout 40
    Hello due in 00:00:08
  Supports Link-local Signaling (LLS)

R5(config)#neighbor 10.1.57.7 cost 128


R7#sh ip ospf interface serial 0/0
Serial0/0 is up, line protocol is up
  Internet Address 10.1.57.7/24, Area 10.1.0.0
  Process ID 1234, Router ID 10.1.67.7, Network Type POINT_TO_MULTIPOINT, Cost: 64
  Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT
  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
    oob-resync timeout 120
    Hello due in 00:00:26
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 10.54.4.5, cost is 128
  Suppress hello for 0 neighbor(s)
R7#

The cost of the link is 64 but the cost between the neighbors over that link the cost is 128 – basically the process level.

We could also use this network type on an Ethernet segment where the cost / links are different speeds going to the switch. Example 3 routers connected via a switch and all links are FA except one that is a 10MB Ethernet link.


If the links on the FA interface routers we’re network type broadcast, they wouldn’t be able to tell the difference between the 100 MB and the 10MBps. We can change it to point-to-multipoint and then change the cost value on a per neighbor basis. 

OSPF Network Point – to – Point

Lessons Learned:

# ip ospf network point-to-point
Default on point-to-point medias
--HDLC / PPP
Sends hellos as multicast
--224.0.0.5
No DR/ BDR Election
Supports only two neighbors on the link

------------------------------------------------------------------

A point to point network will no longer generate an LSA type 2 because there is no DR or BDR on the segments.
You can also use point to point on other media (Ethernet) as long as there’s only two neighbors on the segment.

Network Types and Elections
DR / BDR Election
No Election
Broadcast and
P2P
Non-Broadcast
P2-Mulitpoint

P2-p- non broadcast

Output from # sh ip ospf interface ser0/0

R6#sh ip ospf interface serial 0/0
Serial0/0 is up, line protocol is up
  Internet Address 10.1.56.6/24, Area 10.1.0.0
  Process ID 1234, Router ID 10.1.67.6, Network Type POINT_TO_POINT, Cost: 64 – Shows process, Network type
  Transmit Delay is 1 sec, State POINT_TO_POINT
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 –Note: No need for the wait time on this link, we’re not running the DR and BDR elections.
    oob-resync timeout 40
    Hello due in 00:00:07
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 10.54.4.5
  Suppress hello for 0 neighbor(s)

What is not supported for ADJ to occur via network types:

DR / BDR Election
No Election
NOT Supported
Broadcast and
P2P
P2P to Broadcast
Non-Broadcast
P2-Mulitpoint
P2MP to Broadcast

P2-p- non broadcast
P2MP to Non-Broadcast








The routers will form a neighbor relationship if the network types are mismatched but will never form and ADJ. 

Thursday, April 24, 2014

OSPF Network Type Broadcast, DR/ BDR Election. OSPF over NBMA. Network Type Non-Broadcast and Point-to-Multipoint

OSPF Network Type Broadcast, DR/ BDR Election. OSPF over NBMA.
Network Type Non-Broadcast and Point-to-Multipoint

Lessons Learned:

OSPF Behavior changes based on the media
EX: Ethernet vs Frame Relay vs PPP

Different media uses different “network types” to control
-how updates are sent (unicast or Multicast)
-Who forms adjacency
-How next-hop is calculated

===============================

OSPF Network Types:

-Broadcast –
-Non-Broadcast
-Point-to-point
-Point-to Multipoint
-Point-to-Multipoint Non Broadcast
-Loopback

====================================================

OSPF Network Type broadcast:

#ip ospf network broadcast
-Default on mulit-access broadcast medias
   - Ethernet, Token Ring, & FDDI
-Sends hellos and updates as multicast
-224.0.0.5 (ALL SPF Routers)  
-224.0.0.6 (ALL DRouters)
Note: Both of these multicast addresses are going to use the OSPF transport protocol 89

Performs Designated Routerd (DR) and Backup Designated Router (BDR) Elections.
DR and BDR – are used for two things.
1 – It will cut down on the number of adjacencies and LSA flooding
2 – Is for the extra recursive step in the database for building the graph of the network in side and individual area.

====================================================

DR / BDR Overview
--------------------------

- Designated Router (device in charge of receiving the LSA’a from the neighbors on the segment and then forwarding them back out to the others) (uses Multicast 224.0.0.6 for flooding). Once the DR receives the LSU in, it generates its own updates that is going back to 224.0.0.5. This is for ALL the other routers on the segment.
Uses on broadcast links to
--Minimize adjacencies
--Minimize LSA replication

-Backup Designated Router (BDR doesn’t do anything with LSA updates from neighbors, it listens for updates coming in and  Hellos coming from the DR. The BDR is used for redundancy of the DR, if it now longer hears from the DR. It will promote itself to the DR State, then there’s a new for the BDR.
--Used for redundancy of DR

Note: The DR and the BDR are listening for 224.0.0.6. All other routers are listening for 224.0.0.5.

DROther – Devices that are neither the DR and the BDR. These devices will not establish ADJ. Will Stop ant the two-way state between each other.
-All other routers link
-Forms full adjacency with DR and BDR
--Stops at 2-way ADJ with each other

DR / BDR  chosen through election process
-Election bases on two fields in the Hello packet.

Fields for elections.
Routers priority,
from 0 – 255
Higher is better
0 = never.  ( Set ip ospf priority to 0 at the link level)

If there is a tie – then use…..
Router-ID
Highest loopback / Interface IP
Can be statically set (best practice to statically set)
Higher is better.

No preemption unlike IS-IS DIS.

Note: Technically the higher Priory and higher router-id will decide the election. A device can elect itself the DR without other devices being on the network. This often depends on the boot up order.

Examples:
If I clear the ip ospf process – and debug the adjacencies – you can see the actual election process in the output.

R3#clear ip osp process
Reset ALL OSPF processes? [no]: yes


Output:

*Mar  1 00:06:58.487: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar  1 00:06:58.487: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:06:58.487: OSPF: Elect BDR 3.3.3.3
*Mar  1 00:06:58.487: OSPF: Elect DR 3.3.3.3
*Mar  1 00:06:58.487: OSPF: Elect BDR 0.0.0.0
*Mar  1 00:06:58.491: OSPF: Elect DR 3.3.3.3
*Mar  1 00:06:58.491:        DR: 3.3.3.3 (Id)   BDR: none
*Mar  1 00:06:58.495: OSPF: Remember old DR 192.168.23.2 (id)
*Mar  1 00:06:58.495: OSPF: 3.3.3.3 address 192.168.23.3 on FastEthernet0/0 is dead, state DOWN

*Mar  1 00:06:58.499: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar  1 00:06:58.499: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:06:58.499: OSPF: Elect BDR 0.0.0.0
*Mar  1 00:06:58.499: OSPF: Elect DR 0.0.0.0
*Mar  1 00:06:58.499: OSPF: Elect BDR 0.0.0.0
*Mar  1 00:06:58.499: OSPF: Elect DR 0.0.0.0     --- we do not know who the DR / BDR is.

*Mar  1 00:06:58.499:        DR: none    BDR: none
*Mar  1 00:06:58.499: OSPF: Flush network LSA immediately
*Mar  1 00:06:58.499: OSPF: Remember old DR 3.3.3.3 (id)Previously it was Router 3
*Mar  1 00:06:58.499: OSPF: Interface Serial0/0 going Down
*Mar  1 00:06:58.499: OSPF: 1.1.1.1 address 192.168.13.1 on Serial0/0 is dead, state DOWN
*Mar  1 00:06:58.499: %OSPF-5-ADJCHG: Process 1234, Nbr 1.1.1.1 on Serial0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Mar  1 00:06:58.499: OSPF: 3.3.3.3 address 192.168.13.3 on Serial0/0 is dead, state DOWN
*Mar  1 00:06:58.499: OSPF: Interface FastEthernet0/0 going Up
*Mar  1 00:06:58.503: OSPF: Interface Serial0/0 going Up
*Mar  1 00:06:58.519: OSPF: 2 Way Communication to 1.1.1.1 on Serial0/0, state 2WAY
*Mar  1 00:06:58.519: OSPF: Send DBD to 1.1.1.1 on Serial0/0 seq 0xDFB opt 0x52 flag 0x7 len 32
*Mar  1 00:06:58.527: OSPF: 2 Way Communication to 10.45.4.4 on FastEthernet0/0, state 2WAY
*Mar  1 00:06:58.527: OSPF: Backup seen Event before WAIT timer on FastEthernet0/0  -- Now we will listen with the weight timer, to find out if anyone has already been elected. All new routers on the segment will go through this timer to make sure it doesn’t actually elect itself vs someone else. If the WAIT timer expiries and no one is elected – the router will promote itself to the DR

Note: There is  potential issue with this is -  The order that the process loads will be related to who will be elected the DR or BDR. EX: if one of the routers process loads faster than it could take over as DR. This would be true even if a device had a higher priority configured.

*Mar  1 00:06:58.531: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:06:58.531: OSPF: Elect BDR 10.45.4.4
*Mar  1 00:06:58.535: OSPF: Elect DR 10.45.4.4
*Mar  1 00:06:58.535:        DR: 10.45.4.4 (Id)   BDR: 10.45.4.4 (Id)
*Mar  1 00:06:58.539: OSPF: Send DBD to 10.45.4.4 on FastEthernet0/0 seq 0x12 opt 0x52 flag 0x7 len 32
*Mar  1 00:06:58.543: OSPF: 2 Way Communication to 192.168.23.2 on FastEthernet0/0, state 2WAY
*Mar  1 00:06:58.543: OSPF: Neighbor change Event on interface FastEthernet0/0

Another useful command is:
# Sh ip ospf interface (if num )

R3#sh ip ospf interface fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.23.3/24, Area 0
  Process ID 1234, Router ID 3.3.3.3, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DROTHER, Priority 1
  Designated Router (ID) 192.168.23.2, Interface address 192.168.23.2
  Backup Designated router (ID) 10.45.4.4, Interface address 192.168.23.4
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:01
  Supports Link-local Signaling (LLS)
  Index 2/2, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 5
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor 10.45.4.4  (Backup Designated Router)
    Adjacent with neighbor 192.168.23.2  (Designated Router)
  Suppress hello for 0 neighbor(s)
R3#

To truly eliminate this from happening you can set the ip ospf priority to zero.

Note: for Ethernet segments it doesn’t really matter who wins the Election. In ANY case where there is  only a partial mesh of Layer2 connectivity. You need to guarantee the device that has the full Layer2 connectivity – IS elected the DR.

Example: Is a hub and spoke Frame technology – you would want to make sure the HUB router is the DR.
If you have multiple Hubs one can be the DR and the other the BDR. As long as the Spoke are never elected the DR or BDR the topology will work.


OSPF Network Non-Broadcast.
Main difference between Broadcast and Non-broadcast. Broadcast is sending it’s update as multicast 224.0.0.5 and 224.0.0.6. Non-broadcast updates are sent as unicast.

#ip ospf network non-broadcast
Default on multipoint and NBMA medias.
--Frame Relay & ATM – tyoe non-broadcast.

Sends hellos as unicast
-manually defines addresses with neighbor command
-performs DR and BDR elections

This means that we need to make sure the hubs are the DR’s and we need to configure under the process the manually defined address with the “neighbor” command.

To specify the DR election we basically just tell the spokes not to become the DR or BDR. By setting the priority to 0.
Again then who is elected the DR is who’s process loads first.

Ex:
R3(config)#interface serial 0/0
R3(config-if)#ip ospf priority 0 ?

We would then need to manually configure the neighbors under the process
Note: the Neighbor commands are only required on the DR and BDR. Once the spokes hello’s come in, they will respond to originated them.

R3(config)#router ospf 1234
R3(config-router)#neighbor 192.168.13.1

Note: The default behavior of the network type broadcast or non-broadcast – the DR is not updating the next-hop value for any link state updates coming from the DROthers.


OSPF Network Type Point-to-Multipoint
#ip ospf network point-to-multipoint
-treats network as a an underlying collection of point-to-point links
-Sends hellos as multicast 224.0.0.5
Special next hop processing
Usually the best design option for partial mesh NBMA Networks

Point-to-Multipoint  - You always chose you closest layer 2 neighbor on the circuit for any routing information that is received. The Next Hop values WILL BE CHANGED.

If R1 is the Hub and it receives and Update from Spoke 1 and passed the updated to Spoke 2. The next hop value will change to R1 and not to R2.


Note: in Point-to-Multipoint  Hosts will advertise themselves as end hosts in the topology – as all /32’s