Network Bulls
www.networkbulls.com
Best Institute for CCNA CCNP CCSP CCIP CCIE Training in India
M-44, Old Dlf, Sector-14 Gurgaon, Haryana, India
Call: +91-9654672192
The SPF algorithm places each router at the root of a tree and calculates the shortest path to each
node, using Dijkstra’s algorithm, based on the cumulative cost that is required to reach that
destination. LSAs are flooded throughout the area using a reliable algorithm, which ensures that
all routers in an area have the same topological database. Each router uses the information in its
topological database to calculate a shortest path tree, with itself as the root. The router then uses
this tree to route network traffic. Figure 4-3 represents the Router A view of the network, where
Router A is the root and calculates pathways assuming this view.
Each router has its own view of the topology, even though all of the routers build a shortest-path
tree using the same link-state database.
The cost, or metric, of an interface is an indication of the overhead that is required to send packets
across a certain interface. The interface cost is inversely proportional to the bandwidth, so a higher
bandwidth indicates a lower cost. There is more overhead, higher cost, and more time delays
involved in crossing a T1 serial line than in crossing a 10-Mbps Ethernet line.
NOTE OSPF DRs and BDRs are discussed in the Cisco Certified Networking Professional
(CCNP) curriculum.
NOTE OSPF special areas such as stub areas are discussed in the CCNP curriculum.
144 Chapter 4: Single-Area OSPF Implementation
Figure 4-3 SPF Algorithm for Route Selection
The formula used to calculate OSPF cost is as follows:
cost = reference bandwidth / interface bandwidth (in bps)
The default reference bandwidth is 108, which is 100,000,000 or the equivalent of the bandwidth
of FastEthernet. Therefore, the default cost of a 10-Mbps Ethernet link will be 108 / 107 = 10, and
the cost of a T1 link will be 108 / 1,544,000 = 64.
To adjust the reference bandwidth for links with bandwidths greater than FastEthernet, use the
ospf auto-cost reference-bandwidth ref-bw command configured in the OSPF routing process
configuration mode.
Configuring and Verifying OSPF
The router ospf command uses a process identifier as an argument. The process ID is a unique,
arbitrary number that you select to identify the routing process. The process ID does not need to
match the OSPF process ID on other OSPF routers.
The network command identifies which IP networks on the router are part of the OSPF network.
For each network, you must also identify the OSPF area to which the networks belong. The
network command takes the three arguments listed in Table 4-1. The table defines the parameters
of the network command.
Router A
Router B
Router C
10 Router D
10
0
5
5
10
5
222.211.10.0
128.213.0.0
192.213.11.0
Introducing OSPF 145
Calculating wildcard masks on non-8-bit boundaries can be prone to error. You can avoid
calculating wildcard masks by having a network statement that matches the IP address on each
interface and uses the 0.0.0.0 mask.
Figure 4-4 shows an example of a single-area OSPF configuration on Router B.
Figure 4-4 Single-Area OSPF
Loopback Interfaces
The OSPF router ID is used to uniquely identify each router in the OSPF network. By default, this
ID is selected by the operating system from the configured IP addresses on the router. To modify
the OSPF router ID to use a loopback address, first define a loopback interface with the following
command:
RouterX(config)# interface loopback number
The highest IP address, used as the router ID by default, can be overridden by configuring an IP
address on a loopback interface. OSPF is more reliable if a loopback interface is configured
because the interface is always active and cannot be in a down state like a “real” interface can. For
this reason, the loopback address should be used on all key routers. If the loopback address is
Table 4-1 network Command Parameters
router ospf
Command
Parameters Description
address The network, subnet, or interface address.
wildcard-mask The wildcard mask. This mask identifies the part of the IP address that is to be
matched, where 0 is a match and 1 is “don’t care.” For example, a wildcard mask
of 0.0.0.0 indicates a match of all 32 bits in the address.
area-id The area that is to be associated with the OSPF address range. It can be specified
either as a decimal value or in dotted-decimal notation, like an IP address.
A B C
172.16.1.1
172.16.1.0 192.168.1.0
10.1.1.1 10.1.1.2 10.2.2.2 10.2.2.3 192.168.1.1
E0 S2 S2 S3 S3 E0
Area = 0
146 Chapter 4: Single-Area OSPF Implementation
going to be published with the network area command, using a private IP address will save on
registered IP address space. Note that a loopback address requires a different subnet for each
router, unless the host address is advertised.
Using an address that is not advertised saves real IP address space, but unlike an address that is
advertised, the unadvertised address does not appear in the OSPF table and thus cannot be
accessed across the network. Therefore, using a private IP address represents a trade-off between
the ease of debugging the network and conservation of address space. Figure 4-5 highlights some
of the advantages and disadvantages of using advertised and unadvertised loopback addresses.
Figure 4-5 Loopback Addresses
Verifying the OSPF Configuration
You can use any one of a number of show commands to display information about an OSPF
configuration. The show ip protocols command displays parameters about timers, filters, metrics,
networks, and other information for the entire router.
The show ip route command displays the routes that are known to the router and how they were
learned. This command is one of the best ways to determine connectivity between the local router
and the rest of the internetwork. Example 4-1 shows the output from the show ip route command
for a router running OSPF.
Example 4-1 Displaying Routes Known by Router
RouterX#show ip route
Codes: I - IGRP derived, R - RIP derived, O - OSPF derived,
C - connected, S - static, E - EGP derived, B - BGP derived,
* - candidate default route, IA - OSPF inter area route,
i - IS-IS derived, ia - IS-IS, U - per-user static route,
o - on-demand routing, M - mobile, P - periodic downloaded static route,
D - EIGRP, EX - EIGRP external, E1 - OSPF external type 1 route,
E2 - OSPF external type 2 route, N1 - OSPF NSSA external type 1 route,
N2 - OSPF NSSA external type 2 route
Unadvertised Loopback Address
Ex.: 192.168.255.254
• Used for OSPF router ID.
• Saves address space.
• Cannot be used to remotely
administer router.
Advertised Loopback Address
Ex.: 172.16.17.5
• Used for OSPF router ID.
• Uses address space.
• Can be used to remotely
administer router.
Network
172.16.0.0
Introducing OSPF 147
Table 4-2 describes the significant fields shown in the show ip route display.
Gateway of last resort is 10.119.254.240 to network 10.140.0.0
O 10.110.0.0 [110/5] via 10.119.254.6, 0:01:00, Ethernet2
O IA 10.67.10.0 [110/10] via 10.119.254.244, 0:02:22, Ethernet2
O 10.68.132.0 [110/5] via 10.119.254.6, 0:00:59, Ethernet2
O 10.130.0.0 [110/5] via 10.119.254.6, 0:00:59, Ethernet2
O E2 10.128.0.0 [170/10] via 10.119.254.244, 0:02:22, Ethernet2
Table 4-2 IP Routing Table Fields
Value Description
O This field indicates the learning method that derived the route. It can be one of
the following values:
I: IGRP1-derived
R: RIP2-derived
O: OSPF-derived (the value displayed in the example)
C: Connected
S: Static
E: EGP3-derived
B: BGP4-derived
D: EIGRP5-derived
EX: EIGRP external
i: IS-IS6-derived
ia: IS-IS
M: Mobile
P: Periodic downloaded static route
U: Per-user static route
o: On-demand routing
Example 4-1 Displaying Routes Known by Router (Continued)
continues
148 Chapter 4: Single-Area OSPF Implementation
1 IGRP = Interior Gateway Routing Protocol
2 RIP = Routing Information Protocol
3 EGP = Exterior Gateway Protocol
4 BGP = Border Gateway Protocol
5 EIGRP = Enhanced Interior Gateway Routing Protocol
6 IS-IS = Intermediate System-to-Intermediate System
Use the show ip ospf command to verify the OSPF router ID. This command also displays OSPF
timer settings and other statistics, including the number of times the SPF algorithm has been
executed. In addition, this command has optional parameters so you can further specify the
information that is to be displayed.
Value Description
E2
IA
This field indicates the type of route. It can be one of the following values:
*: Indicates the last path used when a packet was forwarded. It pertains only to
the nonfast-switched packets. However, it does not indicate which path will be
used next when forwarding a nonfast-switched packet, except when the paths
are equal cost.
IA: OSPF interarea route
E1: OSPF external type 1 route
E2: OSPF external type 2 route (The value displayed in the example.)
L1: IS-IS level 1 route
L2: IS-IS level 2 route
N1: OSPF NSSA external type 1 route
N2: OSPF NSSA external type 2 route
172.150.0.0 This address indicates the address of the remote network.
[110/5] The first number in the brackets is the administrative distance of the information
source; the second number is the metric for the route.
via 10.119.254.6 This value specifies the address of the next router to the remote network.
0:01:00 This field specifies the last time the route was updated (in
hours:minutes:seconds).
Ethernet2 This field specifies the interface through which the specified network can be
reached.
Table 4-2 IP Routing Table Fields (Continued)
Introducing OSPF 149
Example 4-2 shows the output from this command when it is executed on Router X.
The show ip ospf interface command verifies that interfaces have been configured in the intended
areas. If no loopback address is specified, the interface with the highest address is chosen as the
router ID. This command also displays the timer intervals, including the hello interval, and shows
Example 4-2 show ip ospf Command Output
RouterX#show ip ospf
Routing Process “ospf 50" with ID 10.64.0.2
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Incremental-SPF disabled
Minimum LSA interval 5 secs
Minimum LSA arrival 1000 msecs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 0. Checksum Sum 0x000000
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
Area BACKBONE(0)
Area BACKBONE(0)
Area has no authentication
SPF algorithm last executed 00:01:25.028 ago
SPF algorithm executed 7 times
Area ranges are
Number of LSA 6. Checksum Sum 0x01FE3E
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
150 Chapter 4: Single-Area OSPF Implementation
the neighbor adjacencies. Example 4-3 demonstrates output from the show ip ospf interface
command.
Table 4-3 describes the output for the show ip ospf interface command.
The show ip ospf neighbor command displays OSPF neighbor information on a per-interface
basis.
Example 4-4 shows output from the show ip ospf neighbor command, with a single line of
summary information for each neighbor in the output.
Example 4-3 show ip ospf interface Command Output
RouterX#show ip ospf interface ethernet 0
Ethernet 0 is up, line protocol is up
Internet Address 192.168.254.202, Mask 255.255.255.0, Area 0.0.0.0
AS 201, Router ID 192.168.99.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State OTHER, Priority 1
Designated Router id 192.168.254.10, Interface address 192.168.254.10
Backup Designated router id 192.168.254.28, Interface addr 192.168.254.28
Timer intervals configured, Hello 10, Dead 60, Wait 40, Retransmit 5
Hello due in 0:00:05
Neighbor Count is 8, Adjacent neighbor count is 2
Adjacent with neighbor 192.168.254.28 (Backup Designated Router)
Adjacent with neighbor 192.168.254.10 (Designated Router)
Table 4-3 show ip ospf interface Output
Field Description
Ethernet Status of physical link and operational status of protocol
Internet Address Interface IP address, subnet mask, and area address
AS Autonomous system number (OSPF process ID), router ID, network
type, link-state cost
Transmit Delay Transmit delay, interface state, and router priority
Designated Router Designated router ID and respective interface IP address
Backup Designated Router Backup designated router ID and respective interface IP address
Timer Intervals Configured Configuration of timer intervals
Hello Number of seconds until the next hello packet is sent out of this
interface
Neighbor Count Count of network neighbors and list of adjacent neighbors
Introducing OSPF 151
For more specific information about a given neighbor, use the same command, but specify the
address of a given neighbor. Example 4-5 shows how to get specific information for the neighbor
190.199.199.137.
Table 4-4 describes the significant fields for the show ip ospf neighbor command output.
Example 4-4 show ip ospf neighbor Command Output
RouterX# show ip ospf neighbor
ID Pri State Dead Time Address Interface
10.199.199.137 1 FULL/DR 0:00:31 192.168.80.37 FastEthernet0/0
172.16.48.1 1 FULL/DROTHER 0:00:33 172.16.48.1 FastEthernet0/1
172.16.48.200 1 FULL/DROTHER 0:00:33 172.16.48.200 FastEthernet0/1
10.199.199.137 5 FULL/DR 0:00:33 172.16.48.189 FastEthernet0/1
Example 4-5 show ip ospf neighbor Command Output for a Specific Neighbor
RouterX#show ip ospf neighbor 10.199.199.137
Neighbor 10.199.199.137, interface address 192.168.80.37
In the area 0.0.0.0 via interface Ethernet0
Neighbor priority is 1, State is FULL
Options 2
Dead timer due in 0:00:32
Link State retransmission due in 0:00:04
Neighbor 10.199.199.137, interface address 172.16.48.189
In the area 0.0.0.0 via interface Fddi0
Neighbor priority is 5, State is FULL
Options 2
Dead timer due in 0:00:32
Link State retransmission due in 0:00:03
Table 4-4 show ip ospf neighbor Output
Field Description
Neighbor Neighbor router ID.
Interface Address IP address of the interface.
In the Area Area and interface through which the OSPF neighbor is known.
Neighbor Priority Router priority of the neighbor, neighbor state.
State OSPF state.
State Changes Number of state changes since the neighbor was created. This value can
be reset using the clear ip ospf counters neighbor command.
DR Router ID of the designated router for the interface.
BDR Router ID of the backup designated router for the interface.
continues
152 Chapter 4: Single-Area OSPF Implementation
1 LLs = link-local signaling
2 OOB = out-of-band
3 NSF = nonstop forwarding
No comments:
Post a Comment