RIP Protocol
RIP Protocol Introduction
RIP (Routing Information Protocol) is a simple dynamic Routing Protocol based on D-V algorithm, which is mainly used in small network. It exchanges route information through UDP and sends an update packet every 30 seconds to send all its route tables to its neighbors ). If the router fails to receive the route update packet from the peer end after 180 seconds, all route information from the router is marked as inaccessible. If the update packet is not received within the next 120 seconds, delete the route entry from the route table.
RIP uses the number of hops to measure the distance to the target network. The number of hops from a vro to a directly connected network is 0, and the number of hops from a vro to a network is 1. To limit the convergence time, RIP specifies that the maximum number of metric hops is 15, which is beyond this limit. This is the main factor that limits RIP's inability to be used in large networks.
The RIP Protocol is at the upper layer of the UDP protocol, and the route information received by RIP is encapsulated in the UDP datagram. RIP receives the route modification information from the remote router on port 520, modify the local route table and notify other routers. In this way, global route synchronization is achieved.
Implementation of RIP Protocol
System initialization
1. When RIP is started, the initial route table only contains some direct connection interface routes of the vro.
2. After the RIP Protocol is enabled, a Request packet is broadcast to each interface.
3. the RIP Protocol of the neighbor router receives the Request packet from an interface and then broadcasts the Response packet to the corresponding network based on the route table.
4. RIP receives the Response packet from the neighbor router that contains the neighbor router route table to form its own route table.
Route update
The RIP Protocol broadcasts its route table with Response packets in a cycle of 30 seconds.
After receiving the Response packet sent by the neighbor, the RIP Protocol calculates the metric value of the route entry in the packet, compares the metric value of the route entry with that of the local route table, and updates the route table.
The formula for calculating the metric value of a route entry in the message is metric = MINmetric + cost, 16 ). Here, metric is the measurement value information carried in the message, and cost is the measurement overhead of the network for receiving packets. The default value is 11 hops.
The RIP configuration takes the Cisco router as an example)
Router (config) # router rip-start the RIP route protocol
AH_CZ_TC_2500 (config-router) # network [network range | all]-specify the CIDR block. RIP only works on the interface of the specified CIDR block. For interfaces not on the specified CIDR block, RIP neither receives or sends a route on it nor forwards its interface route.
AH_CZ_TC_2500 (config-router) # version [1 | 2-specified RIP version
AH_CZ_TC_2500 (config-router) # maximum-paths [1-6]-specify the maximum number of equal-cost routes
AH_CZ_TC_2500 (config-router) # passive-interface e0-allows the eth0 port to only receive RIP groups, but not send rip groups. This command is only configured when necessary.
AH_CZ_TC_2500 (config-router) # int s0-enter a separate interface for configuration
AH_CZ_TC_2500 (config-if) # ip rip [send | receive] version [1 | 2]-You can specify the version of RIP that an interface can send or execute.
AH_CZ_TC_2500 (config-if) # ip split-horizon-you can set whether to enable horizontal segmentation.
Because there are too many commands here, we will not illustrate them one by one. For specific command formats, refer to the Cisco website or other command reference manual.