RIP Message Format

The RIP message format is shown in Figure 5.3. Each message contains a command and a version
number and can contain entries for up to 25 routes. Each route entry includes an address family identifier,
the IP address reachable by the route, and the hop count for the route. If a router must send an update with
more than 25 entries, multiple RIP messages must be produced. Note that the initial portion of the
message is four octets, and each route entry is 20 octets. Therefore the maximum message size is 4 + (25
X 20) = 504 octets. Including an eight-byte UDP header will make the maximum RIP datagram size (not
including the IP header) 512 octets.

Command will always be set to either one, signifying a Request message, or two, signifying a Response
message. There are other commands, but they are all either obsolete or reserved for private use.
Version will be set to one for RIPv1.
Address Family Identifier is set to two for IP. The only exception to this is a request for a router's (or
host's) full routing table, as discussed in the following section.
IP Address is the address of the destination of the route. This entry may be a major network address, a
subnet, or a host route. The section titled "Classful Route Lookups" examines how RIP distinguishes
among these three types of entries.
Metric is, as previously mentioned , a hop count between 1 and 16.

Several historical influences contributed to the inelegant format of the RIP message in which far more bit
spaces are unused than are used. These influences range from RIP's original development as an XNS
protocol and the developer's intentions for it to adapt to a large set of address families to the influence of
BSD, and its use of socket addresses to the need for fields to fall on 32-bit word boundaries.