Sunday, April 26, 2009

IS-IS

Intermediate System-to-Intermediate System (IS-IS) is a link state routing protocol that is part of the OSI family of protocols. Like OSPF, it uses Dijkstra’s SPF algorithm to choose routes. IS-IS is a classless interior gateway protocol that uses router resources efficiently and scales to large networks, such as large Internet service providers (ISP). The following table lists some IS-IS terms, acronyms, and their meanings.


IS-IS Overview
Integrated IS-IS can carry IP network information, but does not use IP as its transport protocol. It uses OSI protocols CLNS and CLNP to deliver its updates. IS-IS sends its messages in PDUs. There are four IS-IS PDU types: Hello, LSP, PSNP, and CSNP.

Types of IS-IS Routers
Figure 4-1 shows an IS-IS network divided into areas. The IS-IS backbone is not a specific area, as in OSPF, but an unbroken chain of routers doing Level 2 routing. R3, R6, and R4 are the backbone in the following figure.

Within an area, routers can be one of three types:

Level 1 (L1) router
R1, R2, and R5 in the figure. Routes to networks only within the local area (intra-area routing). Uses a default route to the nearest Level 2 router for traffic bound outside
the area. Keeps one LSDB for the local area. When routing, compares the area of the destination to its area. If they are the same, routes based on system ID. If not, sends traffic to Level 1-2 router.

Level 2 (L2) router
R6 in the figure. Routes to networks in other areas (interarea routing). The routing is based on area ID. Keeps one LSDB for routing to other areas.

Level 1-2 (L1-2) router
R3 and R4 in this figure. Acts as a gateway into and out of an area. Does Level 1 routing within the area and Level 2 routing between areas. Keeps two LSDB: one for the local area and one for interarea routing.


NSAP Address Structure
In the Cisco implementation of integrated IS-IS, NSAP addresses have three parts: the area ID, the system ID, and the NSEL. They are written in hexadecimal and have a maximum size of 20 bytes.

Area IDs vary from 1 to 13 bytes. Those that begin with 49 designate private area addressing.
The Cisco system ID must be exactly six bytes. MAC addresses or IP addresses padded with 0s are often used as system IDs.
The NSEL is exactly one byte in size. A router always has a NSEL of 00.

Adjacency Formation in IS-IS
IS-IS routers form adjacencies based on the level of IS routing they are doing and their area number. This is a CLNS adjacency and can be formed even if IP addresses don’t match.

Level 1 routers form adjacencies only with L1 and L1-2 devices in their own area. (In Figure 4-1, R1 becomes adjacent with R2 and R3.)

Level 2 routers form adjacencies only with Level 2-capable devices (either L2 or L1-2 routers). These can be in the local area or in other areas. (In Figure 4-1, R6 becomes adjacent with R3 and R4.)

Level 1-2 routers form Level 1 adjacencies with L1 routers in their own area, and Level 2 adjacencies with routers in other areas. (In Figure 4-1, R4 has a L1 adjacency with R5 and a L2 adjacency with R6.)

Configuring IS-IS

The essential tasks to begin IS-IS routing are:

Enable IS-IS on the router:
Router(config)#router isis

Configure each router’s NET:
Router(config-router)#net 49.0010.1111.2222.3333.00

Enable IS-IS on the router’s interfaces:
Router(config)#interface s0/0/0
Router(config-int)#ip router isis


You may wish to do some tuning of IS-IS routing. Following are the tasks:

Set the IS level. Cisco routers are L1-2 by default. If the router is completely an internal area router, set the IS level to L1. If the router routes only to other areas and has no internal area interfaces, set the IS level to L2. If the router has both internal and external area interfaces, leave the IS level at L1-2.

Router(config-router)is-type {level-1 | level 1-2 | level-2-only}


Set the circuit type on L1-2 routers. On L1-2 routers, all interfaces send out both L1 and L2 hellos, trying to establish both types of adjacencies. This can waste bandwidth. If only an L1 router is attached to an interface, then change the circuit type for that interface to L1, so that only L1 hellos are sent. If there is only a L2 router attached to an interface, change the circuit type for that interface to L2:

Router(config-int)#isis circuit-type {level-1 | level 1-2 | level-2-only}


Summarize addresses. Although IS-IS does CLNS routing, it can summarize the IP addresses that it carries. Summarized routes can be designated as Level 1, Level 2, or Level 1-2 routes. The default is Level 2:

Router(config-router)#summary-address prefix mask [level-1 | level-2 | level-1-2]


Adjust the metric. IS-IS uses a metric of 10 for each interface. You can manually assign a metric that more accurately reflects the interface characteristics, such as bandwidth:

Router(config-int)#isis metric metric {level-1 | level-2}


Verifying and Troubleshooting IS-IS
Table 4-2 shows some IS-IS verification and troubleshooting commands, and describes the information you obtain from these commands.

Wednesday, April 15, 2009

Basic OSPF Configuration

OSPF is configured by entering router configuration mode and identifying the range of interface addresses on which it should run and the areas they are in. When setting up OSPF, a process ID must be used (8 is used in the example), but the process ID does not have to agree on different OSPF devices for them to exchange information. The network statement uses a wildcard mask and can specify any range from a single address to all addresses. Unlike EIGRP, the wildcard mask is not optional. The following example shows a router configured as an ABR. Interfaces falling with the 192.168.1.0 network are placed in area 0, and interfaces falling within the 172.16.1.0 network are placed in area 1.

Router(config)#router ospf 8
Router(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router(config-router)#network 172.16.1.0 0.0.0.255 area 1


Router ID
The SPF algorithm is used to map the shortest path between a series of nodes. This causes an issue with IP, because an IP router is not identified by a single IP address—its interfaces are. For this reason, a single IP address is designated as the “name” of the router—the RID.

By default, the RID is the highest loopback IP address. If no loopback addresses are configured, the RID is the highest IP address on an active interface when the OSPF process is started. The RID is selected when OSPF starts and—for reasons of stability—is not changed until OSPF restarts. The OSPF process can be restarted by rebooting or by using the command clear ip ospf process. Either choice affects routing in your network for a period of time and should be used only with caution.

A loopback interface is a virtual interface, so it is more stable than a physical interface for RID use. A loopback address is configured by creating an interface and assigning an IP address.

Router(config)#interface loopback0
Router(config-if)#ip address 10.0.0.1 255.255.255.255

The loopback address does not have to be included in the OSPF routing process, but if you advertise it, you are able to ping or trace to it. This can help in troubleshooting.

A way to override the default RID selection is to statically assign it using the OSPF router-id command.

Router(config)#router ospf 8
Router(config-router)#router-id 10.0.0.1


Troubleshooting OSPF
The neighbor initialization process can be viewed using the debug ip ospf adjacencies command. The neighbor table can be seen with show ip ospf neighbors, which also identifies adjacency status, and reveals the designated router and backup designated router. Use the debug ip ospf packet command to view all OSPF packets in real time.

Often, the first place OSPF issues are noticed is when inspecting the routing table—show ip route. To filter the routing table and show only the routes learned from OSPF, use show ip route ospf.

The command show ip protocols offers a wealth of information for any routing protocol issue. Use this command to verify parameters, timer values, identified networks, and OSPF neighbors (routing information sources).

Use show ip ospf to verify the RID, timers, and counters. Because wildcard masks sometimes incorrectly group interfaces to areas, another good place to check is show ip ospf interface. This shows the interfaces on which OSPF runs and their current correct assigned area.


OSPF Network Types
The SPF algorithm builds a directed graph—paths made up of a series of points connected by direct links. One of the consequences of this directed-graph approach is that the algorithm has no way to handle a multiaccess network, such as an Ethernet VLAN. The solution used by OSPF is to elect one router, called the Designated Router (DR), to represent the entire segment. Point-to-point links fit the SPF model perfectly and don’t need any special modeling method. On a point-topoint link, no DR is elected and all traffic is multicast to 224.0.0.5.

OSPF supports five network types:

NBMA—Default for multipoint serial interfaces. RFC-compliant mode that uses DRs and requires manual neighbor configuration.
Point-to–multipoint (P2MP)—Doesn’t use DRs so adjacencies increase logarithmically with routers. Resilient RFC compliant mode that automatically discovers neighbors.
Point-to-multipoint nonbroadcast (P2MNB)—Proprietary mode that is used on Layer 2 facilities where dynamic neighbor discovery is not supported. Requires manual neighbor configuration.
Broadcast—Default mode for LANs. Uses DRs and automatic neighbor discovery. Proprietary when used on WAN interface.
Point-to–point (P2P)—Proprietary mode that discovers neighbors and doesn’t require a DR.

If the default interface type is unsatisfactory, you can statically configure it with the command ip ospf network under interface configuration mode:

Router(config-if)#ip ospf network point-to-multipoint

When using the NBMA or P2MP nonbroadcast mode, neighbors must be manually defined under the routing process:

Router(config-router)#neighbor 172.16.0.1

Advanced OSPF Configuration

SPF provides many different ways to customize its operation to fit your network needs. This section discusses route summarization, default routes, stub areas, and virtual links.

OSPF Summarization
Summarization helps all routing protocols scale to larger networks, but OSPF especially benefits because its processes tax the memory and CPU resources of the routers. The SPF algorithm consumes all CPU resources when it runs. Summarization prevents topology changes from being passed outside an area and thus saves routers in other areas from
having to run the SPF algorithm. OSPF’s multiple databases use more memory the larger they are. Summarization decreases the number of routes exchanged, and thus the size of the databases. OSPF can produce summaries within a classful network (VLSM) or summaries of blocks of classful networks (CIDR). There are two types of summarizations:

Inter-area route summarizations are created on the ABR under the OSPF routing process using the area range command. The following command advertises 172.16.0.0/12 from area 1:

Router(config-router)#area 1 range 172.16.0.0 255.240.0.0

External route summarization is done on an ASBR using the summary-address command under the OSPF routing process. The following example summarizes a range of external routes to 192.168.0.0/16 and injects a single route into OSPF.

Router(config-router)#summary-address 192.168.0.0 255.255.0.0


Creating a Default Route

The default route is a special type of summarization; it summarizes all networks down to one route announcement. This provides the ultimate benefit of summarization by reducing routing information to a minimum. There are several ways to use the router IOS to place a default route into OSPF.

The best-known way to produce an OSPF default is to use the defaultinformation command under the OSPF routing process. This command, without the keyword always, readvertises a default route learned from another source into OSPF. If the always keyword is present, OSPF advertises a default even if one does not already exist in the routing table. The metric keyword sets the starting metric for this route.

Router(config-router)#default-information originate [always] [metric metric]

Alternatively, a default summary route can also be produced using the summary-address command or the area range command. These commands cause the router to advertise a default route pointing to itself.


Stub and Not-So-Stubby Areas

Another way to reduce the route information advertised is to make an area a stub area. Configuring an area as a stub area forces its ABR to drop all external (type 5) routes and replaces them with a default route. To limit routing information even more, an area can be made totally stubby using the no-summary keyword on the ABR only. In that case,
all interarea and external routes are dropped by the ABR and replaced by a default route. The default route starts with a cost of 1; to change it, use the area default-cost command. The example that follows shows area 2 configured as a totally stubby area, and the default route injected with a cost of 5:

Router(config-router)#area 2 stub no-summary
Router(config-router)#area 2 default-cost 5

Stub areas are attractive because of their low overhead. They do have some limitations, including the following:
Stub areas can’t include a virtual link.
Stub areas can’t include an ASBR.
Stubbiness must be configured on all routers in the area.

Another kind of stub area is a not-so-stubby area (NSSA). NSSA is like a stub or totally stub area, but allows an ASBR within the area. External routes are advertised as type 7 routes by the ASBR. The ABR converts them to type 5 external routes when it advertises them into adjacent areas. NSSA is configured with the area nssa command under the OSPF routing process. The no-summary keyword on the ABR configures the area as a totally NSSA area; this is a Cisco proprietary feature. By default, the ABR does not inject a default route back into an NSSA area. Use the default-information-originate keyword on the ABR or ASBR to create this route.

Router(config-router)#area 7 nssa [no-summary] [defaultinformation-originate]


Configuring Virtual Links
OSPF requires that all areas be connected to area 0 and that area 0 must be contiguous. When this is not possible, you can use a virtual link to bridge across an intermediate area. Figure 3-3 shows a virtual link connecting two portions of area 0.

Tuesday, April 7, 2009

OSPF


OSPF is an open-standard, classless routing protocol that converges quickly and uses cost as a metric (Cisco IOS automatically associates cost with bandwidth).

OSPF is a link-state routing protocol and uses Dijkstra’s Shortest Path First (SPF) algorithm to determine its best path to each network. The first responsibility of a link-state router is to create a database that reflects the structure of the network. Link state routing protocols learn more information on the structure of the network than other routing protocols, and thus are able to make more informed routing decisions.

OSPF routers exchange hellos with each neighbor, learning Router ID (RID) and cost. Neighbor information is kept in the adjacency database.

The router then constructs the appropriate Link State Advertisements (LSA), which include information such as the RIDs of, and cost to, each neighbor. Each router in the routing domain shares its LSAs with all other routers. Each router keeps the complete set of LSAs in a table—the Link State Database (LSDB).

Each router runs the SPF algorithm to compute best paths. It then submits these paths for inclusion in the routing table, or forwarding database.

OSPF Network Structure
OSPF routing domains are broken up into areas. An OSPF network must contain an area 0, and may contain other areas. The SPF algorithm runs within an area, and inter-area routes are passed between areas. A two-level hierarchy to OSPF areas exists; area 0 is designed as a transit area, and other areas should be attached directly to area 0 and only to area 0. The link-state database must be identical for each router in an area. OSPF areas typically contain a maximum of 50–100 routers, depending on network volatility. Figure 3-1 shows a network of five routers that has been divided into three areas: area 0, area 1, and area 2.

Dividing an OSPF network into areas does the following:
Minimizes the number of routing table entries.
Contains LSA flooding to a reasonable area.
Minimizes the impact of a topology change.
Enforces the concept of a hierarchical network design.

OSPF defines router roles as well. One router can have multiple roles.

An internal router has all interfaces in one area. In Figure 3-1, R1, R2, and R5 are all internal area routers.
Backbone routers have at least one interface assigned to area 0. R3, R4, and R5 are backbone routers.
An Area Border Router (ABR) has interfaces in two or more areas. In Figure 3-1, R3 and R4 are ABRs.
An Autonomous System Boundary Router (ASBR) has interfaces inside and outside the OSPF routing domain. In Figure 3-1, R3 also functions as an ASBR because it has an interface in an EIGRP routing domain.

OSPF Metric
By default, Cisco assigns a cost to each interface that is inversely proportional to 100 Mbps. The cost for each link is then accrued as the route advertisement for that link traverses the network. Figure 3-2 shows the default OSPF formula.
LSAs
Each router maintains a database of the latest received LSAs. Each LSA is numbered with a sequence number, and a timer is run to age out old LSAs.

When a LSA is received, it’s compared to the LSDB. If it is new, it is added to the database and the SPF algorithm is run. If it is from a Router ID that is already in the database, then the sequence number is compared, and older LSAs are discarded. If it is a new LSA, it is incorporated in the database, and the SPF algorithm is run. If it is an older LSA, the newer LSA in memory is sent back to whoever sent the old one.

OSPF sequence numbers are 32 bits. The first legal sequence number is 0x80000001. Larger numbers are more recent. The sequence number changes only under two conditions:

The LSA changes because a route is added or deleted.
The LSA ages out (LSAs are updated every half hour, even if nothing changes).

The command show ip ospf database shows the age (in seconds) and sequence number for each RID.

LSDB Overload Protection
Because each router sends an LSA for each link, routers in large networks may receive—and must process—numerous LSAs. This can tax the router’s CPU and memory resources, and adversely affect its other functions. You can protect your router by configuring OSPF LSDB overload protection. LDSB overload protection monitors the number of LSAs received and placed into the LSDB. If the specified threshold is exceeded for one minute, the router enters the “ignore” state by dropping all adjacencies and clearing the OSPF database. The router resumes OSPF operations after things have been normal for a specified period. Be careful when using this command, as it disrupts routing when invoked.

LSA Types
OSPF uses different types of LSAs to advertise different types of routes, such as internal area or external routing domain. Many of these are represented in the routing table with a distinctive prefix. Table 3-1 describes these LSA types.

OSPF Operation

OSPF uses several different message types to establish and maintain its neighbor relationships, and to maintain correct routing information. When preparing for the exam, be sure you understand each OSPF packet type, and the OSPF neighbor establishment procedure.

OSPF Packets
OSPF uses five packet types. It does not use UDP or TCP for transmitting its packets. Instead, it runs directly over IP (IP protocol 89) using an OSPF header. One field in this header identifies the type of packet being carried. The five OSPF packet types are:

Hello—Identifies neighbors and serves as a keepalive.
Link State Request (LSR)—A request for an Link State Update (LSU). Contains the type of LSU requested and the ID of the router requesting it.
Database Description (DBD)—A summary of the LSDB, including the RID and sequence number of each LSA in the LSDB.
Link State Update (LSU)—Contains a full LSA entry. An LSA includes topology information; for example, the RID of this router and the RID and cost to each neighbor. One LSU can contain multiple LSAs.
Link State Acknowledgment (LSAck)—Acknowledges all other OSPF packets (except hellos).

OSPF traffic is multicast to either of two addresses: 224.0.0.5 for all OSPF routers or 224.0.0.6 for all OSPF DRs.

OSPF Neighbor Relationships
OSPF routers send out periodic multicast packets to introduce themselves to other routers on a link. They become neighbors when they see their own router ID included in the Neighbor field of the hello from another router. Seeing this tells each router that they have bidirectional communication. In addition, two routers must be on a common subnet for a neighbor relationship to be formed. (Virtual links are sometimes an exception to this rule.)

Certain parameters within the OSPF hellos must also match in order for two routers to become neighbors. They include:
Hello/dead timers
Area ID
Authentication type and password
Stub area flag

OSPF routers can be neighbors without being adjacent. Only adjacent neighbors exchange routing updates and synchronize their databases. On a point-to-point link, an adjacency is established between the two routers when they can communicate. On a multiaccess link, each router establishes an adjacency only with the DR and the backup DR (BDR).

Hellos also serve as keepalives. A neighbor is considered lost if no Hello is received within four Hello periods (called the dead time). The default hello/dead timers are as follows:

10 seconds/40 seconds for LAN and point-to-point interfaces
30 seconds/120 seconds for nonbroadcast multiaccess (NBMA)

OSPF Operation

OSPF uses several different message types to establish and maintain its neighbor relationships, and to maintain correct routing information. When preparing for the exam, be sure you understand each OSPF packet type, and the OSPF neighbor establishment procedure.

OSPF Packets
OSPF uses five packet types. It does not use UDP or TCP for transmitting its packets. Instead, it runs directly over IP (IP protocol 89) using an OSPF header. One field in this header identifies the type of packet being carried. The five OSPF packet types are:

Hello—Identifies neighbors and serves as a keepalive.
Link State Request (LSR)—A request for an Link State Update (LSU). Contains the type of LSU requested and the ID of the router requesting it.
Database Description (DBD)—A summary of the LSDB, including the RID and sequence number of each LSA in the LSDB.
Link State Update (LSU)—Contains a full LSA entry. An LSA includes topology information; for example, the RID of this router and the RID and cost to each neighbor. One LSU can contain multiple LSAs.
Link State Acknowledgment (LSAck)—Acknowledges all other OSPF packets (except hellos).

OSPF traffic is multicast to either of two addresses: 224.0.0.5 for all OSPF routers or 224.0.0.6 for all OSPF DRs.

OSPF Neighbor Relationships
OSPF routers send out periodic multicast packets to introduce themselves to other routers on a link. They become neighbors when they see their own router ID included in the Neighbor field of the hello from another router. Seeing this tells each router that they have bidirectional communication. In addition, two routers must be on a common subnet for a neighbor relationship to be formed. (Virtual links are sometimes an exception to this rule.)

Certain parameters within the OSPF hellos must also match in order for two routers to become neighbors. They include:
Hello/dead timers
Area ID
Authentication type and password
Stub area flag

OSPF routers can be neighbors without being adjacent. Only adjacent neighbors exchange routing updates and synchronize their databases. On a point-to-point link, an adjacency is established between the two routers when they can communicate. On a multiaccess link, each router establishes an adjacency only with the DR and the backup DR (BDR).

Hellos also serve as keepalives. A neighbor is considered lost if no Hello is received within four Hello periods (called the dead time). The default hello/dead timers are as follows:

10 seconds/40 seconds for LAN and point-to-point interfaces
30 seconds/120 seconds for nonbroadcast multiaccess (NBMA)