CCNA Class 11: Distance vector Routing Protocol (RIPv1 & RIPv2) Configuration
DISTANCE VECTOR ROUTING PROTOCOL
RIP is known as Distance Vector Routing Protocol. Here Distance means number of hop counts which is calculated by Router to reach traffic source to destination and Vector means direction.
In a word, RIP - to choose the least path by calculating metric value from the entire network direction while travelling traffic from source to destination.
How to RIP Work -
RIP is a distance vector protocol that exchanges routing information between routers periodically. Each router maintains a routing table that contains the next hop and the hop count for each destination network.
Every 30 seconds, the router sends its entire routing table to its directly connected neighbors. The neighbors then update their own tables based on the received information and the lowest hop count.
Every time Routers advertise their own fully updated routing table to each other instead of sending their changed only new routing information.
Basic RIP(Legacy)Configuration
Step 01: Initial Router Configuration
Router(config)#hostname CTG_HQ
CTG_HQ(config)#interface serial 0/0/0
CTG_HQ(config-if)#ip address 1.2.3.1 255.255.255.252
CTG_HQ(config-if)#clock rate 72000
CTG_HQ(config-if)#no shutdown
CTG_HQ(config-if)#int gi0/0
CTG_HQ(config-if)#ip address 10.11.12.1 255.255.255.0
CTG_HQ(config-if)#no shutdown
CTG_HQ(config-if)#copy running-config startup-config
—--------------------------------------------------------
Router(config)#hostname CTG_B1
CTG_B1(config)#interface serial 0/0/0
CTG_B1(config-if)#ip address 1.2.3.2 255.255.255.252
CTG_B1(config-if)#no shutdown
CTG_B1(config-if)#int se0/0/1
CTG_B1(config-if)#ip address 2.3.4.1 255.255.255.252
CTG_B1(config-if)#no shutdown
CTG_B1(config-if)#clock rate 72000
CTG_B1(config-if)#int gi0/0
CTG_B1(config-if)#ip address 20.21.22.1 255.255.255.0
CTG_B1(config-if)#no shutdown
CTG_B1(config-if)#end
CTG_B1#copy running-config startup-config
—-------------------------------------------------------------------------------
Router(config)#hostname CTG_B2
CTG_B2(config)#interface serial 0/0/0
CTG_B2(config-if)#ip address 2.3.4.2 255.255.255.252
CTG_B2(config-if)#no shutdown
CTG_B2(config-if)#int gi0/0
CTG_B2(config-if)#ip address 30.40.50.1 255.255.255.0
CTG_B2(config-if)#no shutdown
CTG_B2(config-if)#end
CTG_B2#copy running-config star
CTG_B2#copy running-config startup-config
CTG_B2#show startup-config
Step 02: RIP Configuration
CTG_HQ(config)#router rip
CTG_HQ(config-router)#network 10.11.12.0
CTG_HQ(config-router)#network 1.2.3.0
CTG_HQ(config-router)#end
CTG_HQ#show ip route
CTG_HQ#show running-config
CTG_HQ#copy running-config startup-config
—--------------------------------------------------------------
CTG_B1(config)#router rip
CTG_B1(config-router)#network 1.2.3.0
CTG_B1(config-router)#network 2.3.4.0
CTG_B1(config-router)#network 20.21.22.0
CTG_B1(config-router)#end
CTG_B1#write memory
CTG_B1#show ip route
CTG_B1#show ip route rip
—--------------------------------------------------------------
CTG_B2(config)#router rip
CTG_B2(config-router)#network 2.3.4.0
CTG_B2(config-router)#network 30.40.50.0
CTG_B2(config-router)#end
CTG_B2#write memory
CTG_B2#show ip route
CTG_B2#show ip route rip
Step 03: Stop Advertisement From the Fast-Ethernet (Local Connection Port)
CTG_HQ#show ip rip database
CTG_HQ#debug ip rip
CTG_HQ#no debug ip rip
CTG_HQ(config)#router rip
CTG_HQ(config-router)#passive-interface gigabitEthernet 0/0 (local Port)
CTG_HQ(config-router)#end
CTG_HQ#debug ip rip
SUMMARY OF RELEVANT COMMAND FOR RIP CONFIGURATION
Drawback of RIP -
- Not always Loop free Protocol for fake routing information.
- Always advertisement Full Routing Table instead of New routing information.
- One of the main drawbacks is that it has a maximum hop count of 15, which limits the size and scalability of the network.
- RIP also does not support authentication, encryption, or checksum.
What is the Split Horizon Rule ? Split horizon with Poison Reverse
Split horizon is a method used by distance vector protocols to prevent network routing loops.
Firstly the basic principle is, Never send routing information back in the direction from which it was received or it was sent.
Secondly, the rule says that router will not add those routers in its routing update whose outgoing interface is same from where the routing update is forwarded.
Routing loops occur when data packets are continuously routed through the same routers, creating an endless circle for fake routing information. This can lead to network inefficiencies, inflated routing tables, and even complete routing failures.
How to Routing Loop Occurred in network
If Split Horizon Rule not working in my router interface, will be happened routing Loop in network.
- In R2 Router- When the Subnet of 10.30.22.2/24 & 100.30.21.2/24 shutdown for some reason, R2 router will not advertise to R1 Router this information. This is the reason, previous R1 Routing table will not be refreshed & updated.
- Because of failing these two subnets in R2 side, R2 omit these of two subnet's info from routing table.
- During the advertisement from R1 to R2, directly connected subnet will be refreshed at the R2 as metric 0 to 1. another common subnet for both routers remain same metric value(better metric) at the routing table. But when advertise the routing information about 10.30.22.0/24 & 100.30.22.0/24 subnets from R1 to R2 with the metric 2 (1+1=2), no routing information will be there regarding the omitting these two subnets from Router-02(R2). Besides, R2 will be update on his routing table these two subnets as metric 2 and out interface will be se0/1/0 for both, which is not correct for this network.
- Due to mis leading routing table generated into both of the Routers, they will be pointed to each other by forwarding & rotating packet (routing information) repeatedly, and routing loop will be occurred among of this entire network.
- The packet will be rotating into the network until 0 of TTL values. Ex: if TTL value 128 from starting, it will be reduced until getting 0.
Factors of Loop Preventions-
- Split Horizon rules, When enabled, split horizon prevents a router from advertising a route back to the router from which it learned a route once time.
- Poison Reverse / Route Poison, by this method- Information will be updated if some occurred/ failed/unreachable subnets in the network.
- Hold Down process & Hold down timer- Hold down process is a mechanism that prevent updating route information cause of routing loop. When a subnet suddenly goes down from the network, the routers will be hold for a while so that other routers may know and ensure to stop the link, this process is called hold down process. Hold down timer called to stop for a certain time to update route information from other routers after receiving the poison reverse advertisement. By Default it will paused 180 sec for further route updating.
Poison Reverse/Route Poison
Poison Reverse have another name is called Route Poisoning. Max Route Poison Metric is 16. On the other hand, RIP max Metric 15. RIP calculate 15 Hop count to reach data packet to destination point.
Route poisoning is a networking technique that prevents routers from sending data packets to invalid routes. Any routing information will be synced to each other routers accordingly.
Advantages:
- It's used to maintain network stability and prevent routing loops, which can cause network congestion, packet loss, and wasted bandwidth
- If split horizon with poison reverse is used, the Inactive Router will be advertised to Connected another Router that the distance marked as infinite, indicating that the network is unreachable via this route.
Contiguous and Discontiguous Networks Concept By RIPv2 Configuration
The difference between contiguous and discontiguous networks is the subnet mask:
Contiguous network: Has the same subnet mask end to end and is in the same class A, B, or C.
Discontiguous network: Has a different subnet mask end to end but is in the same class A, B, or C. Discontiguous Network is a Network that has two or more subnetworks of classful networks connecting together by different classful networks.
To route between discontinuous networks using RIPv2, you can disable the default auto-summarization behavior. For example, given below pictures.
Configuring Discontiguous Network by RIPv2 for all Branch’s Routers
CTG_HQ(config)#router rip
CTG_HQ(config-router)#network 1.2.3.0
CTG_HQ(config-router)#network 172.31.100.0
CTG_HQ(config-router)#version 2
CTG_HQ(config-router)#no auto-summary
CTG_HQ(config-router)#passive-interface gi0/0
—-------------------------------------------------------------------------------
CTG_B_R1(config)#router rip
CTG_B_R1(config-router)#network 1.2.3.4
CTG_B_R1(config-router)#network 172.31.100.4
CTG_B_R1(config-router)#network 1.2.3.0
CTG_B_R1(config-router)#version 2
CTG_B_R1(config-router)#no auto-summary
CTG_B_R1(config-router)#passive-interface gi0/0
—---------------------------------------------------------------------------------
CTG_B_R2(config)#router rip
CTG_B_R2(config-router)#network 1.2.3.4
CTG_B_R2(config-router)#network 172.31.100.8
CTG_B_R2(config-router)#version 2
CTG_B_R2(config-router)#no auto-summary
CTG_B_R2(config-router)#passive-interface gi0/0
Checking the RIPv2 Configuration
