Routing Information Protocol (RIP)
Routing Information Protocol (RIP) as a routing protocol is based on methodologies that go back to the beginning of TCP/IP routing with the formation of the ARPANET, which is the precursor of what is now called the Internet.
RIP is an open protocol and was first published in RFC1058 (and its successor RIPv2 in RFC1723), which was later adopted as Internet Standard 34. RIP is a distance-vector routing protocol, which means that each router may not know where the final destination network is, but it does know in which direction it exists and how far away it is.
RIP places a limit on the maximum distance to the targeted computer as 16 hops or 16 routers, with each router representing a hop from one network to another. Because the route starts with router 0, you are dealing with routes that touch 15 or fewer other routers. For routers farther away, the routing information is dropped or ignored.
You may think that 16 hops is a limitation, but even on a network as large as the Internet, you can usually get to where you want to go within 16 hops. When you traceroute (tracert on Windows) an address, traceroute traces for only 30 hops, and in most cases, it gets you to your destination in fewer than 15 hops.
To accomplish this efficiency requires a high level of network planning to ensure that your hop counts are as low as possible.
In terms of sharing routing information with others, RIP version 1 (RIPv1) shared its routing information with other routers by broadcasting its routing table information through all of its configured network interfaces. Each router that received this information stored it in its own routing table with updated hop counts, ignoring or dropping hop counts over 15.
One major issue that RIPv1 had was that it was classful, which meant that all network segments on a network had to be the same size. You could not deviate your subnet mask from the default for the class; all network segments needed to use the same mask. The following figure illustrates this problem in a three-router layout, with five segments, where only the three segments have computers.
If you were to use a Class C address space like 192.168.1.0, your mask would have to be 255.255.255.224, which would give you 8 segments of 30 devices; but in case of RIP, you would be able to use only 6 segments, and one of your 30 devices would be the router’s interface, leaving you with 29 devices on the network segments.
When sending routing information, only the network IDs are sent and not the matching subnet masks.
To deal with some of the limitations of RIP version 1, RIP version 2 (RIPv2) was proposed in RFC1388 and updated in RFC2453, which became Internet Standard 56. RIPv2 allows the protocol to carry subnet information, allowing support of Classless Inter-Domain Routing (CIDR), which ignores class-based boundaries when routing and allows each segment to maintain a unique subnet mask.
Without needing to maintain the same subnet mask on all network segments allows conservation of network IP addresses, as shown below; where an updated network addressing layout exists with appropriate subnet masks on each segment.
In this case, you can assign a larger network ID to segment A (192.168.1.0/25) of 126 hosts; a smaller segment D (192.168.1.128/26) of 62 hosts; and a smaller segment E (192.168.1.192/27) of 30 hosts; while assigning smaller addresses spaced to segments B and C of 192.168.1.248/30 and 192.168.1.252/30. You are left with two other small address blocks of 192.168.1.224/28 allowing 14 hosts and 192.168.1.240/29 allowing 6 hosts.
In this scenario, you waste few addresses because the router-to-router segments have only the minimum number of addresses assigned to them (2), whereas previously you had two wasted segments of 16 addresses, plus the router-to-router segments that were allocated 14 addresses, when they needed only 2.
RIPv2 also switched from using broadcasts to propagate router information over to using multicasts at address 126.96.36.199, thereby reducing network traffic to unneeded systems. To further enhance the protocol, router authentication (to validate the router’s participation in RIP) was added so that only routing data from trusted routers is added to the routing tables, thereby preventing corruption of the routing tables from unauthorized routers on your network.
With the advent of IPv6, RIP was given another facelift in the form of RIP next generation (RIPng), which increases the size of the address fields, and changed the authentication mechanism to IPSec.