Header
Home | Set as homepage | Add to favorites
  Search the Site     » Advanced Search
Sections
Syndication


Blogroll:

||||| ALL Cisco-Network ARTICLES |||||  
CCIE Journey,
The CCIE Journey,


Routing Information Protocol (RIP)

Nov 11,2010 by admin

image

Routing Information Protocol (RIP)  
  RIP Version 1 is specified in RFC 1058 and belongs to the class of routing protocols called Interior Gateway Protocols (IGP). An IGP is used for routing within a single autonomous system. An autonomous system (AS) is one in which the routing policies are under a common authority and utilize a common routing scheme. An Exterior Gateway Protocol (EGP) is used to route between autonomous systems (see Figure 5-5).  
   
  Figure 5-5: Interior and Exterior Gateway Routing Protocols  
  RIP is a distance-vector routing protocol, which only uses a hop count when making a routing decision. A hop count is the number of routers that a packet has to traverse in order to reach its destination. If two unequal speed or bandwidth routes to the same destination exist but with the same hop count, then RIP considers both routes to be the same distance (see Figure 5-6), which is an obvious limitation of the protocol.  
   
  Figure 5-6: All equal-hop paths are considered equal by RIP.  
  RIP follows a simple algorithm for constructing a routing table. When a router is initially booted, the only networks it is aware of are those that are directly connected. A RIP routing table contains the destination network, the hop count or metric to the destination network, and the interface a packet should be sent through to reach the destination network. Routers A and B in Figure 5-7 would have initial routing tables as shown in Tables 5-1 and 5-2.  
  Table 5-1: Initial Routing Table for Router A  
 
 
  Destination Network  
Hop Count  
 
Interface  
 
 
 
  1  
1  
 
1  
 
  2  
1  
 
2  
 
  6  
1  
 
3  
 
 
 
  Table 5-2: Initial Routing Table for Router B  
 
 
  Destination Network  
Hop Count  
 
Interface  
 
 
 
  2  
1  
 
1  
 
  3  
1  
 
2  
 
 
 
  Routers C through F would have similar routing tables. Every 30 seconds RIP broadcasts the entire routing table on every RIP-configured interface using the format in Figure 5-8. One RIP message can contain up to 25 networks. If a routing table contains more than 25 entries, multiple RIP messages will have to be transmitted.  
  The command field in the RIP message can be used to request all or part of a routing table (command = 1), or signify a response to a request (command =2). Other values are specified in RFC 1058, but they are now considered obsolete. Usually a router sets the command field to one and then broadcasts the entire routing table.  
  When a router receives a RIP message, a simple algorithm is used to determine if the route(s) should be added to the routing table:  
  1.   If a route in the update is not in the routing table, then add the route to the table and increase the metric by one.  
  2.   If the route in the update is in the routing table, add it to the local table only if the metric is less than the metric for the current route and the update was received on a different interface. If the update was received on the same interface as the one in the routing table, then accept the route and the metric.  
  When router B transmits the first RIP message, router A only installs the route to network 3 with a hop count of 2, but does not install the route to network 2 because the route already exists with a metric equal to router B’s metric. The routing table for router A contains four routes, as shown in Table 5-3.  
  Table 5-3: Initial Routing Table for Router A  
 
 
  Destination Network  
Hop Count  
 
Interface  
 
 
 
  1  
1  
 
1  
 
  2  
1  
 
2  
 
  6  
1  
 
3  
 
  3  
2  
 
2  
 
 
 
  Router A now knows that if it has a packet destined for network 3 it can send it to router B through interface 2. After a period of time, all the routers in the network of Table 5-3 will contain entries in their routing tables for every network. The complete routing table for router A is contained in Table 5-4.  
  Table 5-4: Final Routing Table for Router A  
 
 
  Destination Network  
Hop Count  
 
Interface  
 
 
 
  1  
1  
 
1  
 
  2  
1  
 
2  
 
  3  
2  
 
2  
 
  4  
3  
 
2  
 
  5  
4  
 
2  
 
  6  
1  
 
3  
 
  7  
2  
 
3  
 
  8  
3  
 
3  
 
 
 
  Notice in Figure 5-7 that router A can reach network 5 through interface 3 with a hop count of four or through interface 2 with a hop count of four. Which route will router A place in the routing table? The answer depends on whether it receives the RIP message from router E first or from router B. Both routers B and E will advertise a route to network 5 with a hop count of three. According to the RIP algorithm, router A will install the route from the first RIP message received and ignore the route from the second.  
   
  Figure 5-7: Sample RIP network  
  In Figure 5-8, the metric is shown to have a range of values between one and 16. A hop count of 16 signifies that the corresponding network is unreachable. Such a value is considered to be infinity by RIP, which is another limitation of the protocol. Networks that are more than 15 hops away cannot be reached. Many corporate networks have hundreds of routers and their size makes RIP unusable as a routing protocol.  
   
  Figure 5-8: RIP Message format  
  RIP is also a slowly converging protocol. Convergence is a measure of how long it takes to propagate a route through the network when there is a change. Assuming we boot all the routers in Figure 5-7 simultaneously, it will take 60 seconds (if all routers immediately send their initial RIP message) for the route to network 5 to reach router A. If router D loses the connection to network 5, it will advertise a hop count of 16 (infinity) to network 5. Router A will not know that the network is unreachable for 60 seconds (a very long time) and will continue to send packets to network 5 until it learns the network is unreachable. Actually, all the routers do not send their initial routing tables at the same time. The 30-second timer for RIP updates is offset by a random amount to prevent the routers from transmitting simultaneously.  
  Two additional timers are also associated with RIP updates, the timeout timer and the garbage-collection timer. When a new route is installed in the routing table, the timeout timer is initialized to zero and begins to count. Every time a RIP message containing the route is received, the timeout timer is reset to zero. If a RIP message containing the route is not received for 180 seconds, the metric for the route is set to 16 and a garbage-collection timer for the route is started. If 120 seconds pass without receiving the route in a RIP message, the route is removed from the routing table. If a message is received containing the route before the garbage-collection timer reaches 120, the timer is cleared and the route is installed in the routing table.

213 times read

Related news

No matching news for this article
Did you enjoy this article?
Rating: 1.00 (total 2 votes)

comment Comments (0 posted) 

More Top News
CCSP-Cisco Certified Security Professional
Most Popular
Most Commented
Featured Author