Nov 22, 2011

Abstract of CCNA study guide-27 - OSPF 1


Open Shortest Path First (OSPF) Basics
Open Shortest Path First (OSPF) is an open standard routing protocol that’s been implemented by a wide variety of network vendors, including Cisco. If you have multiple routers and not all of them are Cisco (what!), then you can’t use EIGRP, can you? So your remaining CCNA objective options are basically RIP, RIPv2, and OSPF. If it’s a large network, then, really, your only options are OSPF.

OSPF works by using the Dijkstra algorithm. First, a shortest path tree is constructed, and then the routing table is populated with the resulting best paths. OSPF converges quickly, although perhaps not as quickly as EIGRP, and it supports multiple, equal-cost routes to the same destination. Like EIGRP, it does support both IP and IPv6 routed protocols.

OSPF provides the following features:
-        Consists of areas and autonomous systems
-        Minimizes routing update traffic
-        Allows scalability
-        Supports VLSM/CIDR
-        Has unlimited hop count
-        Allows multi-vendor deployment (open standard)

OSPF is the first link-state routing protocol that most people are introduced to.
TABLE 7.3 OSPF and RIP Comparison
Characteristic
OSPF
RIPv2
RIPv1
Type of protocol
Link state
Distance vector
Distance vector
Classless support
Yes
Yes
No
VLSM support
Yes
Yes
No
Auto-summarization
No
Yes
Yes
Manual summarization
Yes
No
No
Discontiguous support
Yes
Yes
No
Route propagation
Multicast on change
Periodic multicast
Periodic broadcast
Path metric
Bandwidth
Hops
Hops
Hop count limit
None
15
15
Convergence
Fast
Slow
Slow
Peer authentication
Yes
Yes
No
Hierarchical network
Yes (using areas)
No (flat only)
No (flat only)
Updates
Event triggered
Route table updates
Route table updates
Route computation
Dijkstra
Bellman-Ford
Bellman-Ford

OSPF is designed in a hierarchical fashion, which basically means that you can separate the larger internetwork into smaller internetworks called areas. This is the best design for OSPF.
The following are reasons for creating OSPF in a hierarchical design:
-        To decrease routing overhead
-        To speed up convergence
-        To confine network instability to single areas of the network

Figure 7.4 shows a typical OSPF simple design.
-        Notice how each router connects to the backbone called area 0, or the backbone area. OSPF must have an area 0, and all other areas should connect to this area.
-        Routers that connect other areas to the backbone area within an AS are called Area Border Routers (ABRs). Still, at least one interface of the ABR must be in area 0.


-        OSPF runs inside an autonomous system, but it can also connect multiple autonomous systems together. The router that connects these ASes is called an Autonomous System Boundary Router (ASBR).

OSPF Terminology
Link A link is a network or router interface assigned to any given network.
Router ID (RID) is an IP address used to identify the router.  the Router ID assigned using the highest IP address of all configured loopback interfaces. If no loopback interfaces are configured, OSPF will choose the highest IP address of all active physical interfaces.

Neighbor : Neighbors are two or more routers that have an interface on a common network, such as two routers connected on a point-to-point serial link.

Adjacency : is a relationship between two OSPF routers that permits the direct exchange of route updates.

Hello protocol : provides dynamic neighbor discovery and maintains neighbor relationships.

Neighborship database: is a list of all OSPF routers for which Hello packets have been seen.

Topological database :contains information from all of the Link State Advertisement packets that have been received for an area.

Link State Advertisement (LSA) is an OSPF data packet containing link-state and routing information that’s shared among OSPF routers.

Designated router (DR) is elected whenever OSPF routers are connected to the same multi-access network. Cisco likes to call these “broadcast” networks

Backup designated router (BDR) is standby for the DR on multi-access link. The BDR receives all routing updates from OSPF adjacent routers but doesn’t flood LSA updates.

OSPF areas is a grouping of contiguous networks and routers. All routers in the same area share a common Area ID

Broadcast (multi-access) such as Ethernet allow multiple devices to connect to (or access) the same network as well as provide a broadcast ability in which a single packet is delivered to all nodes on the network. In OSPF, a DR and a BDR must be elected for each broadcast multi-access network.

Non-broadcast multi-access: (NBMA) networks are types such as Frame Relay, X.25, and Asynchronous Transfer Mode (ATM). These networks allow for multi-access but have no broadcast ability like Ethernet. So, NBMA networks require special OSPF configuration to function properly and neighbor relationships must be defined.

Point-to-point : refers to a type of network topology consisting of a direct connection between two routers that provides a single communication path. This type of configuration eliminates the need for DRs or
BDRs—but neighbors are discovered automatically.

Point-to-multipoint : refers to a type of network topology consisting of a series of connections between a single interface on one router and multiple destination routers.
As with point-to-point, no DRs or BDRs are needed.

SPF Tree Calculation
Within an area, each router calculates the best/shortest path to every network in that same area. This calculation is based upon the information collected in the topology database and an algorithm called shortest path first (SPF).
each router in an area constructing a tree where the router is the root and all other networks are arranged
along the branches and leaves. This is the shortest path tree used by the router to insert routes into the routing table.
It’s important to understand that this tree contains only networks that exist in the same area as the router itself does. If a router has interfaces in multiple areas, then separate trees will be constructed for each area.

OSPF uses a metric referred to as cost. The cost of the entire path is the sum of the costs of the outgoing interfaces along the path.
Cisco uses a simple equation of    10^8  / bandwidth. The bandwidth is the configured bandwidth for the interface.
Using this rule, a 100Mbps Fast Ethernet interface would have a default OSPF cost of 1 and a 10Mbps Ethernet interface would have a cost of 10.An interface set with a bandwidth of 64,000 would have a default cost of 1,563.
This value may be overridden by using the ip ospf cost command. The cost is manipulated by changing the value to a number within the range of 1 to 65,535. Because the cost is assigned to each link, the value must be changed on the interface that you want to change the cost.

Abstract of CCNA study guide-26 - EIGRP 2


Configuring EIGRP
To start an EIGRP session on a router, use the router eigrp command followed by the autonomous system number of your network.
Then use the network command followed by the network numbers connected to the router.

Example of enabling EIGRP for autonomous system 20 on a router connected to two networks, with the network numbers being 10.3.1.0/24 and 172.16.10.0/24:
Router#config t
Router(config)#router eigrp 20
Router(config-router)#network 172.16.0.0
Router(config-router)#network 10.0.0.0

Remember—as with RIP, you use the classful network address, which is all subnet and host bits turned off.
Understand that the AS number is the same in  all routers , You can use any number from 1 to 65,535.

If you need to stop EIGRP from working on a specific interface, such as a BRI interface or a serial connection to the Internet.  you would flag the interface as passive using the passive-interface interface command:

Router(config)#router eigrp 20
Router(config-router)#passive-interface serial 0/1

Doing this will prohibit the interface from sending or receiving Hello packets and, This means that it won’t send or receive route information on this interface.

Ex.
Corp#config t
Corp(config)#router eigrp ?
<1-65535> Autonomous system number
Corp(config)#router eigrp 10
Corp(config-router)#network 10.0.0.0

As with RIPv1,you still need to add the classful network numbers you want to advertise. But unlike RIP,
EIGRP uses classless routing—but you still configure it as classful. Classless, which I’m sure
you remember, means that the subnet mask information is sent along with routing protocol
updates (RIPv2 is classless).

Configuring Discontiguous Networks
Remember first Figure and how it demonstrated how EIGRP would auto-summarize the boundaries on a discontiguous network? Take a look at that figure again, Both routers, by default, would automatically summarize the classful boundaries and routing would not work. Here’s the configuration that would make this network work:
Lab_A#config t
Lab_A(config)#router eigrp 100
Lab_A(config-router)#network 172.16.0.0
Lab_A(config-router)#network 10.0.0.0
Lab_A(config-router)#no auto-summary
Lab_B#config t
Lab_B(config)#router eigrp 100
Lab_B(config-router)#network 172.16.0.0
Lab_B(config-router)#network 10.0.0.0
Lab_B(config-router)#no auto-summary
Because I used the no auto-summary command, EIGRP will advertise all the subnets between the two routers.
Load Balancing with EIGRP
By default, EIGRP can load-balance up to four equal-cost links. And we can configure EIGRP to load-balance across up to six equal-/unequal cost.

First, let’s take a look at the R1 routing table and make sure that EIGRP has already found both links between the routers:
R1#sh ip route
10.0.0.0/24 is subnetted, 12 subnets
D                     10.1.11.0 [90/2684416] via 10.1.3.1, 00:50:37, Serial0/0/1
    [90/2684416] via 10.1.2.1, 00:50:37, Serial0/0/0
D                      10.1.9.0 [90/2707456] via 10.1.3.1, 01:24:09, Serial0/0/1
  [90/2707456] via 10.1.2.1, 01:24:09, Serial0/0/0
D                      10.1.8.0 [90/2707456] via 10.1.3.1, 01:24:09, Serial0/0/1
  [90/2707456] via 10.1.2.1, 01:24:09, Serial0/0/0
D                       10.1.12.0 [90/2684416] via 10.1.3.1, 00:10:10, Serial0/0/1
     [90/2684416] via 10.1.2.1, 00:10:10, Serial0/0/0
C                       10.1.3.0 is directly connected, Serial0/0/1
C                      10.1.2.0 is directly connected, Serial0/0/0

You can see that we have two links to every route in our internetwork, and again, EIGRP will load balance across the s0/0/0 and s0/0/1 links by default because they’re the same metric.
EIGRP is automatic load balancing. But how about bundling links? Well, EIGRP can allow us to do this too—even with no extra configuration! Let me show you how this works. I’m going to configure the links between our Corp and R1 routers with the same subnet, meaning both links will have all interfaces within the same subnet. Check out my configuration:

Corp#config t
Corp(config)#int s0/0/1
Corp(config-if)#ip address 10.1.2.4 255.255.255.0
R1#config t
R1(config)#int s0/0/1
R1(config-if)#ip address 10.1.2.3 255.255.255.0
R1(config-if)#do show run | begin interface
interface Serial0/0/0
description 1st Connection to Corp Router
ip address 10.1.2.2 255.255.255.0
!
interface Serial0/0/1
description 2nd connection to Corp Router
ip address 10.1.2.3 255.255.255.0
Now both links have all four interfaces in the same subnet.
R1(config-if)#do show ip route
10.0.0.0/24 is subnetted, 12 subnets
D         10.1.11.0 [90/2684416] via 10.1.2.4, 00:04:44, Serial0/0/1
   [90/2684416] via 10.1.2.1, 00:04:44, Serial0/0/0
D         10.1.10.0 [90/2707456] via 10.1.2.4, 00:04:44, Serial0/0/1
   [90/2707456] via 10.1.2.1, 00:04:44, Serial0/0/0
D         10.1.9.0 [90/2707456] via 10.1.2.4, 00:04:44, Serial0/0/1
 [90/2707456] via 10.1.2.1, 00:04:44, Serial0/0/0
D         10.1.8.0 [90/2707456] via 10.1.2.4, 00:04:44, Serial0/0/1
 [90/2707456] via 10.1.2.1, 00:04:44, Serial0/0/0
D         10.1.12.0 [90/2684416] via 10.1.2.4, 00:04:44, Serial0/0/1
  [90/2684416] via 10.1.2.1, 00:04:44, Serial0/0/0
C          10.1.2.0 is directly connected, Serial0/0/0
 is directly connected, Serial0/0/1
D         10.1.1.0 [90/2172416] via 10.1.2.4, 00:03:56, Serial0/0/1
[90/2172416] via 10.1.2.1, 00:03:56, Serial0/0/0
C          10.1.7.0 is directly connected, FastEthernet0/1

There are  two changes  in the routing table now? Networks 10.1.2.0 and 10.1.3.0 used to show up as individual, directly connected interfaces, but not anymore. Now only the 10.1.2.0 network shows up as two directly connected interfaces, and the router now has a 3MB pipe through that line instead of just two 1.5Mbps T1 links.

Verifying EIGRP
There are several commands can be used  to help you troubleshoot and verify the EIGRP configuration:

Next TABLE  EIGRP Troubleshooting Commands
Command
Description/Function
show ip route
Shows the entire routing table
show ip route eigrp
Shows only EIGRP entries in the routing table
show ip eigrp neighbors
Shows all EIGRP neighbors
show ip eigrp topology
Shows entries in the EIGRP topology table
debug eigrp packet
Shows Hello packets sent/received between adjacent routers
Debug ip eigrp notification
Shows EIGRP changes and updates

The following router output is from the Corp router in our example:
Show ip eigrp neighbors command:
Corp#sh ip eigrp neighbors
IP-EIGRP neighbors for process 10
H         Address           Interface          Hold Uptime    SRTT   RTO     Q         Seq
   (sec)               (ms)                Cnt       Num
1          10.1.3.2           Se0/0/1            14 00:35:10        1        200      0          81
2          10.1.4.2           Se0/1/0            13 03:17:20        1         200     0          20
0          10.1.2.2           Se0/0/0            10 03:19:37        1        200      0          80

We read the information in this output like this:
-    The H field: the order in which the neighbor was discovered.
-    The hold time: how long this router will wait for a Hello packet to arrive from a specific neighbor.
-    The uptime: how long the neighborship has been established.
-    The SRTT field: the smooth round-trip timer—an indication of the time it takes for a round-trip from this router to its neighbor and back.

The time between multicast attempts is specified by…
-    The Retransmission Time Out (RTO) field: the amount of time EIGRP waits before retransmitting a packet to a neighbor.
-    The Q value: indicates whether there are any outstanding messages in the queue.
-    The Seq field: indicates the sequence number of the last update from that neighbor.

The show ip eigrp neighbors command allows you to check the IP addresses ,the retransmit interval and queue counts for the neighbors that have established an adjacency.

show ip eigrp topology command :
Corp#sh ip eigrp topology
IP-EIGRP Topology Table for AS(10)/ID(10.1.5.1)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P          10.1.11.0/24, 1 successors, FD is 2172416 via 10.1.5.2 (2172416/28160), Serial0/2/0
P          10.1.12.0/24, 1 successors, FD is 2172416 via 10.1.5.2 (2172416/28160), Serial0/2/0
P          10.1.3.0/24, 1 successors, FD is 76839936 via Connected, Serial0/0/1
   via 10.1.2.2 (9849856/7719936), Serial0/0/0
P          10.1.2.0/24, 1 successors, FD is 2169856 via Connected, Serial0/0/0
             via 10.1.2.2 (2681856/551936), Serial0/0/0
P          10.1.1.0/24, 1 successors, FD is 28160 via Connected, FastEthernet0/1

Notice that every route is preceded by a P. This means that the route is in the passive state, which is a good thing because routes in the active state (A) indicate that the router has lost its path to this network and is searching for a replacement.
Each entry indicates the feasible distance (FD), to each remote network plus the next-hop neighbor.
Plus, each entry also has two numbers in parentheses. The first indicates the feasible distance, and the second the advertised distance to a remote network.
Now here’s where things get interesting—notice that under the 10.1.7.0 and 10.1.6.0 outputs there are two links to each network and that the feasible distance and advertised distance are different. What this means is that we have one successor to the networks and one feasible successor (a backup route)remember that even though both routes to network 10.1.6.0 and 10.1.7.0 are in the topology table, only the successor route (the one
with the lowest metrics) will be copied and placed into the routing table.

EIGRP will load-balance across both links automatically when they are of equal variance (equal
cost), but EIGRP can also load-balance across unequal-cost links as well if we use the variance
command. The variance metric is set to 1 by default you can change the metric anywhere up to 128.

if the variance is set to 1, only routes with the same metric as the successor will be installed in the local routing table. And, if the variance is set to 2, any EIGRP learned route with a metric less than two times the successor metric will be installed in the local routing table (if it is already a feasible successor).

Debug eigrp packet command :that will show our Hello packets being sent between neighbor routers:
Corp#debug eigrp packet
EIGRP Packets debugging is on
(UPDATE, REQUEST, QUERY, REPLY, HELLO, IPXSAP, PROBE, ACK, STUB,
SIAQUERY, SIAREPLY)
Corp#
*Mar 21 23:17:35.050: EIGRP: Sending HELLO on FastEthernet0/1
*Mar 21 23:17:35.050: AS 10, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0

debug ip eigrp notification command :this command’s output shouldn’t show you anything at all! That’s right—the only time you’ll see output from this command is if there’s a problem on your network or you’ve added or deleted a network from a router