Routing Information Protocol (RIP)

 

Routing Information Protocol (RIP)

Routing Information Protocol (RIP) is an intradomain routing protocol used within an autonomous system. It is based on the Distance Vector (DV) routing algorithm. RIP helps routers find the best route to different destination networks by exchanging routing information with their neighboring routers.

1. Routing Metric

RIP uses hop count as its routing metric.

  • A hop represents a router that a packet passes through on its way to the destination.
  • The route with the smallest number of hops is selected as the best route.
  • RIP allows a maximum hop count of 15.
  • A hop count of 16 means infinity, indicating that the destination is unreachable.

2. Exchange of Routing Information

Each RIP router maintains information about the networks it can reach. Routers periodically exchange their routing tables with their immediate neighbors. Based on the information received, a router updates its routing table and selects better routes when available.

This process follows the basic principle of distance-vector routing, where a router learns routing information from its neighbors.

3. RIP Messages

RIP uses messages to exchange routing information between routers. These messages allow routers to:

  • Request routing information.
  • Send routing information to neighboring routers.
  • Update their routing tables when network information changes.

4. Transport Protocol

RIP uses the services of UDP for communication and uses port number 520.

5. Limitation of RIP

The major limitation of RIP is its maximum hop count of 15. Therefore, RIP is mainly suitable for small networks or small autonomous systems and is not appropriate for very large networks.

6.RIP Algorithm

RIP implements the same basic idea as the Distance-Vector Routing algorithm, but it modifies the procedure to update the forwarding table of a router.

The RIP algorithm can be explained in the following steps.

Step 1: Send the Forwarding Table

Instead of sending only the distance vector, a RIP router sends the entire contents of its forwarding table to its neighboring routers in a response message.


Step 2: Receive the Routing Information

When a router receives the forwarding table from a neighboring router:

  • It adds one hop to the cost of every received route.
  • It changes the next router field to the address of the router that sent the information.

Each route received from the neighbor is called a received route, while the route already موجود in the router's forwarding table is called an old route.


Step 3: Compare Received Routes with Old Routes

The router normally keeps the old routes, except in the following three cases:

Case 1: New Destination

If the received route does not exist in the old forwarding table:

➡️ The received route is added to the forwarding table.


Case 2: Better Route Found

If the cost of the received route is less than the cost of the old route:

➡️ The received route is selected because it provides a better path with fewer hops.


Case 3: Route Received from the Same Next Router

If the received route has a higher cost than the old route, but both routes have the same next router:

➡️ The received route must be selected.

This is important because the same neighboring router may be reporting that the network condition has changed.

For example:

  • Previously, a neighboring router advertised a destination with cost 3.
  • Later, the destination becomes unreachable.
  • The neighbor advertises the destination with cost 16 (infinity in RIP).

Even if the old route has a smaller cost, the receiving router must accept the new information because it came from the same next router.


Step 4: Create the New Forwarding Table

After comparing all received routes with the old routes, the router creates an updated forwarding table.

The new forwarding table is then sorted according to the destination route, generally using the longest prefix first rule.


7.Simple RIP Algorithm

For each forwarding table received from a neighboring router:

  1. Receive the complete forwarding table.
  2. Add one hop to the cost of every received route.
  3. Set the next router as the router that sent the table.
  4. Compare each received route with the corresponding old route.
  5. Update the forwarding table if:
    • the destination is new,
    • the received route has a lower cost, or
    • the received route has a higher cost but comes through the same next router.
  6. Sort the updated forwarding table according to the destination prefix.

Conclusion

RIP routers exchange their complete forwarding tables with neighboring routers. Each router compares the received routes with its existing routes and updates its forwarding table whenever new or changed routing information requires an update.

RIP is a simple distance-vector routing protocol that selects the best route based on the minimum hop count. Routers periodically exchange routing information with their neighbors. Because RIP supports only up to 15 hops, it is mainly suitable for small networks.


FeatureRIP
Type        Intradomain routing protocol
Algorithm        Distance Vector
Metric        Hop count
Maximum hops        15
Infinity        16
Transport protocol        UDP
Port number        520
Suitable for        Small networks

Comments

Popular posts from this blog

Computer Networks PCCST501 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Introduction to Computer Networks

TCP/IP Protocol Suite