How to Work With RIP Protocol in Networking

Introduction

In this article I am going to explain the Routing Information Protocol (RIP) in networking. RIP is a routing protocol that specifies how routers communicate with each other.

A routing protocol is used to allow two or more routers to communicate. There are two types of routing for networks:

  • Static routing
  • Dynamic routing

Static Routing

Implementation of static routing is hard and complicated. In this type of routing we set all routes manually and it is suitable for small networks.

Dynamic Routing

In the dynamic routing protocol we use a routing protocol to set the route. There are two types of routing protocols:

  • Interior gateway routing
  • Exterior gateway routing

Interior gateway routing

Interior gateway routing has two types of protocols; the distance vector routing protocol and the link state routing protocol.

RIP (Routing Information Protocol)

RIP is an example of distance vector routing protocol. RIP is based on the number of hop counts. RIP is good for small networks because it allows only 15 hops in a network. In other words, if a packet is sent by the RIP protocol then it is discarded after 15 hops.

Path selection in RIP is based on the metrics of the path. In RIP we count the metrics of the route based on the number of hops. The path having the lowest metrics is selected as the path to send packets from the source to the destination. If more than two paths have the same metric then it uses load balancing.

RIP routers update this routing table every 30 seconds. In other words all routers in RIP exchange her routing table after every 30 seconds. RIP uses the concept known as split horizon to avoid loops in a network.

Example

Here we are creating a network using the RIP protocol. In this network we have three routers, three switches and six PCs.

Ripprotocol.jpg

Configuration of Router 2

Router>enable 
Router#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#host
Router(config)#hostname A
A(config)#interface fastEthernet 0/0
A(config-if)#ip address 192.168.1.1 255.255.255.0 
A(config-if)#no shutdown 

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

A(config-if)#exit
A(config)#interface fastEthernet 0/1
A(config-if)#ip address 192.168.2.1 255.255.255.0 
A(config-if)#no shutdown 

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

A(config-if)#exit
A(config)#router rip 
A(config-router)#network 192.168.1.0
A(config-router)#network 192.168.2.0

Configuration of Router 3

Router>enable 
Router#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#interface fastEthernet 0/1
Router(config-if)#ip address 192.168.2.2 255.255.255.0 
Router(config-if)#no shutdown 

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up    
    
Router(config-if)#do ping 192.168.2.1
Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 3/4/7 ms
Router(config-if)#exit

Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 192.168.3.1 255.255.255.0
Router(config-if)#no shutdown 

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#exit 
outer(config)#interface ethernet 1/0
Router(config-if)#ip address 192.168.4.1 255.255.255.0 
Router(config-if)#no shutdown

%LINK-5-CHANGED: Interface Ethernet1/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/0, changed state to up

Router(config-if)#exit
Router(config)#router rip 
Router(config-router)#network 192.168.2.0 
Router(config-router)#network 192.168.3.0 
Router(config-router)#network 192.168.4.0

Configuration of Router 4

Router>enable
Router#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#interface fastEthernet 0/1
Router(config-if)#ip address 192.168.4.2 255.255.255.0 
Router(config-if)#no shutdown 

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Router(config-if)#exit

Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 192.168.5.1 255.255.255.0
Router(config-if)#no shutdown 

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#exit

Router(config)#router rip 
Router(config-router)#network 192.168.4.0
Router(config-router)#network 192.168.5.0

 

PC 1 communicated with PC 4

RipRouting.jpg

PC 3 communicated with PC 0

DynamicRouting.jpg

Up Next
    Ebook Download
    View all
    Learn
    View all