Routing Information Protocol (RIP) is a distance vector routing protocol that practices classful routing.
|
For more on distance vector and classful routing see CBT Systems course£R TCP/IP Routing Protocols and Cisco Routers£r.
|
RIP is specified in RFC 1723 (1994) which updates RFC 1058.
|
RFC 1723 allows RIP messages to carry more information and it adds some security features.
|
Like other distance vector routing protocols, RIP uses hop count as the metric for calculating optimal routes.
|
RIP stores information on routes in routing tables.
|
RIP routing table entries are made up of

• ultimate destination
|
• metric (distance in
  number of hops)
|
• next hop
|
RIP table entries can also include timers associated with the route in question and a route change flag which indicates whether information about the route has recently changed.
|
Only information on a single optimal route is maintained and hop count is the sole metric used.
|
RIP sends routing update messages at regular intervals and when the network topology changes.
|
When a router running RIP receives new information showing a better route to a destination in its table this information replaces older entries.
|
For example, network topology changes may cause a new route to become the best route to a particular destination.
|
Routing update messages reflect network topology changes.
|
For example, when a router detects a link or router failure, it recalculates its routes and sends routing update messages.
|
Each router that receives a routing update message which includes a change then updates its tables and propagates the change.
@@
Like other routing protocols, RIP uses timers to regulate its performance.
|
The RIP £Rrouting update timer£r sets the interval between periodic routing updates, when the router sends a complete copy of its routing table to all neighbors.
|
This timer is usually set to 30 seconds.
|
If a router has not received an update about a particular route for some time, the route may have become invalid.
|
The £Rroute invalid timer£r determines the length of time that must expire before the not-heard-about route is deemed invalid.
|
Once a route is deemed invalid, neighbors are notified of this fact.
|
The third timer used by RIP is the £Rroute flush timer£r.
|
The route flush timer sets the interval between a route becoming invalid and its removal from the routing table.
|
But before the router removes the invalid route's entry from its table, it must notify its neighbors of the invalid route.
|
The value for the route invalid timer must be less than that of the route flush timer.
|
This is so that the router has time to update its neighbors on invalid routes before it deletes them from its routing table.
|
The initial value for the route invalid timer is 90 seconds and for the route flush timer it is 270 seconds.
@@
Here is the RIP packet format for IP implementation, as specified by RFC 1058.
|
This shows the RIP format for IP networks in the Internet.

Some other RIP variations make slight modifications to this format but the basic routing algorithm is functionally the same.
|
The first field in the RIP packet is the command field.
|
The command field indicates whether the packet is a request or response.
|
A request asks the responding system to send all or part of its routing table.
|
Destinations for which responses are requested are listed later in the packet.
|
A response can be used to flag a packet as a reply to a request.
|
But more often it indicates that the packet is a reply to an unsolicited regular routing update.
|
A responding system includes all or part of its routing table in the response packet.
|
Regular routing updates include the sender's entire routing table.
|
The version number specifies the version of RIP being implemented.
|
There can be many differing versions of RIP within an internetwork.
|
The version number field can be used to signal different, possibly incompatible implementations.
|
The address family identifier field follows a field of 16 zeros.
|
This identifies the type of addressing scheme used by a destination address for which update information is being given or sought in the RIP packet.
|
On the Internet this address family is usually IP (value=2), but other network types can be represented.
|
Another field of 16 zeros precedes the address field.
|
This field contains the address of a destination, either to update the RIP packet's recipient, or as a request by the packet's sender for update information about routes to it.
|
The information contained in the metric field follows two more 32-bit fields of zeros.
|
The metric field specifies the hop count to the destination whose address family and address were given in the preceding fields.
|
The hop count indicates how many internetwork hops (routers) must be traversed before the destination can be reached.
|
Up to 25 destinations may be listed in any single RIP packet.
|
In other words, the packet might repeat the address family, address and metric fields, as well as the zero's in between, up to 25 times.
|
If a RIP routing table contains more than 25 entries, the router simply sends its updates in as many packets as necessary.
@@
With RIP, complete routing table updates are sent only to neighboring routers.
|
These recalculate the information in the table and pass it on in updates to their respective neighbors.
|
RIP's use of this method of updating results in slow convergence following topology changes.
|
In some large internetworks, this slow convergence can lead in turn to routing loops and the count to infinity problem.
|
RIP has a number of features designed to make its operation more stable when faced with rapid network topology updates.
|
These include:

• a hop count limit
|
• hold-downs
|
• split horizons
|
• poison reverse updates
|
For more on stability features and practical examples of solving the count to infinity problem, see CBT Systems course £RTCP/IP Routing Protocols and Cisco Routers£r.
|
Suppose Router 1's link to Network A fails.
|
Router 1 examines its information and sees that Router 2 has a one-hop link to Network A.
|
Since Router 1 knows it is directly connected to Router 2, it advertises a two-hop path to Network A and begins routing all traffic to Network A through Router 2.
|
This creates a routing loop.
|
When Router 2 learns that Router 1 can now get to Network A in two hops, it changes its routing table entry to show that it has a three-hop path to Network A.
|
It then advertises that fact to its neighbors (including Router 1) in its next update.
|
This count to infinity problem, and the corresponding routing loop, will continue indefinitely unless some external boundary condition is imposed.
|
RIP does this by limiting routes to a maximum hop count of 15.
|
When the hop count for a route exceeds 15 the route is marked unreachable.
|
Over time the route is removed from the table.
|
The route flush timer determines when the route is removed from the routing table.
|
Assigning a maximum hop count is a useful way of solving the count to infinity problem.
|
However, since any destination over 15 hops away is tagged as unreachable, RIP's maximum hop count greatly restricts its use in large internetworks.
@@
Hold-downs are used to prevent regular update messages from inappropriately reinstating a non-available route.
|
Router A receives an update from Router E to say that Network 1 is down.
|
Router A then marks the route as inaccessible and starts a hold-down timer.
|
As each router receives a similar message regarding Network 1 from its immediate neighbor it follows the same steps.
|
Update messages to neighboring routers about the non-available route may not arrive until after the routers have sent out their regular update messages.
|
So some routers will still be advertising incorrect information.
|
Using a hold-down timer ensures that the incorrect information will not be propagated throughout the network.
|
Routers ignore updates with a poorer metric than originally recorded for the network while the hold-down timer is in place.
|
For example, Router C may advertise that Network 1 is available but the update will have a poorer metric than updates sent, for instance from Router E or Router A.
|
During the hold-down period, routers will mark the route as accessible again if updates arrive from the same router who initially informed them of the network being down.
|
Router A will accept an update message from Router E regarding Network 1's new status.
|
Routers will also mark the route as accessible if an update with a better metric arrives from a neighboring router within the hold-down period.
|
In this example, Router 1 has advertised that it has a route to Network A but the interface to Network A then goes down.
|
There is no reason for Router 2 to include this route in its update back to Router 1 because Router 1 is closer to Network A.
|
The split horizon rule says that Router 2 should strike this route from any updates sent to Router 1.
|
Without split horizons, Router 2 would continue to inform Router 1 that it can get to Network A through Router 1, though Router 2's updates will not expressly state this.
|
Router 1 might pick up Router 2's route as an alternative to its failed direct connection, causing a routing loop.
|
Hold-downs alone should solve this problem but split horizon provides extra algorithm stability.
|
Split horizons help prevent two-node routing loops.
|
Information received from the adjacent neighboring router is not advertised back to that particular router.
|
So for example, Routers 1 and 2 will not circulate conflicting information between them.
|
Whereas split horizons should prevent routing loops between adjacent routers, poison reverse updates are intended to defeat larger routing loops across internetworks.
|
Increases in routing metrics generally indicate routing loops.
|
We have seen that routing loops occur when a router that has not been updated about an inaccessible network continues to advertise routes to that network.
|
Neighboring routers accept the alternative route and continue to advertise different routes to neighbors, increasing the distance metric at each stage.
|
In this example, Network 1's neighboring router, Router E, receives an update that Network 1 is down.
|
It assigns an infinite cost in its table to Network 1 and so 'poisons' its route, putting it in hold-down.
|
Since RIP's maximum hop count is 15, an infinite cost is anything above this.
|
Router E will not accept information from other routers about Network 1 while it maintains its 'Network down' table entry.
|
Router E will eventually trigger an update to neighbouring routers as well as other routers in the internetwork about Network 1.
|
All routers will then converge on the topology change.
@@
Here you will see how to turn on the dynamic routing protocol RIP.
|
This involves

• logging on to the local router and
  other remote routers
|
• enabling RIP on the router
|
• enabling the networks that RIP
  relates to
|
Managers in a multinational company based in San Francisco need to communicate with their counterparts in Dublin.
|
To do this, their local SanFran router must be able to communicate with a router in Dublin, and the interfaces associated with it.
|
In this example, IP addresses (and subnet identifiers) have already been assigned to all the interfaces.
|
The addresses are all in the form 172.16.x.y.
|
This signifies a class B network address.
|
A subnet mask of 255.255.255.0 is also being used.
|
In other words, the third octet of the address will be treated by the routers as containing subnetwork, rather than node, address information.
|
The addresses associated with the routers are as follows:

SanFran:
Serial1 port 172.16.67.1
Ethernet0    172.16.128.1
|
Dublin:
Serial1 port 172.16.67.2
Ethernet0    172.16.192.1
|
Because subnets are regarded as distinct networks, a routing protocol is needed to allow routing between subnets.
|
The network administrator has decided to use RIP.
|
RIP routing will be set up on both the SanFran and Dublin routers.
@@
First the SanFran router must be put in Privileged mode.
|
We type £Renable£r at the User Exec prompt and enter the password, which in this case is £Rcisco£r.
|
The SanFran router is now in Privileged mode.
|
You type £Rshow ip protocol£r to see what protocol is running.
|
However, no protocol is enabled at the moment, so no protocol information is shown.
|
You can check if any networks are available through a routing protocol or if they are directly connected networks.
|
You type £Rshow ip route£r to see what networks and interfaces the router has information on.
|
Here the table lists only directly connected subnets and does not yet have information on other remote networks.
|
We can see that there is already a connection to the Serial1 interface on the Dublin router, since its address (172.16.67.0) is on a directly connected subnet.
|
However, the network 172.16.192.0 in Dublin is not accessible because no 172.16.192.0 subnets are shown in the table.
|
RIP needs to be configured so that other networks, that are not directly connected, can be reached.
|
First you have to put the router in Configuration mode.
|
You enter £Rconfig£r at the Privileged mode prompt.
|
Then press £UReturn£u to configure from the network.
|
You are prompted to enter configuration commands.
|
Next you turn on RIP routing on the SanFran router.
|
To turn on RIP routing you enter £Rrouter rip£r in Configuration mode.
|
Once RIP is turned on, you next enable networks associated with the router.
|
In this example the associated network is 172.16.0.0.
|
The command you enter to enable this particular network is £Rnetwork 172.16.0.0£r.
|
The routing protocol will now associate interfaces with their correct addresses and will begin packet processing on the network that has been specified.
|
RIP is operating on the SanFran router and a network has been associated with it.
|
So you are ready to exit Configuration mode.
|
To exit Configuration mode you press £UCtrl+Z£u at SanFran's Configuration prompt.
|
The router returns to Privileged mode.
|
Once you have completed these steps you save the configuration in NVRAM.
|
To do this you use the Copy Runn Start command.
@@
Next we will look at how to log on to other routers.
|
You can access other routers in several ways.
|
Say, for example, that you want to log onto the Dublin router.
|
We are currently in Privileged mode on the SanFran router.
|
If you have access to a host file which includes the remote router's host name, or there is a Domain Name Server (DNS) on the network, you can type just the router's name.
|
If you wanted you could have used the Telnet command in either of the following formats:

£Rtelnet Dublin£r
|
£Rtelnet 172.16.67.2£r
|
You would have to use Dublin's IP address if the SanFran router did not have a host file entry for Dublin.
|
And in that case you would specify the serial address of the subnet directly attached to SanFran, since the other subnets have not sent any updates to SanFran and cannot be seen by that router.
|
The connection to Dublin is now open but you need to enter a remote logon password.
|
In this case the logon password is £Rcbtcbt£r.
|
Now you have to put the Dublin router into Privileged mode.
|
So you enter the Enable command.
|
You enter the Privileged mode password £Rcisco£r and the router is now in Privileged mode.
|
Once you are at the Privileged mode prompt, you can start to configure the Dublin router.
|
You type £Rconfig£r to enter Configuration mode and press £UReturn£u to configure from the network.
|
Then you enter £Rrouter rip£r to turn on RIP.
|
Next you need to enable the RIP network that RIP will work on.
|
You type in £Rnetwork£r followed by the network number.
|
To exit configuration mode, press £UCtrl+Z£u.
|
You then save the configuration in NVRAM with the Copy Runn Start command.
|
Finally, to log out of the Dublin router and return to the SanFran router, you type £Rexit£r.
@@
Now let's see how to monitor RIP.
|
When monitoring RIP you may want to look at

• RIP updates
|
• routing tables
|
• network connectivity
|
You implement several different checks to access this information.
|
In this example the SanFran router is already in Privileged mode.
|
If you type £Rshow ip protocol£r, the SanFran router will now confirm that RIP is enabled on it.
|
It also provides information on

• RIP timers
|
• the network to which RIP is
  assigned
|
• routing information sources
|
You can display SanFran's routing tables by typing £Rshow ip route£r.
|
Here you can see the entries for all known networks and subnetworks.
|
The code letter R is now also shown.
|
This indicates that these networks were learnt through RIP.
|
We can see that RIP routing has connected the SanFran router to routes on the 172.16.192.0 subnet via the Dublin link 172.16.67.2.
|
To view RIP updates you turn on RIP debugging by entering £Rdebug ip-rip£r.
|
This displays an update list.
|
The update list shows routing updates as they are sent and received.
|
For example, the first item shows that there is an update on SanFran's Ethernet0 from a terminal (172.16.67.2) which states that another terminal's network (172.16.192.0) is 1 hop away.
|
As you can see the number of hops (or the metric) for the terminal is 1.
|
The address 255.255.255.255 is a broadcast address.
|
So the SanFran router is sending updates to all its neighbors.
|
To stop debugging, you first put the router back into Privileged mode by pressing £UReturn£u to stop the update list scrolling.
|
You turn off debugging by typing £Rundebug ip rip£r at the Privileged mode prompt.
|
There are other commands you can use to test connections to particular addresses.
|
You can use the Ping and Trace commands to show network connectivity.
|
Here we use the Ping command to test connectivity to the Dublin Ethernet0 interface, address 172.16.192.1.
|
The five exclamation marks and the following line confirm that 172.16.192.1 is active on the Dublin router.
|
You can also use Trace to test network connectivity and to see which routes packets will take to their destination.
|
Here we use it to trace SanFran's connection to Serial0 in Dublin, address 172.16.66.2.
|
The report shows that the route goes through Dublin's Serial1 interface.
@@
Enabling RIP on your router allows you to access all networks that would otherwise be inaccessible from the local router.
|
For example, the Ethernet0 interface on the Dublin router, (address 172.16.192.1) was not directly connected to the SanFran router and so was not accessible from it.
|
But RIP routing now makes it accessible.
|
Another way to check connectivity is to Telnet to another host.
|
So you can try to Telnet to 172.16.192.1.
|
The connection is found to be open.
|
You enter the remote login password £Rcbtcbt £rto enter User Exec mode£r.
|
The Ethernet0 interface in Dublin is now accessible to SanFran by reason of RIP routing.
|
And because you only wanted to confirm on connection, you just type £Rexit£r at Dublin's prompt to return to the SanFran router.
@@
A San Francisco based company also has outlets in Sydney, London, and Dublin.
|
The network administrator has been asked to set up a routing procedure which will allow the four main outlets and their subsidiaries to circulate business reports between them.
|
There are routers in each of the main outlets.
|
The addresses associated with the routers are as follows:

SanFran:
Serial1 port 172.16.67.1
Serial0 port 172.16.65.2
Ethernet0 172.16.128.1
|
Sydney:
Serial0 port 172.16.65.1
Serial1 port 172.16.68.1
Ethernet0 172.16.32.1
|
London:
Serial0 port 172.16.68.2
Serial1 port 172.16.66.1
Ethernet0 172.16.1.1
|
Dublin:
Serial1 port 172.16.67.2
Serial0 port 172.16.66.2
Ethernet0 172.16.192.1
|
RIP has already been turned on at both the local and the Dublin router and network 172.16.0.0 is enabled.
|
The configuration has been saved and the local router is back in Privileged mode.
|
Let's suppose that you now want to set up RIP routing on the Sydney router so that you can access all networks associated with it.
|
Typing £Rtelnet Sydney£r will access the Sydney router.
|
Next you enter the remote login password to bring you into Exec mode.
|
Now you must put the Sydney router in Privileged mode.
|
You enter £Renable£r to put the Sydney router in Privileged mode.
|
You must be in Configuration mode to enable RIP.
|
You type £Rconfig£r to enter Configuration mode.
|
You must press £UReturn£u to configure from terminal, and the Configuration mode prompt appears.
|
Once you are in configuration mode you can enable RIP on the Sydney router.
|
You type £Rrouter rip£r at Sydney's command prompt to turn on RIP routing.
|
Your network IP address is 172.16.0.0.
|
When RIP is turned on you can move on to specifying associated networks.
|
To enable 172.16.0.0 as the network associated with the RIP routing, type £Rnetwork 172.16.0.0£r.
|
Now that you have completed these tasks you can exit Configuration mode.
|
The £UCtrl+Z£u command removes you from Configuration mode.
|
You then save the new configuration in NVRAM on Sydney.
|
You can save the new configuration in NVRAM by typing £Rcopy runn start£r.
|
So you have enabled RIP on the Sydney router and can now return to the local router in San Francisco.
|
When you have finished enabling RIP on a remote router, you type £Rexit£r to return to your local router.
@@
The Sydney router is directly connected to the London router, IP address 172.16.68.2.
|
You can prepare to set up RIP routing in London by telnetting from Sydney to 172.16.68.2 in London.
|
You have been able to access 172.16.68.2 in London through the Sydney router.
|
Let's suppose that you have already entered the remote login password and used the £Renable£r command to get into Privileged mode.
|
RIP has not been configured yet.
|
First you need to enter Configuration mode by typing £Rconfig£r and £UReturn£u to configure from terminal.
|
Now you are ready to set up RIP.
|
The Router Rip command enables RIP on London.
|
Next you enable your network 172.16.0.0 with the £RNetwork£r command.
|
You then press £UCtrl+Z£u to exit Configuration mode.
|
The configuration is now saved in NVRAM on London.
|
You are now back at the SanFran router.
@@
Now let's take a look at monitoring RIP operation on the SanFran router.
|
Here, the router is in Privileged mode.
|
First, let's have a look at some RIP update messages that SanFran has sent and received.
|
You type £Rdebug ip rip£r to examine RIP updates.
|
You can now see the list of update messages sent and received.
|
For example, SanFran received an update from the Serial0 interface in London.
|
You have already entered Privileged mode by pressing £UReturn£R £u£rto stop the update scroll.
|
You enter £Rundebug ip rip£r to stop RIP debugging.
@@
Now you can verify that RIP routing has been enabled.
|
You type £Rshow ip protocol£r to see which protocol is running on your router.
|
Here the routing protocol is RIP.
|
And 172.16.0.0 is the network to which RIP is assigned.
|
The command Show IP Route brings up the routing table.
|
Here you can check which routes can now be routed through RIP.
|
For example the Ethernet port 172.16.192.0 in Dublin is now accessible.
|
Previously, these were on inaccessible subnets.
@@
A good way to test RIP routing is to see if previously unreachable locations are now accessible.
|
For example, the Ethernet0 172.16.1.1 at London is on a different subnet to the SanFran router and was previously inaccessible.
|
If you telnet to this address, it is now found to be accessible.
|
So you exit to the SanFran router to make further checks.
|
There are two commands that you can use to test whether a router has a connection to a network.
|
The Trace command allows you to check connectivity to a destination, and shows the route taken by packets sent there.
|
We know that the Ethernet0 in London (172.16.1.1) is now accessible so let's check how packets from the local router reach it.
|
The syntax is £Rtrace£r £Baddress£b.
|
There are two alternative routes to London's Ethernet.
|
We can see that packets are either first routed through Dublin (172.16.67.2) or Sydney (172.16.65.1).
|
You could also use the Ping command to test network connectivity.
|
The Ping command has confirmed that the connection to 172.16.1.1 is effective.
@@
