5.6.4 OSPF—The Interior Gateway Routing Protocol
We have now finished our study of Internet control protocols.
It is time to move on the next topic: routing in the Internet. As we mentioned
earlier, the Internet is made up of a large number of autonomous systems. Each
AS is operated by a different organization and can use its own routing algorithm
inside. For example, the internal networks of companies X, Y, and Z are usually seen as three ASes if all three are on
the Internet. All three may use different routing algorithms internally.
Nevertheless, having standards, even for internal routing, simplifies the
implementation at the boundaries between ASes and allows reuse of code. In this
section we will study routing within an AS. In the next one, we will look at
routing between ASes. A routing algorithm within an AS is called an interior gateway protocol; an algorithm for routing
between ASes is called an exterior gateway
protocol.
The original Internet interior gateway protocol was a distance
vector protocol (RIP) based on the Bellman-Ford algorithm inherited from the
ARPANET. It worked well in small systems, but less well as ASes got larger. It
also suffered from the count-to-infinity problem and generally slow convergence,
so it was replaced in May 1979 by a link state protocol. In 1988, the Internet
Engineering Task Force began work on a successor. That successor, called OSPF (Open Shortest Path
First), became a standard in 1990. Most router vendors now support it,
and it has become the main interior gateway protocol. Below we will give a
sketch of how OSPF works. For the complete story, see RFC 2328.
Given the long experience with other routing protocols, the
group designing the new protocol had a long list of requirements that had to be
met. First, the algorithm had to be published in the open literature, hence the
''O'' in OSPF. A proprietary solution owned by one company would not do. Second,
the new protocol had to support a variety of distance metrics, including
physical distance, delay, and so on. Third, it had to be a dynamic algorithm,
one that adapted to changes in the topology automatically and quickly.
Fourth, and new for OSPF, it had to support routing based on
type of service. The new protocol had to be able to route real-time traffic one
way and other traffic a different way. The IP protocol has a Type of Service field, but no existing routing protocol
used it. This field was included in OSPF but still nobody used it, and it was
eventually removed.
Fifth, and related to the above, the new protocol had to do
load balancing, splitting the load over multiple lines. Most previous protocols
sent all packets over the best route. The second-best route was not used at all.
In many cases, splitting the load over multiple lines gives better
performance.
Sixth, support for hierarchical systems was needed. By 1988,
the Internet had grown so large that no router could be expected to know the
entire topology. The new routing protocol had to be designed so that no router
would have to.
Seventh, some modicum of security was required to prevent
fun-loving students from spoofing routers by sending them false routing
information. Finally, provision was needed for dealing with routers that were
connected to the Internet via a tunnel. Previous protocols did not handle this
well.
OSPF supports three kinds of connections and networks:
-
Point-to-point lines between exactly two routers.
-
Multiaccess networks with broadcasting (e.g., most LANs).
-
Multiaccess networks without broadcasting (e.g., most packet-switched WANs).
A multiaccess network is one
that can have multiple routers on it, each of which can directly communicate
with all the others. All LANs and WANs have this property. Figure 5-64(a) shows an AS containing all three kinds of
networks. Note that hosts do not generally play a role in OSPF.
Figure 5-64. (a) An autonomous system. (b) A graph representation of (a).
OSPF operates by abstracting the collection of actual networks,
routers, and lines into a directed graph in which each arc is assigned a cost
(distance, delay, etc.). It then computes the shortest path based on the weights
on the arcs. A serial connection between two routers is represented by a pair of
arcs, one in each direction. Their weights may be different. A multiaccess
network is represented by a node for the network itself plus a node for each
router. The arcs from the network node to the routers have weight 0 and are
omitted from the graph.
Figure 5-64(b) shows the
graph representation of the network of Fig.
5-64(a). Weights are symmetric, unless marked otherwise. What OSPF
fundamentally does is represent the actual network as a graph like this and then
compute the shortest path from every router to every other router.
Many of the ASes in the Internet are themselves large and
nontrivial to manage. OSPF allows them to be divided into numbered areas, where an area is a network or a set of
contiguous networks. Areas do not overlap but need not be exhaustive, that is,
some routers may belong to no area. An area is a generalization of a subnet.
Outside an area, its topology and details are not visible.
Every AS has a backbone area,
called area 0. All areas are connected to the backbone, possibly by tunnels, so
it is possible to go from any area in the AS to any other area in the AS via the
backbone. A tunnel is represented in the graph as an arc and has a cost. Each
router that is connected to two or more areas is part of the backbone. As with
other areas, the topology of the backbone is not visible outside the
backbone.
Within an area, each router has the same link state database
and runs the same shortest path algorithm. Its main job is to calculate the
shortest path from itself to every other router in the area, including the
router that is connected to the backbone, of which there must be at least one. A
router that connects to two areas needs the databases for both areas and must
run the shortest path algorithm for each one separately.
During normal operation, three kinds of routes may be needed:
intra-area, interarea, and inter-AS. Intra-area routes are the easiest, since
the source router already knows the shortest path to the destination router.
Interarea routing always proceeds in three steps: go from the source to the
backbone; go across the backbone to the destination area; go to the destination.
This algorithm forces a star configuration on OSPF with the backbone being the
hub and the other areas being spokes. Packets are routed from source to
destination ''as is.'' They are not encapsulated or tunneled, unless going to an
area whose only connection to the backbone is a tunnel. Figure 5-65 shows part of the Internet with ASes and
areas.
Figure 5-65. The relation between ASes, backbones, and areas in OSPF.
OSPF distinguishes four classes of routers:
-
Internal routers are wholly within one area.
-
Area border routers connect two or more areas.
-
Backbone routers are on the backbone.
-
AS boundary routers talk to routers in other ASes.
These classes are allowed to overlap. For example, all the
border routers are automatically part of the backbone. In addition, a router
that is in the backbone but not part of any other area is also an internal
router. Examples of all four classes of routers are illustrated in Fig. 5-65.
When a router boots, it sends HELLO messages on all of its
point-to-point lines and multicasts them on LANs to the group consisting of all
the other routers. On WANs, it needs some configuration information to know who
to contact. From the responses, each router learns who its neighbors are.
Routers on the same LAN are all neighbors.
OSPF works by exchanging information between adjacent routers,
which is not the same as between neighboring routers. In particular, it is
inefficient to have every router on a LAN talk to every other router on the LAN.
To avoid this situation, one router is elected as the designated router. It is said to be adjacent to all the other routers on its LAN, and
exchanges information with them. Neighboring routers that are not adjacent do
not exchange information with each other. A backup designated router is always
kept up to date to ease the transition should the primary designated router
crash and need to replaced immediately.
During normal operation, each router periodically floods LINK
STATE UPDATE messages to each of its adjacent routers. This message gives its
state and provides the costs used in the topological database. The flooding
messages are acknowledged, to make them reliable. Each message has a sequence
number, so a router can see whether an incoming LINK STATE UPDATE is older or
newer than what it currently has. Routers also send these messages when a line
goes up or down or its cost changes.
DATABASE DESCRIPTION messages give the sequence numbers of all
the link state entries currently held by the sender. By comparing its own values
with those of the sender, the receiver can determine who has the most recent
values. These messages are used when a line is brought up.
Either partner can request link state information from the
other one by using LINK STATE REQUEST messages. The result of this algorithm is
that each pair of adjacent routers checks to see who has the most recent data,
and new information is spread throughout the area this way. All these messages
are sent as raw IP packets. The five kinds of messages are summarized in Fig. 5-66.
Figure 5-66. The five types of OSPF messages.
Finally, we can put all the pieces together. Using flooding,
each router informs all the other routers in its area of its neighbors and
costs. This information allows each router to construct the graph for its
area(s) and compute the shortest path. The backbone area does this too. In
addition, the backbone routers accept information from the area border routers
in order to compute the best route from each backbone router to every other
router. This information is propagated back to the area border routers, which
advertise it within their areas. Using this information, a router about to send
an interarea packet can select the best exit router to the backbone.
No comments:
Post a Comment
silahkan membaca dan berkomentar