127
note that the preceding table provides the ability to distinguish the best route from one that requires more hops. What happens if a path between routers becomes inoperative? For example, consider the path between routers R1 and R2. If the circuit for this path becomes inoperative, how does router R1 obtain information to update its routing table? This update should allow the router to note whether or not a path is available or not available for use. Thus, to dynamically change routing, a router needs to know the state of paths between networks. To obtain this information, a router periodically transmits information to other routers. This information not only tells one router that the network is reachable via another network, but in addition, the lack of an update within a predened period of time could be used to inform the other router that the path between routers is not available for use. Then the other router will search its routing table, and if another route to a destination is available, make that the available route. Because timing is critical, routers also timestamp information stored in their routing tables. Depending on the manner by which a particular routing protocol is implemented, the timestamp may simply be used to purge entries from a routing table, provide a mechanism for selecting one entry over another, or perform another function.
128
Illustrative Network
To illustrate the operation of RIP requires the presence of a network. Because an RIP database maintains information about the link between networks, each link in the network is numbered. In addition, because each router represents a node in a network, for simplicity of illustration, the contents of routing tables are shown in terms of their connected links and number of hops required to reach other nodes in a network. Thus, Exhibit 7.3, which will form the basis for examining how RIP operates, shows a four-node network with ve numbered links.
Exhibit 7.3
From n to
Link
Hop Count
Local
129
Thus, for the router represented by node W in Exhibit 7.3, its routing table would be as follows upon initialization:
From W to
Link
Hop Count
Local
Under RIP, an active router will broadcast the contents of its routing table every 30 seconds. Thus, at t = 30 seconds after initialization, node W will broadcast its distance vector (W = 0) to all of its neighbors. Using Exhibit 7.3 to illustrate the operation of RIP, this means that because nodes X and Z are neighbors of node W, they will each receive the distance vector transmitted by node W. Node C receives the distance vector W = 0 on link 1. Upon receipt of this message, node X updates its routing table by adding 1 to the distant vector supplied by node W. Thus, distance vector table for node X would appear as follows:
From X to
Link
Hop Count
X W
Local 1
0 1
At this point in time, node X had a change in its distance vector table. Thus, when 30 seconds expire since its last table update transmission, it transmits a new distance vector set of information. This information would inform adjacent nodes on links 1, 3, and 5 that X = 0 and W = 1. As node Xs routing table update information ows to node Y, it now becomes possible for that node to be aware of node W although there is no direct path between nodes W and Y. Because the distance vectors from node X inform node Y of the hop count from X to itself and to W, node Y adds 1 to each hop count and stores the information in its routing table. If one logically assumes that node Y was powered on, it already had an initial entry to itself in its routing table. Thus, upon receipt of the two distance vector items of information from node X, node Ys routing table will have three entries. Those entries would be:
From Y to
Link
Hop Count
Y X W
Local 5 5
0 1 2
130
Note that in the preceding routing table, node Y now knows it can reach node W via link 5 and that it requires two hops to reach that node. Thus, although nodes W and Y are not directly connected to one another as table information is transmitted to adjacent nodes under RIP, it becomes possible for nonadjacent nodes to discover how to reach one another. While node Y updates its routing table, it is safe to assume that because at least 30 seconds have transpired, node Ws distance vector information reached node Z. Thus, node Z would have updated its routing table as follows:
From Z to
Link
Hop Count
Z W
Local 2
0 1
Because the discussion of the update of node Y followed the update of node X, at least 60 seconds transpired, which enables each node to transmit two routing table updates. Thus, node Y would also receive node Zs next routing table update that would be transmitted to adjacent nodes on links 2, 3, and 4. The routing table for node X would then be updated to the following state:
From X to
Link
Hop Count
X W Z W
Local 1 3 3
0 1 1 2
Note that at this point in time, node X knows two ways to reach node W: via link 1 with a hop count of 1, which represents a direct connection; or via link 2 with a hop count of 2, which represents an indirect connection. Thus, it is possible for RIP to provide a mechanism for routers to develop a routing table that contains alternate paths. Because node Z transmits its distance vector information on links 2, 3, and 4, that information also ows to both nodes W and Y in addition to X, whose routing table was just updated. Thus, one can also update the previously updated node Y routing table to ascertain the effect of a routing table update received from node Z. Node Ys routing table would now appear as follows:
131
From Y to
Link
Hop Count
Y X Z W W
Local 5 4 4 5
0 1 2 2 2
Because alternate routing entry information would grow exponentially as a mesh network grows in size, RIP does not normally store information about duplicate paths to the same node. Instead, when it computes its routing table update and adds 1 to a received hop count for a node, it compares the new value to the existing value if an entry for the node already exists in memory. If the computed value equals or exceeds the existing hop count, the information about the node received via a router table update is discarded. The exception to this situation is if a router is congured to maintain alternate routing entries to use in the event of a link failure.
Basic Limitations
The preceding example provides a general overview of the manner by which RIP enables nodes to learn the topology of a network. Although RIP does not normally provide alternate path information, the periodic transmission of table entries allows new paths to be learned, because existing information in router tables are time-stamped and an aging process will result in the old path being purged from memory. This process takes time, as table updates occur every 30 seconds. For example, it might take ve minutes for one node that is ten hops away from a non-adjacent node to learn that a path changed. A second limitation of RIP is the fact that it is limited to the maximum hop distance it supports. This distance is 16 hops, which means that an alternative protocol must be used for very large networks.
RIP Versions
The original version of RIP developed for use in TCP/IP dates to 1988 when it was adapted by the Internet Activities Board and published as RFC 1058. RIP gained widespread acceptance due to its inclusion as a routing protocol in the Berkeley 4BSD UNIX operating system. In fact, today, both UNIX and Windows NT workstations support RIP in passive mode, allowing such devices to receive and process table updates although as a passive device, they cannot respond to RIP requests nor broadcast the contents of their tables. Workstations that support RIP do so to avoid having to request information from other routers on a network. Although good in theory, most computers today are congured with a default gateway address for simplicity.
132
Exhibit 7.4
To obtain an appreciation of the difference between the original version of RIP (now referred to as RIPv1) and its successor (RIPv2), turn attention to the elds with the original RIP packet. Once an appreciation for the use of the elds in that packet has been obtained, one will have the foundation to examine the additional features and capabilities provided by RIPv2.
Command Field
The Command eld identies the function of the RIP packet. There are ve commands, as described below:
Command Description
1 2 3/4 5
Request for partial or full routing table information Response containing a routing table Turn on (3) or turn off (4) trace mode. This is now obsolete. Sun Microsystems internal use
Version Field
The Version eld identies the version of RIP. Initially, the value of this eld was 1 to indicate RIP version 1.
133
RIPv1 Limitations
In addition to supporting a maximum hop count of 16 with only a distance of 15 supported because a count of 16 indicates a destination is unreachable RIP has several additional disadvantages. Those disadvantages include an inability to differentiate between the bandwidth differences on different links and the fact that broadcasts can become signicantly large and consume bandwidth that cannot then be used for data transmission. Another limitation of RIPv1 is the fact that this routing protocol requires a subnet mask to be uniform across an entire network. This is because RIPv1 does not support the ability to contain a subnet mask entry in its routing table. Thus, RIPv1 assumes that the subnet mask is the same for all of its congured ports as the subnet whose value it learns for the network identier.
RIPv2
Recognizing some of the limitations associated with RIPv1, this routing protocol was modied in 1994, resulting in the development of RIPv2. RIPv2 is back-
134
Exhibit 7.5
ward-compatible with RIPv1. It adds several important features that enhance its capability. The additional features include a text password authentication capability, the inclusion of subnet masks in its routing tables, and a route tag that provides a mechanism for separating RIP routes from externally learned routes. Exhibit 7.5 illustrates the RIPv2 packet format. In comparing the elds in RIPv1 to RIPv2 packets, one notes the use of several new elds in RIPv2, as discussed below.
135
Exhibit 7.6
the value of a eld within the packet to a special value that tells a receiver to interpret the data differently. One can appreciate technique by examining how RIPv2 supports authentication.
Authentication Support
When the Address Family Identier eld in a RIPv2 packet is set to a value of hex FFFF, the header of the resulting RIP datagram changes into an authentication header. Exhibit 7.6 illustrates the elds in a RIPv2 authentication packet. In examining Exhibit 7.6, one sees that an Authentication Type eld value of 2 is for using a simple password. A eld of 16 bytes that allows one to convey up to a 16-character password follows this. If RIPv2 is communicating with a router supporting RIPv1, RIPv1 will ignore this entry because the value of hex FFFF in the fourth eld of the header is not recognized as an IP address family. A RIPv2-compliant router can be congured with or without authentication. If it is congured with authentication disabled, the router will accept and process both RIPv1 and RIPv2 unauthenticated messages. If the router receives a RIPv2authenticated message, it will discard the message. If the router is congured to support authentication, then unauthenticated messages will be discarded. Although RIPv2 added additional features, it maintained the maximum distance allowable between two stations at 15 hops. RIPv2 does not consider the fact that there could be other metrics besides a hop count that should be considered when determining a path. These shortcomings were considered in the development of a routing protocol referred to as Open Shortest Path First (OSPF), which is discusssed next.
OSPF
The use of Open Shortest Path First (OSPF) as a routing protocol in place of RIP results in both advantages and disadvantages. Although OSPF is more
136
efcient in its overall use of bandwidth, it consumes more bandwidth during its initial discovery process and represents a more complex process that consumes more router memory cycles. This chapter section focuses on obtaining an understanding of the manner by which OSPF operates and its key features.
Overview
The Open Shortest Path First (OSPF) routing protocol is a link state protocol that transmits routing table updates either when a change occurs or every 30 minutes via the use of a multicast address. Thus, before considering additional OSPF features, note that its use is not as great a detriment to bandwidth as the use of RIP.
Path Metrics
A second key feature of OSPF is the fact that paths are based on a true metric and not just a hop count. For example, OSPF routers pass messages to each other in the form of Link State Advertisements (LSAs). One type of LSA includes the IP address of a routers interface and the cost of that interface. Here, the cost is congured by the router administrator. While it is possible for a router administrator to associate any value to a router interface, RFC 1253 denes a series of recommendations concerning the assignment of costs to router interfaces for use of OSPF. Exhibit 7.7 illustrates that such costs are relative to a 100-Mbps operating rate.
Initialization Activity
Although the original OSPF routing protocol dates to the days of ARPAnet, it was not until RFC 2178 that the protocol became available for modern TCP/IP networks. Similar to RIP, OSPF is an IGP and is designed to run within a single autonomous system. Upon initialization, each router within an autonomous system records information about each of its interfaces. Each router in the
Exhibit 7.7 Potential OSPF LSA Costs
Data Rate of Interface Cost
>=
100 Mbps 10 Mbps E1 (2.048 Mbps) T1 (1.544 Mbps) 64 Kbps 56 Kbps 19.2 Kbps 9.6 Kbps
137
autonomous system then constructs a Link State Advertisement (LSA) packet that contains a list of all recently viewed routers and the costs previously associated with their interfaces. Rather than broadcasting the LSAs to all adjacent nodes as supported by RIP, OSPF subdivides a network into geographic entities (known as areas) and forwards LSA packets to routers within its area. A received LSA is then ooded to all other routers in an area, with each router updating its tables with a copy of the most recently received LSA. Thus, each router obtains complete knowledge of the topology of the area to which it was assigned.
Router Types
Under OSPF, a network or a group of networks can represent an area. Through the use of areas, routing table updates can be better controlled, with packet ooding occurring within an area while different areas communicate with one another to obtain information about networks within different areas. This subdivision of labor is based on the use of different types of routers, with the function of routers with respect to OSPF based on their type. If there is only one area, each router maintains a database of the topology of the area and only one router has to deal with external routes beyond the area. When there are multiple areas, a number of other types of routers may be required to perform specialized operations. In fact, under OSPF, there are six types of routers that can be used. Exhibit 7.8 describes the function of each type of OSPF router.
Message Types
As discussed, OSPF routers transmit messages in the form of LSAs. There are currently six types of LSAs used by the protocol. This chapter section briey discusses the function of each type of SLA message.
Exhibit 7.8 Types of OSPF Routers
Router Type Mnemonic Description
Backbone router Area border router Autonomous system boundary router Internal router Designated router Backup designated router
BR ABR ASBR
IR DR BDR
A router that has a connect to a backbone A router that has an interface to multiple areas A router that exchanges routing information with routers connected to other autonomous systems A router that connects networks within a common area A specied router that transfers information on behalf of adjacent routers on a subnet A router that backs up the designated router and takes over should the primary DR fail