Route information protocol (RIP): is the most widely used protocol in the internal gateway protocol. It is a distributed Distance Vector-based routing protocol.
The routing information protocol (RIP) requires that every vro in the network maintain a distance record from itself to the destination network. The distance here refers to the number of vrouters that need to pass through to the destination network.
The distance in RIP is also called the number of hops. Each time a router passes through a route, the number of hops is increased by 1. the RIP Protocol requires that the maximum number of routes that a path can contain is 15, that is, the RIP Protocol is only applicable to small networks.
The RIP Protocol cannot use multiple routes between two networks. It selects a route with the least number of routes, even if there is a faster route with more routers.
We know that every vro constantly needs to exchange information with other vrouters. But what vrouters do we need to exchange information? What information is exchanged? When to exchange information?
RIP Protocol features:
(1) Exchange Routing information only with the adjacent routers. The adjacent communication means that the communication does not need to go through other routers;
(2) the exchanged information is all routing information that the current vro knows;
(3) Exchange route information at fixed intervals;
The most important information in a route table is the distance to a certain network and the next hop router. The update principle is to find the shortest distance to the target network.
The rip protocol uses the distance vector algorithm.
The base of the distance vector algorithm is the Bellman-Ford algorithm. The steps of the distance vector algorithm are as follows:
(1) For Rip packets sent from neighboring routers whose IP address is X, first modify all items in the packet: Change the next hop address to X and set the distance field (number of hops) add 1. Each project contains three valid fields: destination network N, distance (number of hops) d, and next hop route X.
(2) compare each item in the modified rip packet by following the steps below:
L if no destination network N exists in the original route table, add it to the route table of the vro.
L otherwise (if the original route table contains the destination network N, you need to check the next hop address), if the next hop router address is X, replace the project in the route table with the received project. If the next hop route address is not X, the distance between the received project (number of hops) Item D and the current vro (number of hops) is compared. If it is less, the number of hops on the current vro is updated. Otherwise, nothing is done.
(3) If the route table of the adjacent router has not been updated three minutes later, the adjacent router is recorded as an inaccessible router and the distance is set to 16.
The RIP Protocol regularly exchanges route information between neighboring routers in a self-made system, so that the distance between each router and the destination network is the shortest.
The rip transport layer uses the UDP-oriented connectionless transport layer protocol.
The rip packet consists of the header and the routing part.
The header consists of four bytes. The first byte is the command field, which indicates the meaning of the current message, and 1 indicates the request route information, 2 indicates a response to the request route information or a route update packet automatically sent without a request. The second byte indicates the version number, and the last two bytes are all in the 0 domain, which is used for 4-byte alignment.
A route consists of up to 25 route entries. Each route entry consists of 20 bytes. The format is as follows:
It must be noted that the address family identifier is used to identify the address protocol used, and the routing mark is filled with the self-made system number ASN. The distance field is 1-16, 1 indicates direct delivery, 16 indicates inaccessible.
Rip2 supports the side-length subnet mask and CIDR. It also provides a simple authentication process that supports multicast.
When the authentication function is used, rip2 occupies a route information, stores 0 xFFFF in the address family identifier of the route information, and adds the authentication type to the route tag field. At this time, you can only transmit up to 24 route information.
Advantages and disadvantages of RIP:
(1) Advantages: simple implementation and low overhead.
(2) restricted network scale. The routing information exchanged between routers is the complete route table of the router. As the network increases, the overhead will also increase.
(3) The slow propagation of "bad messages" leads to a long convergence process of updates.