Unit 3 Unicast Routing RIP
Unit 3 Unicast Routing RIP
• The Routing Information Protocol (RIP) is one of the most widely used intradomain routing
protocols based on the distance-vector routing algorithm we described earlier.
• RIP was started as part of the Xerox Network System (XNS), but it was the Berkeley
Software Distribution (BSD) version of UNIX that helped make the use of RIP widespread.
Hop Count
• Figure 3.5.2.2 shows the three forwarding tables for the routers in Figure 3.5.2.1. Note
that the first and the third columns together convey the same information as does a
distance vector, but the cost shows the number of hops to the destination networks.
• Although a forwarding table in RIP defines only the next router in the second column, it
gives the information about the whole least-cost tree based on the second property of
these trees, discussed in the previous section.
• For example, R1 defines that the next router for the path to N4 is R2; R2 defines that the
next router to N4 is R3; R3 defines that there is no next router for this path. The tree is
then R1 → R2 → R3 → N4.
• A question often asked about the forwarding table is what the use of the third column is.
The third column is not needed for forwarding the packet, but it is needed for updating
the forwarding table when there is a change in the route, as we will see shortly.
RIP Implementation
• RIP is implemented as a process that uses the service of UDP on the well-known port
number 520.
• In BSD, RIP is a daemon process (a process running in the background), named routed
(abbreviation for route daemon and pronounced route-dee). This means that, although
RIP is a routing protocol to help IP route its datagrams through the AS, the RIP messages
are encapsulated inside UDP user datagrams, which in turn are encapsulated inside IP
datagrams. In other words, RIP runs at the application layer, but creates forwarding tables
for IP at the network later.
• RIP has gone through two versions: RIP-1 and RIP-2. The second version is backward
compatible with the first section; it allows the use of more information in the RIP messages
that were set to 0 in the first version. We discuss only RIP-2 in this section.
RIP Messages
• Two RIP processes, a client and a server, like any other processes, need to exchange
messages.
• RIP-2 defines the format of the message, as shown in Figure 3.5.2.3.
• Part of the message, which we call entry, can be repeated as needed in a message.
• Each entry carries the information related to one line in the forwarding table of the router
that sends the message.
• RIP implements the same algorithm as the distance-vector routing algorithm we discussed
in the previous section.
• However, some changes need to be made to the algorithm to enable a router to update
its forwarding table:
o Instead of sending only distance vectors, a router needs to send the whole
contents of its forwarding table in a response message.
o The receiver adds one hop to each cost and changes the next router field to the
address of the sending router.
o We call each route in the modified forwarding table the received route and each
route in the old forwarding table the old route. The received router selects the old
routes as the new ones except in the following three cases:
▪ If the received route does not exist in the old forwarding table, it should be
added to the route.
▪ If the cost of the received route is lower than the cost of the old one, the
received route should be selected as the new one.
▪ If the cost of the received route is higher than the cost of the old one, but
the value of the next router is the same in both routes, the received route
should be selected as the new one. This is the case where the route was
actually advertised by the same router in the past, but now the situation
has been changed. For example, suppose a neighbor has previously
advertised a route to a destination with cost 3, but now there is no path
between this neighbor and that destination. The neighbor advertises this
destination with cost value infinity (16 in RIP). The receiving router must not
ignore this value even though its old route has a lower cost to the same
destination.
o The new forwarding table needs to be sorted according to the destination route
(mostly using the longest prefix first).
Timers in RIP
Performance
• Update Messages.
o The update messages in RIP have a very simple format and are sent only to
neighbors; they are local.
o They do not normally create traffic because the routers try to avoid sending them
at the same time.
• Convergence of Forwarding Tables.
o RIP uses the distance-vector algorithm, which can converge slowly if the domain is
large, but, since RIP allows only 15 hops in a domain (16 is considered as infinity),
there is normally no problem in convergence.
o The only problems that may slow down convergence are count-to-infinity and
loops created in the domain; use of poison-reverse and split-horizon strategies
added to the RIP extension may alleviate the situation.
• Robustness.
o Distance-vector routing is based on the concept that each router sends what it
knows about the whole domain to its neighbors. This means that the calculation
of the forwarding table depends on information received from immediate
neighbors, which in turn receive their information from their own neighbors.
o If there is a failure or corruption in one router, the problem will be propagated to
all routers and the forwarding in each router will be affected.
Example
• Figure 3.5.2.4 shows a more realistic example of the operation of RIP in an autonomous
system.
o First, the figure shows all forwarding tables after all routers have been booted.
o Then we show changes in some tables when some update messages have been
exchanged.
o Finally, we show the stabilized forwarding tables when there is no more change.