Routing Information Protocol (RIP)
Background
The
Routing Information Protocol (RIP) is a distance-vector protocol that uses hop
count as its metric. RIP is widely used for routing traffic in the global
Internet and is an interior gateway protocol (IGP), which means that it
performs routing within a single autonomous system. Exterior gateway protocols,
such as the Border Gateway Protocol (BGP), perform routing between different
autonomous systems. The original incarnation of RIP was the Xerox protocol,
GWINFO. A later version, known as routed (pronounced “route dee”),
shipped with Berkeley Standard Distribution (BSD) Unix in 1982. RIP itself
evolved as an Internet routing protocol, and other protocol suites use modified
versions of RIP. The AppleTalk Routing Table Maintenance Protocol (RTMP) and
the Banyan VINES Routing Table Protocol (RTP), for example, both are based on
the Internet Protocol (IP) version of RIP. The latest enhancement to RIP is the
RIP 2 specification, which allows more information to be included in RIP
packets and provides a simple authentication mechanism.
IP RIP is
formally defined in two documents: Request For Comments (RFC) 1058 and 1723.
RFC 1058 (1988) describes the first implementation of RIP, while RFC 1723
(1994) updates RFC 1058. RFC 1058 enables RIP messages to carry more
information and security features.
This chapter summarizes
the basic capabilities and features associated with RIP. Topics include the
routing-update process, RIP routing metrics, routing stability, and routing
timers.
Routing Updates
RIP sends
routing-update messages at regular intervals and when the network topology
changes. When a router receives a routing update that includes changes to an
entry, it updates its routing table to reflect the new route. The metric value
for the path is increased by one, and the sender is indicated as the next hop.
RIP routers maintain only the best route (the route with the lowest metric
value) to a destination. After updating its routing table, the router
immediately begins transmitting routing updates to inform other network routers
of the change. These updates are sent independently of the regularly scheduled
updates that RIP routers send.
RIP Routing Metric
RIP uses
a single routing metric (hop count) to measure the distance between the source
and a destination network. Each hop in a path from source to destination is
assigned a hop-count value, which is typically 1. When a router receives a
routing update that contains a new or changed destination-network entry, the
router adds one to the metric value indicated in the update and enters the
network in the routing table. The IP address of the sender is used as the next
hop.
RIP Stability Features
RIP
prevents routing loops from continuing indefinitely by implementing a limit on
the number of hops allowed in a path from the source to a destination. The
maximum number of hops in a path is 15. If a router receives a routing update
that contains a new or changed entry, and if increasing the metric value by one
causes the metric to be infinity (that is, 16), the network destination is
considered unreachable.
RIP Stability
Features
To adjust
for rapid network-topology changes, RIP specifies a number of stability
features that are common to many routing protocols. RIP, for example,
implements the split-horizon and hold-down mechanisms to prevent incorrect
routing information from being propagated. In addition, the RIP hop-count limit
prevents routing loops from continuing indefinitely.
RIP Timers
RIP uses
numerous timers to regulate its performance. These include a routing-update
timer, a route timeout, and a route-flush timer . The
routing-update timer clocks the interval between periodic routing
updates. Generally, it is set to 30 seconds, with a small random number of
seconds added each time the timer is reset to prevent collisions. Each
routing-table entry has a route-timeout timer associated with it. When the
route-timeout timer expires, the route is marked invalid but is retained in the
table until the route-flush timer expires.
Packet Formats
The following section
focuses on the IP RIP and IP RIP 2 packet formats illustrated in Figure 44-1
and 44–2. Each illustration is followed by descriptions of the fields
illustrated.
RIP Packet Format
Figure 44-1 illustrates the IP RIP
packet format.
Figure 44-1
|
An IP RIP packet
consists of nine fields.
|
||||||||||||
Field Length,
|
|||||||||||||
in Bytes
|
|||||||||||||
1
|
1
|
2
|
2
|
2
|
4
|
4
|
4
|
4
|
|||||
A
|
B
|
C
|
D
|
C
|
E
|
C
|
C
|
F
|
|||||
A
= Command
B
= Version Number
C
= Zero
D
= Address Family Identifier
E
= Address
F
= Metric
The following descriptions
summarize the IP RIP packet-format fields illustrated in Figure 44-1:
RIP 2 Packet Format
•
Command— Indicates whether the
packet is a request or a response. The request asks that a router send
all or part of its routing table. The response can be an unsolicited regular
routing update or a reply to a request. Responses contain routing table
entries. Multiple RIP packets are used to convey information from large routing
tables.
•
Version Number— Specifies
the RIP version used. This field can signal different potentially incompatible
versions.
•
Zero— Not used.
•
Address-Family Identifier (AFI)— Specifies
the address family used. RIP is designed to carry routing information
for several different protocols. Each entry has an address-family identifier to
indicate the type of address being specified. The AFI for IP is 2.
•
Address— Specifies the IP address
for the entry.
•
Metric— Indicates how many internetwork
hops (routers) have been traversed in the trip to the destination. This
value is between 1 and 15 for a valid route, or 16 for an unreachable route.
Note Up to 25 occurrences of
the AFI, address, and metric fields are permitted in a single IP RIP packet. (Up to 25
destinations can be listed in a single RIP packet.)
RIP 2
Packet Format
The RIP 2
specification (described in RFC 1723) allows more information to be included in
RIP packets and provides a simple authentication mechanism. Figure 44-2 shows
the IP RIP 2 packet format.
Figure 44-2
|
An IP RIP 2 packet
consists of fields similar to those of an IP RIP packet.
|
||||||||||
Length of Field
|
|||||||||||
in Octets
|
|||||||||||
1
|
1
|
1
|
2
|
2
|
4
|
4
|
4
|
4
|
|||
Address
|
Route
|
IP
|
Subnet
|
Next
|
|||||||
Command
|
Version
|
Unused
|
Format
|
Metric
|
ith4202
|
||||||
Tag
|
Address
|
Mask
|
Hop
|
||||||||
Identifier
|
|||||||||||
The following descriptions
summarize the IP RIP 2 packet format fields illustrated in Figure 44-2:
•
Command— Indicates whether the
packet is a request or a response. The request asks that a router send
all or a part of its routing table. The response can be an unsolicited regular
routing update or a reply to a request. Responses contain routing-table
entries. Multiple RIP packets are used to convey information from large routing
tables.
•
Version—Specifies the RIP version used.
In a RIP packet implementing any of the RIP 2 fields or using
authentication, this value is set to 2.
•
Unused—Value set to zero.
Packet Formats
•
Address-Family Identifier (AFI)— Specifies
the address family used. RIP is designed to carry routing information
for several different protocols. Each entry has an address-family identifier to
indicate the type of address specified. The address-family identifier for IP is
2. If the AFI for the first entry in the message is 0xFFFF, the remainder of
the entry contains authentication information. Currently, the only
authentication type is simple password.
•
Route Tag—Provides a method for
distinguishing between internal routes (learned by RIP) and external
routes (learned from other protocols).
•
IP Address— Specifies the IP address
for the entry.
•
Subnet Mask—Contains the subnet mask
for the entry. If this field is zero, no subnet mask has been specified
for the entry.
•
Next Hop—Indicates the IP address
of the next hop to which packets for the entry should be forwarded.
•
Metric— Indicates how many
internetwork hops (routers) have been traversed in the trip to the destination.
This value is between 1 and 15 for a valid route, or 16 for an unreachable
route.
Note Up to 25 occurrences of the AFI,
address, and metric fields are permitted in a single IP RIP packet.
That is, up to 25 routing table entries can be listed in a single RIP packet.
If the AFI specifies an authenticated message, only 24 routing table entries
can be specified.
No comments:
Post a Comment