Social Icons

Friday, August 9, 2013

CCNP ROUTE: 12.OSPF Metric tuning

Engineers have a couple of commands available that allow them to tune the values of the OSPF interface cost, thereby influencing the choice of best OSPF route.

Adding a FastEthernet link (192.168.0.24/30) directly between R1 and R2 and including that link into OSPF will create a redundancy path:

Having equal cost paths (FastEthernet) to R2 and networks in area 1 and the default maximum path value of 4, R1 installs 2 routes in the routing table:
R1#show ip route
...
     192.168.168.0/30 is subnetted, 1 subnets
O IA    192.168.168.0 [110/20] via 192.168.0.26, 00:00:17, FastEthernet0/1
                      [110/20] via 192.168.0.2, 00:00:17, FastEthernet0/0
     192.168.169.0/32 is subnetted, 1 subnets
O IA    192.168.169.170 [110/21] via 192.168.0.26, 00:00:17, FastEthernet0/1
                        [110/21] via 192.168.0.2, 00:00:17, FastEthernet0/0

Metric tuning - method 1: Changing the Reference bandwidth (default = 100)

OSPF calculates the default OSPF cost for an interface based on the following formula: Reference-brandwidth[Mbps] / interface-bandwidth[Mbps]

Note: OSPF always rounds down when the calculation results in a fraction.
Note: With a default of 100 Mbps, the cost of FastEthernet interfaces calculates to cost 1.
 However, the minimum OSPF cost is 1, so Gigabit Ethernet and 10 Gigabit interfaces also then default to OSPF cost 1.
 By setting the OSPF reference bandwidth so that there is some difference in cost between the higher speed links, OSPF can then choose routes that use those higher speed interfaces.
Note: Although Cisco recommends that all routers use the same reference bandwidth, the setting is local to each router.

R1#show ip protocols 
Routing Protocol is "ospf 1"
 ...
 Reference bandwidth unit is 100 mbps

Having both FastEthernet0/0 and FastEthernet0/1 with a bandwitdh of 10 Mbps and the default reference bandwidth of 100, the cost is 10 on each:

R1#show ip ospf interface fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.0.1/29, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10

R1#show ip ospf interface fastEthernet 0/1
FastEthernet0/1 is up, line protocol is up
  Internet Address 192.168.0.25/30, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10

After setting the reference bandwidth to 1000, both costs change to 100:

R1(config)#router ospf 1
R1(config-router)#auto-cost reference-bandwidth ?
  <1-4294967>  The reference bandwidth in terms of Mbits per second
R1(config-router)#auto-cost reference-bandwidth 1000
% OSPF: Reference bandwidth is changed.
        Please ensure reference bandwidth is consistent across all routers.

R1#show ip ospf interface fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.0.1/29, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 100

R1#show ip ospf interface fastEthernet 0/1
FastEthernet0/1 is up, line protocol is up
  Internet Address 192.168.0.25/30, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 100

After changing the reference bandwidth on both R1 and R2, the route metric changes accordingly:
R1#show ip route
...
     192.168.168.0/30 is subnetted, 1 subnets
O IA    192.168.168.0 [110/200] via 192.168.0.26, 00:04:57, FastEthernet0/1
                      [110/200] via 192.168.0.2, 00:04:57, FastEthernet0/0
     192.168.169.0/32 is subnetted, 1 subnets
O IA    192.168.169.170 [110/201] via 192.168.0.26, 00:04:57, FastEthernet0/1
                        [110/201] via 192.168.0.2, 00:04:57, FastEthernet0/0

Metric tuning - method 2: Setting bandwidth

On Ethernet interfaces,if not configured with the bandwidth command, the interface bandwidth matches the actual speed.
For example, on an interface that supports autonegotiation for 10/100, the bandwidth is either 100,000 (kbps, or 100 Mbps) or 10,000 (Kbps, or 10 Mbps) depending on whether the link currently runs at 100 or 10 Mbps.

On serial interfaces (or their subinterfaces) the bandwidth defaults to 1544 Kbps.

Consider that R1's FastEthernet0/1 should be preferred when routing traffic to area 1.
Having default bandwidths (10 Mbps) and reference bandwidths (100 Mbps) on both FastEthernet0/0 and FastEthernet0/1, R1 installs both routes in the routing table:

R1#show ip ospf interface fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.0.1/29, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10

R1#show ip ospf interface fastEthernet 0/1
FastEthernet0/1 is up, line protocol is up
  Internet Address 192.168.0.25/30, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10

R1#show ip route
...
     192.168.168.0/30 is subnetted, 1 subnets
O IA    192.168.168.0 [110/20] via 192.168.0.26, 00:01:18, FastEthernet0/1
                      [110/20] via 192.168.0.2, 00:01:18, FastEthernet0/0
     192.168.169.0/32 is subnetted, 1 subnets
O IA    192.168.169.170 [110/21] via 192.168.0.26, 00:01:18, FastEthernet0/1
                        [110/21] via 192.168.0.2, 00:01:18, FastEthernet0/0

We have to influence the cost on FastEthernet0/1, so it will be chosen as outgoing interface for traffic destined for area 1, using the same cost formula:
Reference-brandwidth[Mbps] / interface-bandwidth[Mbps]

R1(config)#interface fastEthernet 0/1
R1(config-if)#bandwidth ?
  <1-10000000>  Bandwidth in kilobits
R1(config-if)#bandwidth 100000

So now, FastEthernet0/0 should remain at the cost of 10 and FastEthernet0/1 should change to a cost of 1:
R1#show ip ospf interface fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.0.1/29, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10

R1#show ip ospf interface fastEthernet 0/1
FastEthernet0/1 is up, line protocol is up
  Internet Address 192.168.0.25/30, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1

R1#show ip route
...
     192.168.168.0/30 is subnetted, 1 subnets
O IA    192.168.168.0 [110/11] via 192.168.0.26, 00:11:22, FastEthernet0/1
     192.168.169.0/32 is subnetted, 1 subnets
O IA    192.168.169.170 [110/12] via 192.168.0.26, 00:11:22, FastEthernet0/1

Metric tuning - method 3: Setting cost

We have to influence the cost on FastEthernet0/1, so it will be chosen as outgoing interface for traffic destined for area 1.

R1#show ip ospf interface fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.0.1/29, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10

R1#show ip ospf interface fastEthernet 0/1
FastEthernet0/1 is up, line protocol is up
  Internet Address 192.168.0.25/30, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10

R1#show ip route
...
     192.168.168.0/30 is subnetted, 1 subnets
O IA    192.168.168.0 [110/20] via 192.168.0.26, 00:01:18, FastEthernet0/1
                      [110/20] via 192.168.0.2, 00:01:18, FastEthernet0/0
     192.168.169.0/32 is subnetted, 1 subnets
O IA    192.168.169.170 [110/21] via 192.168.0.26, 00:01:18, FastEthernet0/1
                        [110/21] via 192.168.0.2, 00:01:18, FastEthernet0/0

R1(config)#interface fastEthernet 0/1
R1(config-if)#ip ospf cost 2
R1#show ip ospf interface fastEthernet 0/1
FastEthernet0/1 is up, line protocol is up
  Internet Address 192.168.0.25/30, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 2

R1#show ip route 
...
     192.168.168.0/30 is subnetted, 1 subnets
O IA    192.168.168.0 [110/12] via 192.168.0.26, 00:00:44, FastEthernet0/1
     192.168.169.0/32 is subnetted, 1 subnets
O IA    192.168.169.170 [110/13] via 192.168.0.26, 00:00:44, FastEthernet0/1

CCNP ROUTE: 11.Choosing the best OSPF routes - Inter-Area (between areas)

For routers in one area to calculate the cost of an interarea route, the process is similar:
Step 1. Calculate the intra-area cost from that router to the ABR listed in the type 3 LSA.
Step 2. Add the cost value listed in the Type 3 LSA. (This cost represents the cost from the ABR to the destination subnet.)

Consider R3's route to R12's Loopback 33 (192.168.33.33/24). R9 is the ABR between areas 0 and 3, so he advertised the network to R3:
R3#show ip ospf database                            
...
                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.1.1        9.9.9.9         1107        0x80000001 0x00E22A
10.0.1.2        9.9.9.9         1078        0x80000001 0x005B70
10.0.1.3        9.9.9.9         1107        0x80000001 0x005179
10.0.10.10      9.9.9.9         1081        0x80000001 0x00B108
10.0.11.11      9.9.9.9         1109        0x80000001 0x009C1B
192.168.3.0     9.9.9.9         1158        0x80000002 0x00F7AC
192.168.33.33   9.9.9.9         1129        0x80000001 0x007FE2
...

The intra-area cost from R3 to R9 is the sum of outgoing interfaces costs along the path:

R3#show ip ospf interface fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.0.3/29, Area 0
  Process ID 1, Router ID 3.3.3.3, Network Type BROADCAST, Cost: 10
...

R1#show ip ospf interface serial 0/0
Serial0/0 is up, line protocol is up
  Internet Address 192.168.0.21/30, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 64

So, up until now, the cost (from R3 to R9) is 10+64=74.

Now, we have to add the cost value listed in the Type 3 LSA (R9 advertised in the Type 3 LSA his cost to reach 192.168.33.33):
R3#show ip ospf database summary 192.168.33.33

            OSPF Router with ID (3.3.3.3) (Process ID 1)

                Summary Net Link States (Area 0)

  Routing Bit Set on this LSA
  LS age: 1344
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 192.168.33.33 (summary Network Number)
  Advertising Router: 9.9.9.9
  LS Seq Number: 80000001
  Checksum: 0x7FE2
  Length: 28
  Network Mask: /32
        TOS: 0  Metric: 11

So, the total cost from R3 to R12's Loopback33 is 74+11=85, as can be verified in the routing table of R3:
R3#show ip route
...
     192.168.33.0/32 is subnetted, 1 subnets
O IA    192.168.33.33 [110/85] via 192.168.0.1, 00:25:56, FastEthernet0/0

Note: "O IA" means OSPF Inter-Area route. Inter-Area routes are routes for which the subnet is known from a Type 3 summary LSA.

Rules concerning Intra-area and Interarea Routes on ABRs:
1. When choosing the best route, an intra-area route is always better than a competing interarea route, regardless of metric.
2. If an ABR learns a Type 3 LSA inside a nonbackbone area, the ABR ignores that LSA when calculating its own routes.

CCNP ROUTE: 10.Choosing the best OSPF routes - Intra-Area (internal)

When a router analyzes the LSDB to calculate the best route to each subnet, it does the following:
Step 1. Finds all subnets inside the area, based on the stub interfaces listed in the Type 1 LSAs and based on any Type 2 network LSAs
Step 2. Runs SPF to find all possible paths through the area’s topology, from itself to each subnet
Step 3. Calculates the OSPF interface costs for all outgoing interfaces in each route, picking the lowest total cost route for each subnet as the best route.

The router does the simple math of adding the costs of the outgoing interfaces in each route.
If the metrics tie, with a default setting of maximum-paths 4, adds up to 4 routes to its routing table, because OSPF supports equal-cost load balancing.

Default maximum path setting:
R5#show ip protocols | s ospf
Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 5.5.5.5
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
...

The cost from R5 to R3's Loopback13 is calculated adding the costs of the outgoing interfaces along the path to the destination network

On R5's outgoing interface to R1:
R5#show ip ospf interface serial 0/0
Serial0/0 is up, line protocol is up
  Internet Address 192.168.0.18/30, Area 0
  Process ID 1, Router ID 5.5.5.5, Network Type POINT_TO_POINT, Cost: 64

On R1's outgoing interface to R3:
R1#show ip ospf interface fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.0.1/29, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10

On R3's Loopback 13 interface:
R3#show ip ospf interface loopback 13
Loopback13 is up, line protocol is up
  Internet Address 192.168.13.13/24, Area 0
  Process ID 1, Router ID 3.3.3.3, Network Type LOOPBACK, Cost: 1

So the total cost of R5's route to 192.168.13.13/24 should be 64+10+1=75:
R5#show ip route
...
     192.168.13.0/32 is subnetted, 1 subnets
O       192.168.13.13 [110/75] via 192.168.0.17, 00:04:52, Serial0/0

Adding a FastEthernet link (192.168.0.24/30) directly between R1 and R2 and including that link into OSPF will create a redundancy path.
Having equal cost paths (FastEthernet) to R2 and networks in area 1 and the default maximum path value of 4, R1 installs 2 routes in the routing table:

R1#show ip route
...
     192.168.168.0/30 is subnetted, 1 subnets
O IA    192.168.168.0 [110/20] via 192.168.0.26, 00:00:17, FastEthernet0/1
                      [110/20] via 192.168.0.2, 00:00:17, FastEthernet0/0
     192.168.169.0/32 is subnetted, 1 subnets
O IA    192.168.169.170 [110/21] via 192.168.0.26, 00:00:17, FastEthernet0/1
                        [110/21] via 192.168.0.2, 00:00:17, FastEthernet0/0

CCNP ROUTE: 9.OSPF packets and database exchange process - Exchange with a DR

The big difference is the overriding choice of with whom each router chooses to perform database exchange.
Non-DR routers do not exchange their databases directly with all neighbors on a subnet.
Instead, they exchange their database with the DR. Then, the DR exchanges any new/changed LSAs with the rest of the OSPF routers in the subnet.

The non-DR performs database exchange with the same messages, but sends these messages to the 224.0.0.6 All-DR-routers (DR and BDR) multicast address.
The DR performs database exchange with the same messages but sends the messages to the 224.0.0.5 all-SPF-routers multicast address.

Because the process does not make DROther routers perform database exchange with each other, the routers do not reach the FULL neighbor state, remaining in 2-Way state.
DROthers form FULL neighborships only with the DR and BDR on a LAN segment.

Consider the LAN connecting R1, R2 and R3 routers. Shutting down R3 and reloading R1 and R2, the DR/BDR election process chooses R2 as DR and R1 as BDR:
When powering up R3, it joins the network as DROther, because the DR/BDR are already chosen, even if R3 now has the highest RID.

R2#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/BDR        00:00:36    192.168.0.1     FastEthernet0/0
3.3.3.3           1   FULL/DROTHER    00:00:32    192.168.0.3     FastEthernet0/0
13.13.13.13       1   FULL/DR         00:00:39    192.168.168.2   FastEthernet0/1

R3#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/BDR        00:00:30    192.168.0.1     FastEthernet0/0
2.2.2.2           1   FULL/DR         00:00:39    192.168.0.2     FastEthernet0/0

R3 exchange messages with both DR and BDR using 224.0.0.6 and receives replies from both R1 and R2 using the destination address 224.0.0.5:

R3#debug ip packet
*Mar  1 00:20:42.495: IP: s=192.168.0.3 (local), d=224.0.0.6 (FastEthernet0/0), len 96, sending broad/multicast
*Mar  1 00:20:42.527: IP: s=192.168.0.2 (FastEthernet0/0), d=224.0.0.5, len 96, rcvd 0

*Mar  1 00:20:44.495: IP: s=192.168.0.3 (local), d=224.0.0.6 (FastEthernet0/0), len 84, sending broad/multicast
*Mar  1 00:20:44.595: IP: s=192.168.0.1 (FastEthernet0/0), d=224.0.0.5, len 104, rcvd 0

Note: Although OSPF does not send routing updates on a periodic interval, as do distance vector protocols, OSPF does reflood each LSA every 30 minutes.

CCNP ROUTE: 8.OSPF packets and database exchange process - Exchange without a DR

Every router in an area, when OSPF stabilizes after topology changes occur, should have an identical LSDB for that area.

The OSPF packets are: HELLO, DBD, LSR, LSU, LSAck

HELLO: discover neighbors, check the conditions to become neighbors, monitor neighbor, brings neighborship to the 2-WAY state
DBD: exchange brief versions of each LSA, typically on initial topology exchange, so that a router knows a list of that neighbor’s known LSAs
LSR: lists the LSIDs of LSAs the sender of the LSR would like the receiver of the LSR to supply during database exchange
LSU: contains fully detailed LSAs, typically sent in response to an LSR message
LSAck: confirm receipt of an LSU message

The OSPF neighbor states are: Down, Attempt, Init, 2-WAY, Exstart, Exchange, Loading, Full

The most common case for which routers do not elect a DR occur on point-to-point topologies, such as true point-to-point serial links and point-to-point subinterfaces.

Routers discover each other by sending multicast Hellos (224.0.0.5 all-OSPF-routers) and then check each other’s parameters to make sure all items match.

OSPF neighborship criteria:
-Interfaces’ primary IP addresses must be in same subnet.
-Must be in same area.
-Hello/Dead timers must match.
-Unique RIDs.
-MTU must match.
-Must pass neighbor authentication (if configured).

After a router has both received a Hello and verified that all the required parameters agree, the router lists the other router’s RID in the Hello as being seen, as shown in the bottom two Hello messages in the figure.
When a router receives a Hello that lists its own RID as having been seen by the other router, the router can transition to 2-Way state.
When a router has reached the 2-Way state with a neighbor, the router then decides whether it should exchange its LSDB entries.
When no DR exists, the answer is always “yes.”

Consider the R1-R5 neighborship (point-to-point link, no DR):

R1#show ip ospf neighbor serial 0/2

Neighbor ID     Pri   State           Dead Time   Address         Interface
5.5.5.5           0   FULL/  -        00:00:39    192.168.0.18    Serial0/2

Enabling OSPF event debugging on R5 and shut/no shut R1's Serial0/0 connecting to R5's Serial0/2:

*Mar  1 01:23:06.495: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Serial0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
R5#debug ip ospf events 
OSPF events debugging is on
R5#
*Mar  1 01:23:26.467: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
*Mar  1 01:23:26.483: OSPF: Interface Serial0/0 going Up
*Mar  1 01:23:26.487: OSPF: Send hello to 224.0.0.5 area 0 on Serial0/0 from 192.168.0.18
*Mar  1 01:23:26.499: OSPF: Rcv hello from 1.1.1.1 area 0 from Serial0/0 192.168.0.17
*Mar  1 01:23:26.503: OSPF: 2 Way Communication to 1.1.1.1 on Serial0/0, state 2WAY
*Mar  1 01:23:26.503: OSPF: Send DBD to 1.1.1.1 on Serial0/0 seq 0x175 opt 0x52 flag 0x7 len 32
*Mar  1 01:23:26.507: OSPF: Send immediate hello to nbr 1.1.1.1, src address 192.168.0.17, on Serial0/0
*Mar  1 01:23:26.507: OSPF: Send hello to 224.0.0.5 area 0 on Serial0/0 from 192.168.0.18
*Mar  1 01:23:26.511: OSPF: End of hello processing
*Mar  1 01:23:26.527: OSPF: Rcv DBD from 1.1.1.1 on Serial0/0 seq 0x7F4 opt 0x52 flag 0x7 len 32  mtu 1500 state EXSTART
*Mar  1 01:23:26.527: OSPF: First DBD and we are not SLAVE
*Mar  1 01:23:26.531: OSPF: Rcv DBD from 1.1.1.1 on Serial0/0 seq 0x175 opt 0x52 flag 0x2 len 352  mtu 1500 state EXSTART
*Mar  1 01:23:26.531: OSPF: NBR Negotiation Done. We are the MASTER
*Mar  1 01:23:26.535: OSPF: Send DBD to 1.1.1.1 on Serial0/0 seq 0x176 opt 0x52 flag 0x3 len 352
*Mar  1 01:23:26.615: OSPF: Rcv DBD from 1.1.1.1 on Serial0/0 seq 0x176 opt 0x52 flag 0x0 len 32  mtu 1500 state EXCHANGE
*Mar  1 01:23:26.619: OSPF: Send DBD to 1.1.1.1 on Serial0/0 seq 0x177 opt 0x52 flag 0x1 len 32
*Mar  1 01:23:26.619: OSPF: Send LS REQ to 1.1.1.1 length 12 LSA count 1
*Mar  1 01:23:26.623: OSPF: Rcv LS REQ from 1.1.1.1 on Serial0/0 length 36 LSA count 1
*Mar  1 01:23:26.623: OSPF: Send UPD to 192.168.0.17 on Serial0/0 length 28 LSA count 1
*Mar  1 01:23:26.623: OSPF: Rcv DBD from 1.1.1.1 on Serial0/0 seq 0x177 opt 0x52 flag 0x0 len 32  mtu 1500 state EXCHANGE
*Mar  1 01:23:26.623: OSPF: Exchange Done with 1.1.1.1 on Serial0/0
*Mar  1 01:23:26.627: OSPF: Rcv LS UPD from 1.1.1.1 on Serial0/0 length 136 LSA count 1
*Mar  1 01:23:26.627: OSPF: Synchronized with 1.1.1.1 on Serial0/0, state FULL
*Mar  1 01:23:26.627: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Serial0/0 from LOADING to FULL, Loading Done

As seen above:
-hellos are sent to multicast address 224.0.0.5
-the process transitions from DOWN->2WAY->EXSTART->EXCHANGE->LOADING->FULL
-MASTER/SLAVE negotiated during EXSTART state
-OSPF packets are being exchanged: Hello, DBD, LSR (LS REQ), LSU (UPD)
-the MASTER sends the first LSR
-the acknowledgement of the LSU packet can be made either by an ACK packet or by sending the same LSA that was received back to the other router in an LSU message (implicit
acknowledgment)
-when all LSAs have been sent, received, and acknowledged, transition thneighborship to the FULL state (fully adjacent).

Note: During the Exstart state the routers are currently negotiating the DBD sequence numbers and master/slave logic used for DBD packets.
 After electing a master, the routers transition to the Exchange state. The master sends the LSR first and the slave responds with its known LSAs.

Note: LSAck packets can be seen with "debug ip ospf packet". They are Type 5 packets (Hello-1, DBD-2, LSR-3, LSU-4, LSAck-5):
R5#debug ip ospf packet 
OSPF packet debugging is on
*Mar  1 01:49:36.475: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
R5#
*Mar  1 01:49:36.531: OSPF: rcv. v:2 t:1 l:48 rid:1.1.1.1
      aid:0.0.0.0 chk:DF92 aut:0 auk: from Serial0/0
*Mar  1 01:49:36.587: OSPF: rcv. v:2 t:2 l:32 rid:1.1.1.1
      aid:0.0.0.0 chk:94A1 aut:0 auk: from Serial0/0
*Mar  1 01:49:36.591: OSPF: rcv. v:2 t:2 l:352 rid:1.1.1.1
      aid:0.0.0.0 chk:D702 aut:0 auk: from Serial0/0
*Mar  1 01:49:36.599: OSPF: rcv. v:2 t:2 l:32 rid:1.1.1.1
      aid:0.0.0.0 chk:7E62 aut:0 auk: from Serial0/0
*Mar  1 01:49:36.599: OSPF: rcv. v:2 t:3 l:36 rid:1.1.1.1
      aid:0.0.0.0 chk:E7C1 aut:0 auk: from Serial0/0
*Mar  1 01:49:36.603: OSPF: rcv. v:2 t:4 l:136 rid:1.1.1.1
      aid:0.0.0.0 chk:2343 aut:0 auk: from Serial0/0
*Mar  1 01:49:37.095: OSPF: rcv. v:2 t:4 l:148 rid:1.1.1.1
      aid:0.0.0.0 chk:6AF4 aut:0 auk: from Serial0/0
*Mar  1 01:49:39.115: OSPF: rcv. v:2 t:5 l:64 rid:1.1.1.1
      aid:0.0.0.0 chk:21A aut:0 auk: from Serial0/0

CCNP ROUTE: 7.Influence DR/BRD election without changing RIDs, using a single command (make R1 - BDR, R2 - DR, R3 - permanent DROther)

R3(config)#int fastEthernet 0/0
R3(config-if)#ip ospf priority 0   (this command sets Fa0/0 priority to 0, from the default of 1, making R3 permanently DROther)

Now, having equal priorities, R1 and R2 remain in the DR/BDR process and R2 (the former BDR) takes the role of DR and now R1 is chosen as BDR.
R3#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/BDR        00:00:36    192.168.0.1     FastEthernet0/0
2.2.2.2           1   FULL/DR         00:00:37    192.168.0.2     FastEthernet0/0

Even if we set R3's priority back to 1, R3 will not become DR again, until reloading all 3 routers.
Even if we set R3 with the highest priority of all 3 routers (value of 2), R3 will not become DR again, until reloading all 3 routers.
R3(config)#interface fastEthernet 0/0
R3(config-if)#ip ospf priority 2

R2#show ip ospf neighbor                                                

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/BDR        00:00:33    192.168.0.1     FastEthernet0/0
3.3.3.3           2   FULL/DROTHER    00:00:38    192.168.0.3     FastEthernet0/0

Now, R2 is the DR. If we reload the current R2, then R1 (the current BDR) will be elected as DR, R3 (although it has a greater priority than R1) will be elected as BDR and R2 will return as DROther.
R1#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
9.9.9.9           0   FULL/  -        00:00:38    192.168.0.22    Serial0/0
5.5.5.5           0   FULL/  -        00:00:38    192.168.0.18    Serial0/2
4.4.4.4           0   FULL/  -        00:00:38    192.168.0.14    Serial0/1
2.2.2.2           1   FULL/DROTHER    00:00:38    192.168.0.2     FastEthernet0/0
3.3.3.3           2   FULL/BDR        00:00:38    192.168.0.3     FastEthernet0/0

Also, if instead initially setting R3's priority to 0, we would have reloaded the router, R2 (the former BDR) would've taken the role of DR and R1 of BDR, with a reloaded R3 as DROther.

After reloading all 3 routers, regardless of the current DR/BDR roles (and with the default priorities), the initial roles are put in back in place:
R1#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
9.9.9.9           0   FULL/  -        00:00:37    192.168.0.22    Serial0/0
5.5.5.5           0   FULL/  -        00:00:30    192.168.0.18    Serial0/2
4.4.4.4           0   FULL/  -        00:00:30    192.168.0.14    Serial0/1
2.2.2.2           1   FULL/BDR        00:00:38    192.168.0.2     FastEthernet0/0
3.3.3.3           1   FULL/DR         00:00:39    192.168.0.3     FastEthernet0/0

The rule is: After a DR and BDR are elected, no election is held until either the DR or BDR fails. If the DR fails, the BDR becomes the DR–—regardless of
whether a higher priority router has joined the subnet—and a new election is held to choose a new BDR. If the BDR fails, a new election is held for BDR,
and the DR remains unchanged. Also, note that for serial interfaces (point-to-point) the default OSPF priority is 0 and it cannot be modified:

R1(config)#interface serial 0/0   (link to R9)
R1(config-if)#ip ospf priority 3
R9#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           0   FULL/  -        00:00:39    192.168.0.21    Serial0/0

CCNP ROUTE: 6.Checking OSPF DR/BDR election on R1/R2/R3:

R1#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
9.9.9.9           0   FULL/  -        00:00:36    192.168.0.22    Serial0/0
5.5.5.5           0   FULL/  -        00:00:39    192.168.0.18    Serial0/2
4.4.4.4           0   FULL/  -        00:00:38    192.168.0.14    Serial0/1
2.2.2.2           1   FULL/BDR        00:00:36    192.168.0.2     FastEthernet0/0
3.3.3.3           1   FULL/DR         00:00:31    192.168.0.3     FastEthernet0/0

R3#show ip ospf interface 
...
  Internet Address 192.168.0.3/29, Area 0
  Process ID 1, Router ID 3.3.3.3, Network Type BROADCAST, Cost: 10
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 3.3.3.3, Interface address 192.168.0.3
  Backup Designated router (ID) 2.2.2.2, Interface address 192.168.0.2
...

CCNP ROUTE: 5.OSPF internal LSAs: LSA Type 3 - Summary LSA

-ABRs do not forward Type 1 and Type 2 LSAs from one area into another area.
-OSPF advertises interarea routes using the Type 3 summary LSA. ABRs generate a Type 3 LSA for each subnet in one area, and advertises each Type 3 LSA into the other areas.
-Type 3 summary LSAs do not contain all the detailed topology information, so in comparison to Types 1 and 2, these LSAs summarize the information–hence the name summary LSA.

Router R9 is an ABR between areas 0, 2 and 3, so it creates 3 Type 3 LSAs, one per area:
R9#show ip ospf database               

            OSPF Router with ID (9.9.9.9) (Process ID 1)
...
                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.1.1        9.9.9.9         1337        0x80000001 0x00E22A
10.0.1.2        9.9.9.9         1337        0x80000001 0x005B70
10.0.1.3        9.9.9.9         1309        0x80000001 0x005179
10.0.10.10      9.9.9.9         1339        0x80000001 0x00B108
10.0.11.11      9.9.9.9         1310        0x80000001 0x009C1B
192.168.3.0     9.9.9.9         1399        0x80000001 0x00F9AB
192.168.33.33   9.9.9.9         1359        0x80000001 0x007FE2
192.168.168.0   2.2.2.2         1400        0x80000002 0x00AC6E
192.168.169.170 2.2.2.2         1351        0x80000001 0x001557
...
                Summary Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.0.0     9.9.9.9         1389        0x80000001 0x0085E6
192.168.0.12    9.9.9.9         1389        0x80000001 0x0043E2
192.168.0.16    9.9.9.9         1390        0x80000001 0x001B07
192.168.0.20    9.9.9.9         1400        0x80000001 0x0070ED
192.168.3.0     9.9.9.9         1400        0x80000001 0x00F9AB
192.168.13.13   9.9.9.9         1350        0x80000001 0x00A7A2
192.168.33.33   9.9.9.9         1366        0x80000001 0x007FE2
192.168.100.100 9.9.9.9         1396        0x80000001 0x00198C
192.168.168.0   9.9.9.9         1356        0x80000001 0x00C2F2
192.168.169.170 9.9.9.9         1356        0x80000001 0x0029DC
...
                Summary Net Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum
0.0.0.0         9.9.9.9         1411        0x80000001 0x002AE7

Note: Link ID 0.0.0.0 refers to the default route of router R12 in area 3:
R12#show ip route
...
O*IA 0.0.0.0/0 [110/11] via 192.168.3.1, 00:28:59, FastEthernet0/0

Routers which are not ABRs will have information about networks outside their area:
R5#show ip ospf database 

            OSPF Router with ID (5.5.5.5) (Process ID 1)
...
                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.1.1        9.9.9.9         276         0x80000002 0x00E02B
10.0.1.2        9.9.9.9         276         0x80000002 0x005971
10.0.1.3        9.9.9.9         276         0x80000002 0x004F7A
10.0.10.10      9.9.9.9         279         0x80000002 0x00AF09
10.0.11.11      9.9.9.9         279         0x80000002 0x009A1C
192.168.3.0     9.9.9.9         279         0x80000002 0x00F7AC
192.168.33.33   9.9.9.9         279         0x80000002 0x007DE3
192.168.168.0   2.2.2.2         293         0x80000003 0x00AA6F
192.168.169.170 2.2.2.2         293         0x80000002 0x001358

R5#show ip ospf database summary 10.0.1.1

            OSPF Router with ID (5.5.5.5) (Process ID 1)

                Summary Net Link States (Area 0)

  Routing Bit Set on this LSA
  LS age: 573
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 10.0.1.1 (summary Network Number)
  Advertising Router: 9.9.9.9
  LS Seq Number: 80000002
  Checksum: 0xE02B
  Length: 28
  Network Mask: /32
        TOS: 0  Metric: 0

CCNP ROUTE: 4.OSPF internal LSAs: LSA Type 2 - Network LSA

-When a multiaccess data link exists — for instance, a LAN — OSPF must somehow model that LAN so that the topology represents nodes and links between only a pair of nodes.
-To do so, OSPF uses the concept of a Type 2 Network LSA.
-OSPF routers actually choose whether to use a Type 2 LSA for a multiaccess network based on whether a designated router (DR) has or has not been elected on an interface.
-The elected DR in a subnet creates the Type 2 LSA for that subnet. The DR identifies the LSA by assigning an LSID of the DR’s interface IP address in that subnet.
-The type 2 LSA also lists the DR’s RID as the router advertising the LSA.

In the R1-R2-R3 LAN, R3 is chosen as DR, R2 as BDR and R1 as DROther, based on the highest RID (interface priorities are equal: default 1):

R3#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DROTHER    00:00:35    192.168.0.1     FastEthernet0/0
2.2.2.2           1   FULL/BDR        00:00:38    192.168.0.2     FastEthernet0/0

As mentioned above, R3 (the DR) created the Type 2 LSA for that subnet and identified it by assigning the LSID of its interface IP address in that subnet (192.168.0.3).
Also, as seen below, R3 sets itself as the advertising router (RID 3.3.3.3):
R3#show ip ospf database 
...
                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.0.3     3.3.3.3         381         0x80000002 0x006E3D

This Type 2 LSA is advertised to other routers in the area having the same LSID and RID:

R1#show ip ospf database 
...
                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.0.3     3.3.3.3         602         0x80000002 0x006E3D

R2#show ip ospf database 
...
                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.0.3     3.3.3.3         585         0x80000002 0x006E3D

R9#show ip ospf database 
...
                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.0.3     3.3.3.3         623         0x80000002 0x006E3D

R1#show ip ospf database router 3.3.3.3

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 0)

  LS age: 909
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 3.3.3.3
  Advertising Router: 3.3.3.3
  LS Seq Number: 80000002
  Checksum: 0x455E
  Length: 48
  Number of Links: 2

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.13.13
     (Link Data) Network Mask: 255.255.255.255
      Number of TOS metrics: 0
       TOS 0 Metrics: 1

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 192.168.0.3
     (Link Data) Router Interface address: 192.168.0.3
      Number of TOS metrics: 0
       TOS 0 Metrics: 10

-Each router’s Type 1 router LSA lists a connection this pseudonode, often called a transit network, which is then modeled by a Type 2 network LSA.

Note: OSPF can model all the topology inside a single area using Type 1 and 2 LSAs.

CCNP ROUTE: 3.OSPF internal LSAs: LSA Type 1 - Router LSA

-An LSA type 1, called a router LSA, identifies an OSPF router based on its OSPF router ID (RID).
-Each router creates a Type 1 LSA for itself and floods the LSA throughout the same area.
-To flood the LSA, the originating router sends the Type 1 LSA to its neighbors inside the same area,
who in turn send it to their other neighbors inside the same area, until all routers in the area have a copy of the LSA.
-Internal routers each create a single Type 1 LSA for themselves, but ABRs create multiple Type 1 LSAs for themselves: one per area.
-As with all OSPF LSAs, OSPF identifies a Type 1 LSA using a 32-bit link state identifier (LSID).
-When creating its own Type 1 LSA, each router uses its own OSPF RID value as the LSID.

Below is a summary of Type 1 LSAs R1 has:
R1#show ip ospf database

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         1439        0x80000005 0x00AC60 8
2.2.2.2         2.2.2.2         1456        0x80000003 0x00E955 1
3.3.3.3         3.3.3.3         1435        0x80000003 0x00435F 2
4.4.4.4         4.4.4.4         1447        0x80000003 0x005E36 2
5.5.5.5         5.5.5.5         1462        0x80000003 0x00A2E1 2
9.9.9.9         9.9.9.9         1468        0x80000002 0x000D4D 2

R1 is an internal OSPF router, so it creates its own single Type 1 LSA, for Area 0:

R1#show ip ospf database router 1.1.1.1

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 0)

  LS age: 331
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 1.1.1.1
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000006
  Checksum: 0xAA61
  Length: 120
  Number of Links: 8

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.100.100
     (Link Data) Network Mask: 255.255.255.255
      Number of TOS metrics: 0
       TOS 0 Metrics: 1

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 9.9.9.9
     (Link Data) Router Interface address: 192.168.0.21
      Number of TOS metrics: 0
       TOS 0 Metrics: 64

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.0.20
     (Link Data) Network Mask: 255.255.255.252
      Number of TOS metrics: 0
       TOS 0 Metrics: 64

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 5.5.5.5
     (Link Data) Router Interface address: 192.168.0.17
      Number of TOS metrics: 0
       TOS 0 Metrics: 64

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.0.16
     (Link Data) Network Mask: 255.255.255.252
      Number of TOS metrics: 0
       TOS 0 Metrics: 64

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 4.4.4.4
     (Link Data) Router Interface address: 192.168.0.13
      Number of TOS metrics: 0
       TOS 0 Metrics: 64

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.0.12
     (Link Data) Network Mask: 255.255.255.252
      Number of TOS metrics: 0
       TOS 0 Metrics: 64

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 192.168.0.3
     (Link Data) Router Interface address: 192.168.0.1
      Number of TOS metrics: 0
       TOS 0 Metrics: 10

We can also check another router's Type 1 LSA (related to the same area) on R1:

R1#show ip ospf database router 5.5.5.5

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 0)

  LS age: 1735
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 5.5.5.5
  Advertising Router: 5.5.5.5
  LS Seq Number: 80000003
  Checksum: 0xA2E1
  Length: 48
  Number of Links: 2

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 1.1.1.1
     (Link Data) Router Interface address: 192.168.0.18
      Number of TOS metrics: 0
       TOS 0 Metrics: 64

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.0.16
     (Link Data) Network Mask: 255.255.255.252
      Number of TOS metrics: 0
       TOS 0 Metrics: 64

Note: Stub Network refers to a network/subnet to which only one OSPF router is connected (on which no DR has been elected - example: point-to-point).
 Transit Network refers to a network/subnet over which two or more OSPF routers have become neighbors.

Router R9, which is an ABR, creates a Type 1 LSA for each area it is connected to:

R9#show ip ospf database

            OSPF Router with ID (9.9.9.9) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         1370        0x80000005 0x00AC60 8
2.2.2.2         2.2.2.2         1387        0x80000003 0x00E955 1
3.3.3.3         3.3.3.3         1366        0x80000003 0x00435F 2
4.4.4.4         4.4.4.4         1378        0x80000003 0x005E36 2
5.5.5.5         5.5.5.5         1393        0x80000003 0x00A2E1 2
9.9.9.9         9.9.9.9         1397        0x80000002 0x000D4D 2
...
                Router Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum Link count
9.9.9.9         9.9.9.9         1442        0x80000006 0x00C00D 3
10.10.10.10     10.10.10.10     1422        0x80000006 0x00051D 3
11.11.11.11     11.11.11.11     1393        0x80000005 0x000A0D 3
...
                Router Link States (Area 3)

Link ID         ADV Router      Age         Seq#       Checksum Link count
9.9.9.9         9.9.9.9         463         0x80000004 0x00A752 1
12.12.12.12     12.12.12.12     518         0x80000005 0x000E18 2

Thursday, August 8, 2013

CCNP ROUTE: 2.OSPF Neighborships over WANs: Broadcast, Point-to-Point and Nonbroadcast (NBMA)

On LAN interfaces:  
-default OSPF network type BROADCAST
-DR/BDR are elected, dynamic discovery of neighbors, more than 2 routers allowed in a subnet, Hello interval 10.

On R9's LAN interface to R12:
R9#show ip ospf interface fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
Internet Address 192.168.3.1/30, Area 3
Process ID 1, Router ID 9.9.9.9, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 12.12.12.12, Interface address 192.168.3.2
Backup Designated router (ID) 9.9.9.9, Interface address 192.168.3.1
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

On point-to-point interfaces: 
-default OSPF network type POINT-TO-POINT
-NO DR/BDR are elected, dynamic discovery of neighbors, ONLY 2 routers allowed in a subnet, Hello interval 10.

On router R9's serial interface to R1:
R9#show ip ospf interface serial 0/0
Serial0/0 is up, line protocol is up
Internet Address 192.168.0.22/30, Area 0
Process ID 1, Router ID 9.9.9.9, 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

On physical and multipoint subinterfaces: 
-default OSPF network type NONBROADCAST (NBMA)
-DR/BDR are elected, NO dynamic discovery of neighbors, more than 2 routers allowed in a subnet, Hello interval 30.

On router R9's serial interface to the Frame Relay cloud:
R9#show ip ospf interface serial 0/1.1
Serial0/1.1 is up, line protocol is up
Internet Address 10.0.1.1/29, Area 2
Process ID 1, Router ID 9.9.9.9, 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

Since for OSPF network type NONBROADCAST neighbors are not dynamically discovered, they have to be statically configured, as seen below:
R9#show run | s ospf
 ip ospf network point-to-multipoint non-broadcast
router ospf 1
 router-id 9.9.9.9
 log-adjacency-changes
 area 3 nssa no-summary
 network 10.0.1.0 0.0.0.255 area 2
 network 192.168.0.20 0.0.0.3 area 0
 network 192.168.3.0 0.0.0.3 area 3
 neighbor 10.0.1.3
 neighbor 10.0.1.2

Wednesday, August 7, 2013

CCNP ROUTE: 1.Basic redistribution into EIGRP

The IOS "redistribute" command takes routes from the IP routing table and passes those routes to a routing protocol for redistribution. The "redistribute" command, configured inside a routing protocol configuration mode, redistributes routes into that routing protocol from some other source.

General syntax:
redistribute protocol [process-id | as-number] [metric bw delay reliability load mtu ] [match {internal | nssa-external | external 1 | external 2}]  [tag tagvalue] [route-map name]

Parameters:
-protocol: The source of routing information. Includes RIP, OSPF, EIGRP, IS-IS, BGP, connected, and static.
-process-id/as-number: If redistributing a routing protocol that uses a process ID or ASN on the router global config command, use this parameter to refer to that process or ASN value.
-metric: A keyword after which follows the four metric components (bandwidth, delay, reliability, link load), plus the MTU associated with the route.
-match: If redistributing from OSPF, this keyword lets you match internal OSPF routes, external (by type), and NSSA external routes, essentially filtering which routes are redistributed.
-tag: Assigns a unitless integer value to the routes redistributed by this command - tags which can be later matched by other routers using a route-map.
-route-map: Apply the logic in the referenced route-map to filter routes, set metrics, and set route tags.

When redistributing another protocol into EIGRP, if we use only "redistribute protocol [process-id | as-number]" then the redistribution does not take place, even if the command is accepted by IOS. 
EIGRP does not have a default setting for the metric components to use when redistributing into EIGRP from OSPF or any other routing protocol.

Consider router R4, which is sitting between an EIGRP and an OSPF domain. Both protocols have been configured, but no redistribution yet:

R4#show run
...
!
router eigrp 1
 network 172.16.0.2 0.0.0.0
 network 172.16.0.12 0.0.0.3
 network 192.168.44.0
 no auto-summary
!
router ospf 1
 router-id 4.4.4.4
 log-adjacency-changes
 network 192.168.0.12 0.0.0.3 area 0
!
R4#show run | i redistribute
R4#

The EIGRP topology table on R4 shows only the routes learned from EIGRP. No OSPF routes reside in this table. Also, we can verify R6's routing table, showing nothing but routes to networks in the EIGRP domain:

R4#show ip eigrp topology 
IP-EIGRP Topology Table for AS(1)/ID(192.168.44.44)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status 

P 192.168.44.0/24, 1 successors, FD is 128256
        via Connected, Loopback44
P 192.168.55.0/24, 1 successors, FD is 2297856
        via 172.16.0.14 (2297856/128256), Serial0/2
        via 172.16.0.1 (2323456/409600), Serial0/0
P 172.16.0.12/30, 1 successors, FD is 2169856
        via Connected, Serial0/2
P 172.16.0.8/30, 1 successors, FD is 2681856
        via 172.16.0.1 (2681856/2169856), Serial0/0
        via 172.16.0.14 (2707456/2195456), Serial0/2
P 172.16.0.4/30, 2 successors, FD is 2195456
        via 172.16.0.1 (2195456/281600), Serial0/0
        via 172.16.0.14 (2195456/281600), Serial0/2
P 172.16.0.0/30, 1 successors, FD is 2169856
        via Connected, Serial0/0
P 172.16.111.0/24, 1 successors, FD is 2297856
        via 172.16.0.1 (2297856/128256), Serial0/0
        via 172.16.0.14 (2323456/409600), Serial0/2

R6#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

D    192.168.44.0/24 [90/2297856] via 172.16.0.2, 00:31:28, Serial0/0
     172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
D       172.16.0.12/30 [90/2195456] via 172.16.0.6, 00:31:28, FastEthernet0/1
C       172.16.0.8/30 is directly connected, Serial0/1
C       172.16.0.4/30 is directly connected, FastEthernet0/1
C       172.16.0.0/30 is directly connected, Serial0/0
C       172.16.111.0/24 is directly connected, Loopback111
D    192.168.55.0/24 [90/409600] via 172.16.0.6, 00:31:28, FastEthernet0/1

Now, let's configure redistribution into EIGRP with no other parameters other than the protocol and process-id:

R4(config)#router eigrp 1
R4(config-router)#redistribute ospf 1

Let's verify the topology table on R4 and the routing table on R6 again:

R4#show ip eigrp topology 
IP-EIGRP Topology Table for AS(1)/ID(192.168.44.44)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status 

P 192.168.44.0/24, 1 successors, FD is 128256
        via Connected, Loopback44
P 192.168.55.0/24, 1 successors, FD is 2297856
        via 172.16.0.14 (2297856/128256), Serial0/2
        via 172.16.0.1 (2323456/409600), Serial0/0
P 172.16.0.12/30, 1 successors, FD is 2169856
        via Connected, Serial0/2
P 172.16.0.8/30, 1 successors, FD is 2681856
        via 172.16.0.1 (2681856/2169856), Serial0/0
        via 172.16.0.14 (2707456/2195456), Serial0/2
P 172.16.0.4/30, 2 successors, FD is 2195456
        via 172.16.0.1 (2195456/281600), Serial0/0
        via 172.16.0.14 (2195456/281600), Serial0/2
P 172.16.0.0/30, 1 successors, FD is 2169856
        via Connected, Serial0/0
P 172.16.111.0/24, 1 successors, FD is 2297856
        via 172.16.0.1 (2297856/128256), Serial0/0
        via 172.16.0.14 (2323456/409600), Serial0/2

R6#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

D    192.168.44.0/24 [90/2297856] via 172.16.0.2, 00:34:04, Serial0/0
     172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
D       172.16.0.12/30 [90/2195456] via 172.16.0.6, 00:34:04, FastEthernet0/1
C       172.16.0.8/30 is directly connected, Serial0/1
C       172.16.0.4/30 is directly connected, FastEthernet0/1
C       172.16.0.0/30 is directly connected, Serial0/0
C       172.16.111.0/24 is directly connected, Loopback111
D    192.168.55.0/24 [90/409600] via 172.16.0.6, 00:34:04, FastEthernet0/1

As we can see, both tables are unchanged, since no routes have been redistributed from OSPF.

Now, there are 3 methods to make this work for EIGRP:
-Setting the default for all redistribute commands with the "default-metric" command.
-Setting the component metrics applied to all routes redistributed by a single "redistribute" command, using the "metric" parameters.
-Setting different component metrics to different routes from a single route source, using the "route-map" parameter inside the "redistribute" command.

Note: When redistributing into EIGRP from another protocol, the default metric is infinite (same for RIP). EIGRP does have a default metric when redistributing from another EIGRP process, in which case it takes the metric from the source of the routing information.

Now, returning to R4, let's use the first method:

R4(config)#router eigrp 1
R4(config-router)#default-metric ?
  <1-4294967295>  Bandwidth in Kbits per second

R4(config-router)#default-metric 1544 ?
  <0-4294967295>  Delay metric, in 10 microsecond units

R4(config-router)#default-metric 1544 2000 ?
  <0-255>  Reliability metric where 255 is 100% reliable

R4(config-router)#default-metric 1544 2000 255 ?
  <1-255>  Effective bandwidth metric (Loading) where 255 is 100% loaded

R4(config-router)#default-metric 1544 2000 255 1 ?
  <1-65535>  Maximum Transmission Unit metric of the path 

R4(config-router)#default-metric 1544 2000 255 1 1500

Verifying again the topology table on R4 and the routing table on R6:

R4#show ip eigrp topology 
IP-EIGRP Topology Table for AS(1)/ID(192.168.44.44)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status 

P 10.0.1.3/32, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 10.0.1.2/32, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 10.0.1.1/32, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 10.0.10.10/32, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 10.0.11.11/32, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 192.168.44.0/24, 1 successors, FD is 128256
        via Connected, Loopback44
P 192.168.55.0/24, 1 successors, FD is 2297856
        via 172.16.0.14 (2297856/128256), Serial0/2
        via 172.16.0.1 (2323456/409600), Serial0/0
P 192.168.0.12/30, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 192.168.33.33/32, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 192.168.100.100/32, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 192.168.0.0/29, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 192.168.13.13/32, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 192.168.3.0/30, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 192.168.169.170/32, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 192.168.0.16/30, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 192.168.0.20/30, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 172.16.0.12/30, 1 successors, FD is 2169856
        via Connected, Serial0/2
P 172.16.0.8/30, 1 successors, FD is 2681856
        via 172.16.0.1 (2681856/2169856), Serial0/0
        via 172.16.0.14 (2707456/2195456), Serial0/2
P 172.16.0.4/30, 2 successors, FD is 2195456
        via 172.16.0.1 (2195456/281600), Serial0/0
        via 172.16.0.14 (2195456/281600), Serial0/2
P 172.16.0.0/30, 1 successors, FD is 2169856
        via Connected, Serial0/0
P 192.168.168.0/30, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
P 172.16.111.0/24, 1 successors, FD is 2297856
        via 172.16.0.1 (2297856/128256), Serial0/0
        via 172.16.0.14 (2323456/409600), Serial0/2

R6#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     192.168.13.0/32 is subnetted, 1 subnets
D EX    192.168.13.13 [170/2681856] via 172.16.0.2, 00:02:29, Serial0/0
D    192.168.44.0/24 [90/2297856] via 172.16.0.2, 00:45:18, Serial0/0
     172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
D       172.16.0.12/30 [90/2195456] via 172.16.0.6, 00:45:18, FastEthernet0/1
C       172.16.0.8/30 is directly connected, Serial0/1
C       172.16.0.4/30 is directly connected, FastEthernet0/1
C       172.16.0.0/30 is directly connected, Serial0/0
C       172.16.111.0/24 is directly connected, Loopback111
D    192.168.55.0/24 [90/409600] via 172.16.0.6, 00:45:20, FastEthernet0/1
     10.0.0.0/32 is subnetted, 5 subnets
D EX    10.0.1.3 [170/2681856] via 172.16.0.2, 00:02:30, Serial0/0
D EX    10.0.1.2 [170/2681856] via 172.16.0.2, 00:02:30, Serial0/0
D EX    10.0.11.11 [170/2681856] via 172.16.0.2, 00:02:32, Serial0/0
D EX    10.0.10.10 [170/2681856] via 172.16.0.2, 00:02:32, Serial0/0
D EX    10.0.1.1 [170/2681856] via 172.16.0.2, 00:02:32, Serial0/0
     192.168.0.0/24 is variably subnetted, 4 subnets, 2 masks
D EX    192.168.0.12/30 [170/2681856] via 172.16.0.2, 00:02:32, Serial0/0
D EX    192.168.0.0/29 [170/2681856] via 172.16.0.2, 00:02:32, Serial0/0
D EX    192.168.0.16/30 [170/2681856] via 172.16.0.2, 00:02:32, Serial0/0
D EX    192.168.0.20/30 [170/2681856] via 172.16.0.2, 00:02:32, Serial0/0
     192.168.168.0/30 is subnetted, 1 subnets
D EX    192.168.168.0 [170/2681856] via 172.16.0.2, 00:02:32, Serial0/0
     192.168.100.0/32 is subnetted, 1 subnets
D EX    192.168.100.100 [170/2681856] via 172.16.0.2, 00:02:32, Serial0/0
     192.168.169.0/32 is subnetted, 1 subnets
D EX    192.168.169.170 [170/2681856] via 172.16.0.2, 00:02:32, Serial0/0
     192.168.3.0/30 is subnetted, 1 subnets
D EX    192.168.3.0 [170/2681856] via 172.16.0.2, 00:02:33, Serial0/0
     192.168.33.0/32 is subnetted, 1 subnets
D EX    192.168.33.33 [170/2681856] via 172.16.0.2, 00:02:33, Serial0/0

Notes/Conclusions:

-The "D EX" routes are the routes R4 redistributed from the OSPF domain. They are marked as external, having the default AD of external EIGRP routes, 170.

-In R4's topology table, we notice that all redistributed routes are marked with "via Redistributed", having the same Feasible Distance (FD), because all use the same component metrics per the configured "default-metric" command.

-R4's connected subnet (192.168.0.12/30) was also redistributed, even though this route is a connected route for R4 and not an OSPF route.

-The default metrics we configured and the protocol from which the routes came are confirmed for each route in the EIGRP topology table:
R4#show ip eigrp topology 192.168.0.0/29
IP-EIGRP (AS 1): Topology entry for 192.168.0.0/29
  State is Passive, Query origin flag is 1, 1 Successor(s), FD is 2169856
  Routing Descriptor Blocks:
  192.168.0.13, from Redistributed, Send flag is 0x0
      Composite metric is (2169856/0), Route is External
      Vector metric:
        Minimum bandwidth is 1544 Kbit
        Total delay is 20000 microseconds
        Reliability is 255/255
        Load is 1/255
        Minimum MTU is 1500
        Hop count is 0
      External data:
        Originating router is 192.168.44.44 (this system)
        AS number of route is 1
        External protocol is OSPF, external metric is 74
        Administrator tag is 0 (0x00000000)

CCNP ROUTE: 1.OSPF Neighborships over LANs

The following list details the items seen in OSPF Hello messages:
■ OSPF Router ID
■ Stub area flag
■ Plus the following interface-specific settings:
■ Hello interval
■ Dead Interval
■ Subnet mask
■ List of neighbors reachable on the interface
■ Area ID
■ Router priority
■ Designated Router (DR) IP address
■ Backup DR (BDR) IP address
■ Authentication digest

Items that two routers will compare when deciding whether they can become OSPF neighbors:
■ Interfaces’ primary IP addresses must be in same subnet.
■ Must not be passive on the connected interface.
■ Must be in same area.
■ Hello interval and Dead timer must match. (Example A)
■ Router IDs (RIDs) must be unique. (Example B)
■ IP MTU must match. (Example C)
■ Must pass neighbor authentication, if configured.  (Example D)

Example A:
-The Hello interval defines how often the router sends a Hello on the interface.
-The Dead interval defines how long a router should wait, without hearing any Hello messages from that neighbor, before deciding that the neighbor failed.
-With a default LAN interface setting of Hello of 10, and Dead of 40, the local router sends Hello messages every 10 seconds.
-By default: (Dead interval) = 4*(Hello interval)

Consider R1's neighbors:

R1#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
9.9.9.9           0   FULL/  -        00:00:31    192.168.0.22    Serial0/0
5.5.5.5           0   FULL/  -        00:00:36    192.168.0.18    Serial0/2
4.4.4.4           0   FULL/  -        00:00:30    192.168.0.14    Serial0/1
2.2.2.2           1   FULL/BDR        00:00:32    192.168.0.2     FastEthernet0/0
3.3.3.3           1   FULL/DR         00:00:35    192.168.0.3     FastEthernet0/0

Consider R1's neighborship with R9 (through Serial0/0):

R1#show ip ospf interface serial 0/0
Serial0/0 is up, line protocol is up
  Internet Address 192.168.0.21/30, Area 0
  Process ID 1, Router ID 1.1.1.1, 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
...
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 9.9.9.9
  Suppress hello for 0 neighbor(s)

Modifying R1's Serial0/0 interfaces' Hello interval, the neighborship should fail due to timer mismatch:

R1(config)#interface serial 0/0
R1(config-if)#ip ospf hello-interval 15 
R1#show ip ospf interface serial 0/0
Serial0/0 is up, line protocol is up
  Internet Address 192.168.0.21/30, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 64
  Transmit Delay is 1 sec, State POINT_TO_POINT
  Timer intervals configured, Hello 15, Dead 60, Wait 60, Retransmit 5
*Mar  1 01:09:20.331: %OSPF-5-ADJCHG: Process 1, Nbr 9.9.9.9 on Serial0/0 from FULL to DOWN, Neighbor Down: Dead timer expired

Changing back to the same Hello interval as on R9:
R1(config-if)#ip ospf hello-interval 10
R1(config-if)#
*Mar  1 01:10:40.099: %OSPF-5-ADJCHG: Process 1, Nbr 9.9.9.9 on Serial0/0 from LOADING to FULL, Loading Done

The same happens when modifying the Dead interval:
R1(config-if)#ip ospf dead-interval 100
R1(config-if)#
*Mar  1 01:13:30.011: %OSPF-5-ADJCHG: Process 1, Nbr 9.9.9.9 on Serial0/0 from FULL to DOWN, Neighbor Down: Dead timer expired

Also, we can set the Dead interval to a minimum of 1 second and the Hello multiplier with a preferred value:
R1(config-if)#ip ospf dead-interval minimal hello-multiplier 10 (this sets Dead = 1 second, with Hellos occurring 10 times per second)
*Mar  1 01:21:30.047: %OSPF-5-ADJCHG: Process 1, Nbr 9.9.9.9 on Serial0/0 from FULL to DOWN, Neighbor Down: Dead timer expired


Example B:
By design, all OSPF RIDs in a domain should be unique; to avoid such issues, OSPF prevents neighborships between routers with duplicate RIDs.

R1#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
9.9.9.9           0   FULL/  -        00:00:36    192.168.0.22    Serial0/0
5.5.5.5           0   FULL/  -        00:00:30    192.168.0.18    Serial0/2
4.4.4.4           0   FULL/  -        00:00:35    192.168.0.14    Serial0/1
2.2.2.2           1   FULL/BDR        00:00:37    192.168.0.2     FastEthernet0/0
3.3.3.3           1   FULL/DR         00:00:39    192.168.0.3     FastEthernet0/0
R1#show ip protocols 
Routing Protocol is "ospf 1"
  ...
  Router ID 1.1.1.1
R1(config-router)#router-id 9.9.9.9
Reload or use "clear ip ospf process" command, for this to take effect
R1#clear ip ospf process 
Reset ALL OSPF processes? [no]: y
*Mar  1 01:29:41.199: %OSPF-5-ADJCHG: Process 1, Nbr 9.9.9.9 on Serial0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
R1#
*Mar  1 01:29:43.703: %OSPF-4-DUP_RTRID_NBR: OSPF detected duplicate router-id 9.9.9.9 from 192.168.0.22 on interface Serial0/0
R1#
*Mar  1 01:30:50.051: %OSPF-4-DUP_RTRID_NBR: OSPF detected duplicate router-id 9.9.9.9 from 192.168.0.22 on interface Serial0/0
R1#
*Mar  1 01:32:00.035: %OSPF-4-DUP_RTRID_NBR: OSPF detected duplicate router-id 9.9.9.9 from 192.168.0.22 on interface Serial0/0
R1#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
5.5.5.5           0   FULL/  -        00:00:33    192.168.0.18    Serial0/2
4.4.4.4           0   FULL/  -        00:00:37    192.168.0.14    Serial0/1
2.2.2.2           1   FULL/BDR        00:00:39    192.168.0.2     FastEthernet0/0
3.3.3.3           1   FULL/DR         00:00:32    192.168.0.3     FastEthernet0/0


Example C:
-The maximum transmission unit (MTU) of an interface tells IOS the largest IP packet that can be forwarded out the interface.
-This setting protects the packet from being discarded on data links whose Layer 2 features will not pass a frame over a certain size.
-For example, routers typically default to an IP MTU of 1500 bytes to accommodate Ethernet’s rules about frames not exceeding 1526 bytes.

-When an MTU mismatch occurs between two OSPF neighbors, one router will attempt to become neighbors with the other router whose MTU differs.
-The other router will be listed in the list of neighbors (show ip ospf neighbor). However, the two routers will not exchange topology information,
and the two routers will not calculate routes that use this neighbor as the next-hop router.

R1#show ip route
...
     192.168.13.0/32 is subnetted, 1 subnets
O       192.168.13.13 [110/11] via 192.168.0.3, 00:00:05, FastEthernet0/0
     10.0.0.0/32 is subnetted, 5 subnets
O IA    10.0.1.3 [110/128] via 192.168.0.22, 00:00:05, Serial0/0
O IA    10.0.1.2 [110/128] via 192.168.0.22, 00:00:05, Serial0/0
O IA    10.0.11.11 [110/129] via 192.168.0.22, 00:00:05, Serial0/0
O IA    10.0.10.10 [110/129] via 192.168.0.22, 00:00:05, Serial0/0
O IA    10.0.1.1 [110/64] via 192.168.0.22, 00:00:05, Serial0/0
     192.168.0.0/24 is variably subnetted, 4 subnets, 2 masks
C       192.168.0.12/30 is directly connected, Serial0/1
C       192.168.0.0/29 is directly connected, FastEthernet0/0
C       192.168.0.16/30 is directly connected, Serial0/2
C       192.168.0.20/30 is directly connected, Serial0/0
     192.168.168.0/30 is subnetted, 1 subnets
O IA    192.168.168.0 [110/20] via 192.168.0.2, 00:00:11, FastEthernet0/0
C    192.168.100.0/24 is directly connected, Loopback0
     192.168.169.0/32 is subnetted, 1 subnets
O IA    192.168.169.170 [110/21] via 192.168.0.2, 00:00:11, FastEthernet0/0
     192.168.3.0/30 is subnetted, 1 subnets
O IA    192.168.3.0 [110/74] via 192.168.0.22, 00:00:11, Serial0/0
     192.168.33.0/32 is subnetted, 1 subnets
O IA    192.168.33.33 [110/75] via 192.168.0.22, 00:00:11, Serial0/0

R1(config)#interface serial 0/0
R1(config-if)#ip mtu 1498 
R1#show ip interface serial 0/0
Serial0/0 is up, line protocol is up
...
  MTU is 1498 bytes
R9#show ip int s0/0
Serial0/0 is up, line protocol is up
...
  MTU is 1500 bytes

R1#clear ip ospf process 
Reset ALL OSPF processes? [no]: y
R1#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
9.9.9.9           0   EXSTART/  -     00:00:38    192.168.0.22    Serial0/0
5.5.5.5           0   FULL/  -        00:00:33    192.168.0.18    Serial0/2
4.4.4.4           0   FULL/  -        00:00:37    192.168.0.14    Serial0/1
2.2.2.2           1   FULL/BDR        00:00:39    192.168.0.2     FastEthernet0/0
3.3.3.3           1   FULL/DR         00:00:32    192.168.0.3     FastEthernet0/0
R1#
*Mar  1 01:48:22.831: %OSPF-5-ADJCHG: Process 1, Nbr 9.9.9.9 on Serial0/0 from EXSTART to DOWN, Neighbor Down: Too many retransmissions
R1#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
9.9.9.9           0   DOWN/  -           -        192.168.0.22    Serial0/0
5.5.5.5           0   FULL/  -        00:00:31    192.168.0.18    Serial0/2
4.4.4.4           0   FULL/  -        00:00:35    192.168.0.14    Serial0/1
2.2.2.2           1   FULL/BDR        00:00:37    192.168.0.2     FastEthernet0/0
3.3.3.3           1   FULL/DR         00:00:30    192.168.0.3     FastEthernet0/0

-When the mismatch occurs, a pair of routers tries to become neighbors, and they list each other in the output of show ip ospf neighbors.
-However, the neighbor state (listed before the /, under heading “State”) moves to EXSTART (which means the database exchange process is starting).
-Then, the state changes to DOWN, and later one router tries again, moving to INIT (initializing) state.
-So, the neighbor is listed in the output of show ip ospf neighbors command, but never succeeds at exchanging the topology data.


Example D:
-OSPF authentication causes routers to authenticate every OSPF message.
-To do so, the routers use the same preshared key value, generating an MD5 digest for each OSPF message and sending that digest as part of each OSPF message.
-OSPF authentication uses one of three types: type 0 (no authentication), type 1 (clear text - Simple password authentication), and type 2 (MD5).

Consider the same R1-R9 neighborship:

R1(config)#interface serial 0/0 
R1(config-if)#ip ospf authentication message-digest
R1(config-if)#ip ospf message-digest-key 1 md5 secret
*Mar  1 02:08:00.071: %OSPF-5-ADJCHG: Process 1, Nbr 9.9.9.9 on Serial0/0 from FULL to DOWN, Neighbor Down: Dead timer expired
R1#debug ip ospf adj 
*Mar  1 02:08:30.039: OSPF: Rcv pkt from 192.168.0.22, Serial0/0 : Mismatch Authentication type. Input packet specified type 0, we use type 2
*Mar  1 02:08:32.803: OSPF: Send with youngest Key 1

Now the neighborship is down. On R9, we should also configure md5 authentication, using the same key:
R9(config)#interface serial 0/0
R9(config-if)#ip ospf authentication message-digest

Enabling authentication on R9's interface, but not specifying the authentication key, leads to a failed neighborship and the following messages on R1:
R1#
*Mar  1 02:13:22.803: OSPF: Send with youngest Key 1
*Mar  1 02:13:30.051: OSPF: Rcv pkt from 192.168.0.22, Serial0/0 : Mismatch Authentication Key - No message digest key 0 on interface
This time, the mismatch refers to the authentication key, not the authentication type, as earlier.

Now, setting the authentication key on R9 also:
R9(config-if)#ip ospf message-digest-key 1 md5 secret
*Mar  1 02:13:50.983: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Serial0/0 from LOADING to FULL, Loading Done

R1#
*Mar  1 02:14:00.095: OSPF: Send with youngest Key 1
*Mar  1 02:14:00.123: OSPF: 2 Way Communication to 9.9.9.9 on Serial0/0, state 2WAY
*Mar  1 02:14:00.123: OSPF: Send DBD to 9.9.9.9 on Serial0/0 seq 0x1562 opt 0x52 flag 0x7 len 32
*Mar  1 02:14:00.127: OSPF: Send with youngest Key 1
*Mar  1 02:14:00.131: OSPF: Rcv DBD from 9.9.9.9 on Serial0/0 seq 0x2325 opt 0x52 flag 0x7 len 32  mtu 1500 state EXSTART
*Mar  1 02:14:00.135: OSPF: NBR Negotiation Done. We are the SLAVE
...
*Mar  1 02:14:00.151: OSPF: Synchronized with 9.9.9.9 on Serial0/0, state FULL
*Mar  1 02:14:00.151: %OSPF-5-ADJCHG: Process 1, Nbr 9.9.9.9 on Serial0/0 from LOADING to FULL, Loading Done