📄 rfc1247.txt
字号:
RFC 1247 OSPF Version 2 July 1991
Router RT6 to the advertising router. For every external destination,
the router advertising the shortest route is discovered, and the next
hop to the advertising router becomes the next hop to the destination.
Both Router RT5 and RT7 are advertising an external route to destination
network N12. Router RT7 is preferred since it is advertising N12 at a
distance of 10 (8+2) to Router RT6, which is better than router RT5's 14
(6+8). Table 3 shows the entries that are added to the routing table
when external routes are examined:
Destination Next Hop Distance
__________________________________
N12 RT10 10
N13 RT5 14
N14 RT5 14
N15 RT10 17
Table 3: The portion of router RT6's routing table listing external
destinations.
Processing of Type 2 external metrics is simpler. The AS boundary
router advertising the smallest external metric is chosen, regardless of
the internal distance to the AS boundary router. Suppose in our example
both router RT5 and router RT7 were advertising Type 2 external routes.
Then all traffic destined for network N12 would be forwarded to router
RT7, since 2 < 8. When several equal-cost Type 2 routes exist, the
internal distance to the advertising routers is used to break the tie.
Both Type 1 and Type 2 external metrics can be present in the AS at the
same time. In that event, Type 1 external metrics always take
precedence.
This section has assumed that packets destined for external destinations
are always routed through the advertising AS boundary router. This is
not always desirable. For example, suppose in Figure 2 there is an
additional router attached to network N6, called Router RTX. Suppose
further that RTX does not participate in OSPF routing, but does exchange
EGP information with the AS boundary router RT7. Then, router RT7 would
end up advertising OSPF external routes for all destinations that should
be routed to RTX. An extra hop will sometimes be introduced if packets
for these destinations need always be routed first to router RT7 (the
advertising router).
To deal with this situation, the OSPF protocol allows an AS boundary
[Moy] [Page 12]
RFC 1247 OSPF Version 2 July 1991
router to specify a "forwarding address" in its external advertisements.
In the above example, Router RT7 would specify RTX's IP address as the
"forwarding address" for all those destinations whose packets should be
routed directly to RTX.
The "forwarding address" has one other application. It enables routers
in the Autonomous System's interior to function as "route servers". For
example, in Figure 2 the router RT6 could become a route server, gaining
external routing information through a combination of static
configuration and external routing protocols. RT6 would then start
advertising itself as an AS boundary router, and would originate a
collection of OSPF external advertisements. In each external
advertisement, router RT6 would specify the correct Autonomous System
exit point to use for the destination through appropriate setting of the
advertisement's "forwarding address" field.
2.3 Equal-cost multipath
The above discussion has been simplified by considering only a single
route to any destination. In reality, if multiple equal-cost routes to
a destination exist, they are all discovered and used. This requires no
conceptual changes to the algorithm, and its discussion is postponed
until we consider the tree-building process in more detail.
With equal cost multipath, a router potentially has several available
next hops towards any given destination.
2.4 TOS-based routing
OSPF can calculate a separate set of routes for each IP Type of Service.
The IP TOS values are represented in OSPF exactly as they appear in the
IP packet header. This means that, for any destination, there can
potentially be multiple routing table entries, one for each IP TOS.
Up to this point, all examples shown have assumed that routes do not
vary on TOS. In order to differentiate routes based on TOS, separate
interface costs can be configured for each TOS. For example, in Figure
2 there could be multiple costs (one for each TOS) listed for each
interface. A cost for TOS 0 must always be specified.
When interface costs vary based on TOS, a separate shortest path tree is
calculated for each TOS (see Section 2.1). In addition, external costs
can vary based on TOS. For example, in Figure 2 router RT7 could
advertise a separate type 1 external metric for each TOS. Then, when
calculating the TOS X distance to network N15 the cost of the shortest
TOS X path to RT7 would be added to the TOS X cost advertised by RT7
[Moy] [Page 13]
RFC 1247 OSPF Version 2 July 1991
(see Section 2.2).
All OSPF implementations must be capable of calculating routes based on
TOS. However, OSPF routers can be configured to route all packets on
the TOS 0 path (see Appendix C), eliminating the need to calculate non-
zero TOS paths. This can be used to conserve routing table space and
processing resources in the router. These TOS-0-only routers can be
mixed with routers that do route based on TOS. TOS-0-only routers will
be avoided as much as possible when forwarding traffic requesting a
non-zero TOS.
It may be the case that no path exists for some non-zero TOS, even if
the router is calculating non-zero TOS paths. In that case, packets
requesting that non-zero TOS are routed along the TOS 0 path (see
Section 11.1).
3. Splitting the AS into Areas
OSPF allows collections of contiguous networks and hosts to be grouped
together. Such a group, together with the routers having interfaces to
any one of the included networks, is called an area. Each area runs a
separate copy of the basic SPF routing algorithm. This means that each
area has its own topological database and corresponding graph, as
explained in the previous section.
The topology of an area is invisible from the outside of the area.
Conversely, routers internal to a given area know nothing of the
detailed topology external to the area. This isolation of knowledge
enables the protocol to effect a marked reduction in routing traffic as
compared to treating the entire Autonomous System as a single SPF
domain.
With the introduction of areas, it is no longer true that all routers in
the AS have an identical topological database. A router actually has a
separate topological database for each area it is connected to.
(Routers connected to multiple areas are called area border routers).
Two routers belonging to the same area have, for that area, identical
area topological databases.
Routing in the Autonomous System takes place on two levels, depending on
whether the source and destination of a packet reside in the same area
(intra-area routing is used) or different areas (inter-area routing is
used). In intra-area routing, the packet is routed solely on
information obtained within the area; no routing information obtained
from outside the area can be used. This protects intra-area routing
from the injection of bad routing information. We discuss inter-area
routing in Section 3.2.
[Moy] [Page 14]
RFC 1247 OSPF Version 2 July 1991
3.1 The backbone of the Autonomous System
The backbone consists of those networks not contained in any area, their
attached routers, and those routers that belong to multiple areas. The
backbone must be contiguous.
It is possible to define areas in such a way that the backbone is no
longer contiguous. In this case the system administrator must restore
backbone connectivity by configuring virtual links.
Virtual links can be configured between any two backbone routers that
have an interface to a common non-backbone area. Virtual links belong
to the backbone. The protocol treats two routers joined by a virtual
link as if they were connected by an unnumbered point-to-point network.
On the graph of the backbone, two such routers are joined by arcs whose
costs are the intra-area distances between the two routers. The routing
protocol traffic that flows along the virtual link uses intra-area
routing only.
The backbone is responsible for distributing routing information between
areas. The backbone itself has all of the properties of an area. The
topology of the backbone is invisible to each of the areas, while the
backbone itself knows nothing of the topology of the areas.
3.2 Inter-area routing
When routing a packet between two areas the backbone is used. The path
that the packet will travel can be broken up into three contiguous
pieces: an intra-area path from the source to an area border router, a
backbone path between the source and destination areas, and then another
intra-area path to the destination. The algorithm finds the set of such
paths that have the smallest cost.
Looking at this another way, inter-area routing can be pictured as
forcing a star configuration on the Autonomous System, with the backbone
as hub and and each of the areas as spokes.
The topology of the backbone dictates the backbone paths used between
areas. The topology of the backbone can be enhanced by adding virtual
links. This gives the system administrator some control over the routes
taken by inter-area traffic.
The correct area border router to use as the packet exits the source
area is chosen in exactly the same way routers advertising external
routes are chosen. Each area border router in an area summarizes for
the area its cost to all networks external to the area. After the SPF
tree is calculated for the area, routes to all other networks are
[Moy] [Page 15]
RFC 1247 OSPF Version 2 July 1991
calculated by examining the summaries of the area border routers.
3.3 Classification of routers
Before the introduction of areas, the only OSPF routers having a
specialized function were those advertising external routing
information, such as router RT5 in Figure 2. When the AS is split into
OSPF areas, the routers are further divided according to function into
the following four overlapping categories:
Internal routers
A router with all directly connected networks belonging to the same
area. Routers with only backbone interfaces also belong to this
category. These routers run a single copy of the basic routing
algorithm.
Area border routers
A router that attaches to multiple areas. Area border routers run
multiple copies of the basic algorithm, one copy for each attached
area and an additional copy for the backbone. Area border routers
condense the topological information of their attached areas for
distribution to the backbone. The backbone in turn distributes the
information to the other areas.
Backbone routers
A router that has an interface to the backbone. This includes all
routers that interface to more than one area (i.e., area border
routers). However, backbone routers do not have to be area border
routers. Routers with all interfaces connected to the backbone are
considered to be internal routers.
AS boundary routers
A router that exchanges routing information with routers belonging
to other Autonomous Systems. Such a router has AS external routes
that are advertised throughout the Autonomous System. The path to
each AS boundary router is known by every router in the AS. This
classification is completely independent of the previous
classifications: AS boundary routers may be internal or area border
routers, and may or may not participate in the backbone.
3.4 A sample area configuration
Figure 6 shows a sample area configuration. The first area consists of
networks N1-N4, along with their attached routers RT1-RT4. The second
area consists of networks N6-N8, along with their attached routers RT7,
[Moy] [Page 16]
RFC 1247 OSPF Version 2 July 1991
RT8, RT10, RT11. The third area consists of networks N9-N11 and host
H1, along with their attached routers RT9, RT11, RT12. The third area
has been configured so that networks N9-N11 and host H1 will all be
grouped into a single route, when advertised external to the area (see
Section 3.5 for more details).
In Figure 6, routers RT1, RT2, RT5, RT6, RT8, RT9 and RT12 are internal
routers. Routers RT3, RT4, RT7, RT10 and RT11 are area border routers.
Finally as before, routers RT5 and RT7 are AS boundary routers.
Figure 7 shows the resulting topological database for the Area 1. The
figure completely describes that area's intra-area routing. It also
shows the complete view of the internet for the two internal routers RT1
and RT2. It is the job of the area border routers, RT3 and RT4, to
advertise into Area 1 the distances to all destinations external to the
area. These are indicated in Figure 7 by the dashed stub routes. Also,
RT3 and RT4 must advertise into Area 1 the location of the AS boundary
routers RT5 and RT7. Finally, external advertisements from RT5 and RT7
are flooded throughout the entire AS, and in particular throughout Area
1. These advertisements are included in Area 1's database, and yield
routes to networks N12-N15.
Routers RT3 and RT4 must also summarize Area 1's topology for
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -