Thứ Bảy, 8 tháng 2, 2014

Tài liệu Configuring Advanced Routing Protocols doc

Metric Structure
Unlike RIP, which uses hop count as a metric, OSPF uses cost. Cost is actually the
inverse of the bandwidth of a link: the faster the speed of the connection, the lower
the cost. The most preferred path is the one with the lowest cost. By using cost as a
metric, OSPF will choose more intelligent paths than RIP.
Remember that on synchronous serial links, no matter what the clock rate of the
physical link is, the bandwidth always defaults to 1544 Kbps. You’ll want to code this
correctly with the bandwidth Interface Subconfiguration mode command. This is
important if you have multiple synchronous serial paths to a destination, especially if
they have different clock rates. OSPF supports load balancing of up to six equal-cost
paths to a single destination. However, if you don’t configure the bandwidth metric
correctly on your serial interfaces, your router might accidentally include paths with
different clock rates, which can cause load-balancing issues.
For example, if you have one serial connection clocked at 1,544 Kbps and another
clocked at 256 Kbps and you don’t change the bandwidth values, OSPF will see both
connections as 1,544 Kbps and attempt to use
both when reaching a single destination. This
can create throughput problems when the router
is performing load balancing—half of the traffic
will go down one link and half down the other,
creating congestion problems.
Router Identities
Each router in an OSPF network needs a unique ID. The ID is used to provide a unique
identity to the OSPF router. This is included in any OSPF messages the router generates.
The router ID is chosen according to one of the two following criteria:

The highest IP address on its loopback interfaces (this is a logical interface on
a router)

The highest IP address on its active interfaces
If you have an IP address on an active loopback
interface, the router will use the highest IP address
from the bunch for its router ID. The router ID is
used by the router to announce itself to the other
OSPF routers in the network. This ID must
be unique. If you have no loopback interfaces
OSPF
5
CertPrs8 / CCNA Cisco Certified Network Associate Study Guide / Deal / 222934-9 / Chapter 11
OSPF uses cost as a metric,
which is the inverse of the bandwidth of
a link.
Remember how a router
acquires its router ID for OSPF.
D:\omh\CertPrs8\934-9\ch11.vp
Monday, August 04, 2003 12:13:42 PM
Color profile: Generic CMYK printer profile
Composite Default screen
configured, then the router will use the highest IP address from one of its physical
interfaces. If there is no active interface, the OSPF process will not start and
therefore you will not have any OSPF routes in your routing table. It is highly
recommended that you use a loopback interface because it is always up and thus
the router can obtain a router ID.
Finding Neighbors
OSPF learns about its neighbors and builds its adjacency and topology tables by sharing
LSAs. There are different types of LSAs. When learning about the neighbors that a
router is connected to, as well as keeping tabs on known neighbors, OSPF routers will
generate hello LSAs every 10 seconds. When a neighbor is discovered and an adjacency
is formed with the neighbor, a router expects to see hello messages from the neighbor. If
a neighbor is not seen within the dead interval time, which defaults to 40 seconds, the
neighbor is declared dead. When this occurs, the router will advertise this information,
via an LSA message, to other neighboring OSPF routers.
Whereas RIP accepts routing updates from just about any other RIP router, OSPF
has some rules concerning if and how routing information should be shared. First,
before a router will accept any routing information from another OSPF router, they
have to build an adjacency with each other on their connected interfaces. When this
adjacency is built, the two routers (on the connected interfaces) are called neighbors,
which indicates a special relationship between the two. In order for two routers to
become neighbors, the following must match on each router:

The area number and its type

The hello and dead interval timers

The OSPF password (optional), if it is configured

The area stub flag (used to contain OSPF messages and routing information,
this is beyond the scope of this book)
If these items do not match, then the routers will not form an adjacency and will
ignore each other’s routing information.
Let’s assume that you turned on all your routers simultaneously on a segment. In
this case, the OSPF routers will go through three states called the exchange process:
1. Down state The new router has not exchanged any OSPF information with
any other router.
2. Init state A destination router has received a new router's hello and adds it to
its neighbor list (assuming that certain values match). Note that communication
is only unidirectional at this point.
6
Chapter 11: Configuring Advanced Routing Protocols
CertPrs8 / CCNA Cisco Certified Network Associate Study Guide / Deal / 222934-9 / Chapter 11
D:\omh\CertPrs8\934-9\ch11.vp
Monday, August 04, 2003 12:13:42 PM
Color profile: Generic CMYK printer profile
Composite Default screen
3. Two-Way state The new router receives a unidirectional reply to its initial
hello packet and adds the destination router to its neighbor database.
Once the routers have entered a two-way state, they are considered neighbors. At
this point, an election process takes place to elect the designated router (DR) and
the backup designated router (BDR).
Designated and Backup Designated Routers
An OSPF router will not form adjacencies to just any router. Instead, a client/server
design is implemented in OSPF. For each network multi-access segment, there is a DR
and a BDR as well as other routers. As an example, if you have ten VLANs in your
switched area, you’ll have ten DRs and ten BDRs. The one exception of a segment
not having these two routers is on a WAN point-to-point link.
When an OSPF router comes up, it forms adjacencies with the DR and the BDR
on each multi-access segment that it is connected to. Any exchange of routing
information is between these DR/BDR routers and the other OSPF neighbors on
a segment (and vice versa). An OSPF router talks to a DR using the IP multicast
address of 224.0.0.6. The DR and the BDR talk to all routers using the 224.0.0.5
multicast IP address.
The OSPF router with the highest priority becomes the DR for the segment. If
there is a tie, the router with the highest router ID will become the DR. By default,
all routers have a priority of 1 (priorities can range 0–255). If the DR fails, the BDR
is promoted to DR and another router is elected as the BDR. Figure 11-2 shows an
example of the election process, where router E is elected as the DR and router B,
the BDR.
OSPF
7
CertPrs8 / CCNA Cisco Certified Network Associate Study Guide / Deal / 222934-9 / Chapter 11
OSPF routers use
Link State Advertisements (LSAs) to
communicate with each other. One type
of LSA is a hello, which is used to form
neighbor relationships and as a keep-alive
function. Hellos are generated every ten
seconds. When sharing link information
(directly connected routes), links are sent
to the DR (224.0.0.6) and the DR
disseminates this to everyone (224.0.0.5)
else on the segment. The router with the
highest priority (or highest router ID)
becomes the DR. This process is true
for multi-access segments, but not
point-to-point links, where DRs are
not necessary.
D:\omh\CertPrs8\934-9\ch11.vp
Monday, August 04, 2003 12:13:42 PM
Color profile: Generic CMYK printer profile
Composite Default screen
Sharing Routing Information
After electing the DR/BDR pair, the routers continue to generate hellos to maintain
communication. This is considered an exstart state, in which the OSPF routers are
ready to share link state information. The process the routers go through is called an
exchange protocol:
1. Exstart state The DR and BDR form adjacencies with the other OSPF
routers on the segment, and then within each adjacency, the router with the
highest router ID becomes the master and starts the exchange process first
(shares its link state information)—note that the DR is not necessarily the
master for the exchange process. The remaining router in the adjacency will
be the slave.
2. Exchange state The master starts sharing link state information first, with
the slave. These are called DBDs (database description packets), also referred
to as DDPs. The DBDs contain the link-state type, the ID of the advertising
router, the cost of the advertised link, and the sequence number of the link.
The slave responds back with an LSACK—an acknowledgment to the DBD
from the master. The slave then compares the DBD's information with its own.
3. Loading state If the master has more up-to-date information than the slave,
the slave will respond to the master's original DBD with an LSR (Link State
Request). The master will then send a LSU (Link State Update) with the
detailed information of the links to the slave. The slave will then incorporate
this into its local link state database. Again, the slave will generate an LSACK
8
Chapter 11: Configuring Advanced Routing Protocols
CertPrs8 / CCNA Cisco Certified Network Associate Study Guide / Deal / 222934-9 / Chapter 11
FIGURE 11-2
DR and BDR
election process
D:\omh\CertPrs8\934-9\ch11.vp
Monday, August 04, 2003 12:13:42 PM
Color profile: Generic CMYK printer profile
Composite Default screen
to the master to acknowledge the fact that it received the LSU. If a slave has
more up-to-date information, it will repeat the "exchange" and "loading" states.
4. Full state Once the master and the slave are synchronized, they are considered
to be in a full state.
To summarize these four steps, OSPF routers share a type of LSA message in order
to disclose information about available routes. Basically, an LSA update message
contains a link and a state, as well as other information. A link is the router interface
on which the update was generated (a connected route). The state is a description of
this interface, including the IP address configured on it as well as the relationship this
router has with its neighboring router. However, OSPF routers will not share this
information with just any OSPF router.
OSPF uses incremental updates after entering a full state. This means that
whenever changes take place, only the change is shared with the DR, which will
then share this information with other routers on the segment. Figure 11-3 shows
an example of this. In this example, Network Z, connected to router C, goes down.
Router C sends a multicast to the DR and the BDR (with a destination multicast
address of 224.0.0.6), telling them about this change. Once the DR and the BDR
incorporate the change internally, the DR then tells the other routes on the
segment (via a multicast message sent to 224.0.0.5, which is all OSPF routers)
about the change concerning Network Z. Any router receiving the update will
then share this update to the DRs of other segments that they are connected to.
Note that the communications between OSPF routers is connection-oriented, even
though multicasts are used. For example, if a router tells a DR about a change, the
DR acknowledges this new piece of information. Likewise, when the DR shares this
information with the other routers on the segment, the DR expects acknowledgments
back from each of these neighbors. Remember that when an OSPF router exchanges
OSPF
9
CertPrs8 / CCNA Cisco Certified Network Associate Study Guide / Deal / 222934-9 / Chapter 11
OSPF routers share
information about their connected routes
with the DR, which includes the link-state
type, the ID of the advertising router,
the cost of the advertised link, and the
sequence number of the link. This is
different from distance vector protocols.
Distance vector protocols share their
entire routing table with their neighbors
with the exception of routes learned
from the same interface of the neighbor
(split horizon) and the connected route
of the interface where the neighbor
resides.
D:\omh\CertPrs8\934-9\ch11.vp
Monday, August 04, 2003 12:13:42 PM
Color profile: Generic CMYK printer profile
Composite Default screen
updates with another, the process requires an acknowledgment: this ensures that router
or routers have received the update.
The exception to the incremental update process is that the DR floods its
database every 30 minutes to ensure that all of the routers on the segment have
the most up-to-date link state information.
It does this with a destination address of
224.0.0.5 (all OSPF routers on the segment).
When building the routing table using link
state information, an OSPF router can keep up
to six paths to a destination in its routing table.
The only restriction is that the paths must have
the same cost.
Configuring OSPF
Configuring OSPF is slightly different from configuring RIP or IGRP. When configuring
OSPF, use the following syntax:
Router(config)# router ospf
process_ID
Router(config-router)# network
IP_address wildcard_mask
area
area_#
The process_ID is locally significant and is used to differentiate between different
OSPF processes running on the router. Your router might be a boundary router
10
Chapter 11: Configuring Advanced Routing Protocols
CertPrs8 / CCNA Cisco Certified Network Associate Study Guide / Deal / 222934-9 / Chapter 11
FIGURE 11-3
LSA update
process
A two-way state indicates
that two OSPF routers are neighbors. A
full state indicates the completion of
sharing of links between routers.
D:\omh\CertPrs8\934-9\ch11.vp
Monday, August 04, 2003 12:13:42 PM
Color profile: Generic CMYK printer profile
Composite Default screen
between two OSPF autonomous systems, and to differentiate them on your router,
you'll give them unique process IDs. Note that these numbers do not need to match
between different routers and that they have nothing to do with autonomous system
numbers.
When specifying what interfaces go into an area for OSPF, use the network
command. As you can see in the preceding example, the syntax of this command is
different than for RIP’s and IGRP’s configuration, where you specify only a class
address. OSPF is classless. With this command, you can be very specific about what
interface belongs to a particular area. The syntax of this command is to list an IP
address followed by a wildcard mask. This is different from a subnet mask. A wildcard
mask tells the router the interesting component of the address—in other words,
what part of the address it should match on. This mask is also used with access
lists, which are discussed in Chapter 13.
A wildcard mask is 32 bits in length.A0inabitposition means there must be a
match, and a 1 in a bit position means the router doesn’t care. Actually, a wildcard
mask is an inverted subnet mask, with the 1’s and 0’s switched. Using a wildcard mask,
you can be very specific about which interfaces belong to which areas. The last part
of the command tells the router which area these addresses on the router belong to.
Let’s look at some code examples to see how the wildcard mask works. I’ll use the
router shown in Figure 11-4 as an illustration.
Router(config)# router ospf 1
Router(config-router)# network 10.1.1.1 0.0.0.0 area 0
Router(config-router)# network 10.1.2.1 0.0.0.0 area 0
Router(config-router)# network 172.16.1.1 0.0.0.0 area 0
Router(config-router)# network 172.16.2.1 0.0.0.0 area 0
In this example, the interfaces with addresses of 10.1.1.1, 10.1.2.1, 172.16.1.1,
and 172.16.1.1 all are associated with area 0. A wildcard mask of 0.0.0.0 says that
there must be an exact match against the address in order to place it into area 0.
Here’s another example:
Router(config)# router ospf 1
Router(config-router)# network 10.0.0.0 0.255.255.255 area 0
Router(config-router)# network 172.16.0.0 0.0.255.255 area 0
In this example, interfaces beginning with 10 or 172.16 are to be associated with
area 0. Or, if all the interfaces on your router belonged to the same area, you could
use this configuration:
Router(config)# router ospf 1
Router(config-router)# network 0.0.0.0 255.255.255.255 area 0
OSPF
11
CertPrs8 / CCNA Cisco Certified Network Associate Study Guide / Deal / 222934-9 / Chapter 11
D:\omh\CertPrs8\934-9\ch11.vp
Monday, August 04, 2003 12:13:43 PM
Color profile: Generic CMYK printer profile
Composite Default screen
In this example, all interfaces are placed in area 0. As you can see, OSPF is very
flexible in allowing you to specify which interface or interfaces will participate in
OSPF and which area or areas they will belong to.
11.01. The CD contains a multimedia demonstration of configuring OSPF
on a router.
Loopback Interfaces
A loopback interface is a logical, virtual interface on a router. By default, the router
doesn’t have any loopback interfaces, but they can easily be created. All IOS platforms
support loopback interfaces, and you can create as many of these interfaces as you
need. These interfaces are treated as physical interfaces on a router: you can assign
addressing information to them, include their network numbers in routing updates,
and even terminate IP connections on them, like telnet. Here are some reasons you
might want to create a loopback interface:
12
Chapter 11: Configuring Advanced Routing Protocols
CertPrs8 / CCNA Cisco Certified Network Associate Study Guide / Deal / 222934-9 / Chapter 11
FIGURE 11-4
OSPF network
configuration
example
When configuring the
OSPF routing process, you must specify
a process ID. Unlike in RIP or IGRP, the
network
statement allows you to specify
an IP address and a wildcard mask, which
is an inverted subnet mask. You must
also specify the area that this address
or addresses will belong to:
network
network_# wildcard_mask area
area_#
.
D:\omh\CertPrs8\934-9\ch11.vp
Monday, August 04, 2003 12:13:43 PM
Color profile: Generic CMYK printer profile
Composite Default screen

To assign a router ID to an OSPF router

To use for testing purposes, since this interface is always up

To terminate special connections, such as GRE tunnels or IPSec
connections, since this interface is always up
To create a loopback interface, use the following command:
Router(config)# interface loopback
port_#
Router(config-if)# ip address
IP_address subnet_mask
As you can see, creating a loopback interface
is easy. You can specify port numbers from 0
to 2147483647. The number you use is only
locally significant. Once you enter the loopback
interface, you can execute almost any interface
command on it; for instance, you can assign it an
IP address with the ip address command.
11.02. The CD contains a multimedia demonstration of creating a loopback
interface on a router.
Changing Metrics
You have two ways to affect the cost metric that OSPF uses in picking the best-cost routes
for the routing table. First, remember that the cost metric is the inverse of the accumulated
bandwidth values of routers’ interfaces. The default
measurement that Cisco uses in calculating the cost
metric is: cost = 10
8
/(interface bandwidth). You can
also affect the value of the cost by changing the 10
8
value with the auto-cost reference-
bandwidth command. Table 11-1 contains
some costs for different interface types:
To change the cost of an interface, use the following configuration:
Router(config)# interface
type
[
slot_#
/]
port_#
Router(config-if)# ip ospf cost
cost_value
Notice that the cost is assigned within an interface. This value can range from 1
to 65,535. Note that each vendor might use a different calculation to come up with
a cost value. It is very important that the costs for a link match for every router on a
OSPF
13
CertPrs8 / CCNA Cisco Certified Network Associate Study Guide / Deal / 222934-9 / Chapter 11
A loopback interface
is a logical interface that always remains
up. Use the
interface loopback
command to create it.
Remember the OSPF
interface costs in Table 11-1; especially for
serial connections.
D:\omh\CertPrs8\934-9\ch11.vp
Monday, August 04, 2003 12:13:43 PM
Color profile: Generic CMYK printer profile
Composite Default screen
given segment. Mismatched cost values on a segment can cause routers to continually
run the SPF algorithm, greatly affecting the routers’ performance.
Normally, you won’t be changing the default cost values on an interface. However,
since OSPF uses the inverse of bandwidth as a metric, and serial interfaces default to a
bandwidth of 1,544 Kbps, you will definitely want to match the bandwidth metric on
the serial interface to its real clock rate. To configure the bandwidth on your router's
interfaces, use the following command:
Router(config) interface
type
[
slot_#
/]
port_#
Router(config-if)# bandwidth
speed_in_Kbps
As an example, if the clock rate were 64,000, you would use the following
command to correctly configure the bandwidth: bandwidth 64. Note that the
speed is in Kbps. For example, let’s assume you configured the bandwidth with
this: bandwidth 64000. By doing this, the router would assume the bandwidth
metric of the interface is 64 Mbps, not Kbps.
11.03. The CD contains a multimedia demonstration of changing OSPF
metrics on a router.
14
Chapter 11: Configuring Advanced Routing Protocols
CertPrs8 / CCNA Cisco Certified Network Associate Study Guide / Deal / 222934-9 / Chapter 11
Bandwidth Value Interface Type
1785 56 Kbps serial line
1652 64 Kbps serial line
64 T1
25 4Mb Token Ring
10 Ethernet
6 16Mb Token Ring
1 Fast Ethernet and FDDI
TABLE 11-1
OSPF Costs
for Different
Interfaces
The
bandwidth
command
should be used on synchronous serial
interfaces to match the bandwidth metric
to the clocked rate of the interface.
Synchronous serial interfaces default
to a bandwidth metric of 1,544 Kbps.
D:\omh\CertPrs8\934-9\ch11.vp
Monday, August 04, 2003 12:13:43 PM
Color profile: Generic CMYK printer profile
Composite Default screen

Không có nhận xét nào:

Đăng nhận xét