The short name of the Routing Information Protocol Rip (Routing information Protocol), which is a protocol based on the distance vector (distance-vector) algorithm, uses the hop count as a measure to measure the distance to the destination network. RIP is primarily used in small-scale networks.
Learning Goals:
1. Master RIP's basic working principle
2. Grasp the configuration of RIP
Routing Information Protocol--rip
RIP is a relatively simple internal gateway protocol. RIP uses a distance vector-based Bayesian-Ford algorithm (Bellman-ford) to calculate the best path to a destination network.
The initial RIP protocol was developed earlier, so the bandwidth, configuration, and management requirements are low, so RIP is primarily suitable for smaller networks.
The related parameters defined in the RIP protocol are also relatively small. For example, it does not support VLSM and CIDR, nor does it support authentication features.
How RIP works
When the router starts, only direct-attached routes are included in the routing table. After the RIP is run, the router sends a request message that requests RIP routing for the neighbor router. When a neighbor router running RIP receives the request message, it generates a response message to reply based on its own routing table. After the router receives the response message, it adds the corresponding route to its own routing table.
After the RIP network is stable, each router periodically advertises its routing information in its entire routing table to the neighbor router, with a default period of 30 seconds. The neighbor router refreshes its own routing table based on the routing information received.
RIP Metrics
RIP uses a hop count as a measure to measure the distance to the destination network. In RIP, the router has a hop count of 0 to the network directly connected to it, plus 1 hops per router. To limit the convergence time, RIP specifies that the hop count range is an integer between 0~15, and a hop number greater than 15 is defined as infinity, which means that the destination network or host is unreachable.
When a router receives a routing update message from a neighbor router, the router's RIP routing table is updated according to the following guidelines:
1. For a route item that is already in this routing table, when the next hop of the route item is the neighbor router, the route item is updated regardless of whether the measure is increased or decreased (the measure is zeroed only when its aging timer is in the same value). Each route entry in the routing table corresponds to an aging timer, and when the route entry does not have any updates within 180 seconds, the timer times out and the measure of the route entry becomes unreachable.
2. If the next hop of the route item is not the neighbor router, the route item is updated if the measure is reduced.
3. For a route entry that does not exist in this routing table, if the measure is less than 16, the route entry is incremented in the routing table.
When a route item's measure becomes unreachable, the route is published four times (120 seconds) in the Response message and then purged from the routing table.
In this example, the router RTA learns the routing information through two interfaces, each with a corresponding measure, and the best route to the destination network is calculated from these metrics.
RIPv1 VS. RIPv2
RIP includes two versions of RIPV1 and RIPv2. RIPV1 is a class routing protocol that does not support VLSM and CIDR. RIPv2 is a classless routing protocol that supports VLSM and supports routing aggregation and CIDR.
RIPV1 using broadcasts to send messages; RIPV2 has two modes of transmission: Broadcast and multicast, the default is multicast mode. The multicast address for the RIPV2 is 224.0.0.9. The advantage of group advertisement is that the network segments that do not run rip in the same networks can avoid receiving RIP broadcast messages, and the group advertisement delivery paper can also prevent the network segment running RIPV1 from mistakenly receiving and processing routes with subnet masks in RIPv2.
RIPV1 does not support authentication functions, RIPV2 supports clear text authentication and MD5 ciphertext authentication.
RIPV1 Message Format
The RIP protocol exchanges routing information over UDP, with a port number of 520. The RIPV1 sends the routing information in broadcast form, the destination IP address is the broadcast address 255.255.255.255.
The value and function of each field in the message format:
1. Command: Indicates whether the message is a request message or a response message and can only fetch 1 or 2. 1 indicates that the message is a request message and 2 indicates that the message is a response message.
2. Version: Represents the release information for the RIP. For RIPV1, the value of this field is 1.
3. Address Family Identifier (AFI): Represents the identity information for an IP protocol with a value of 2.
4. IP Address: Represents the destination IP addresses for this routing entry. This can be a network address, a host address.
5. Metric: A measure that identifies the route entry, with a value range of 1-16.
A RIP routing update message can contain up to 25 route table entries, each of which carries the address and metrics of the destination network. The entire RIP message size is limited to no more than 504 bytes. If the update message for the entire routing table exceeds this size, multiple RIPV1 messages need to be sent.
RIPV2 Message Format
The RIPV2 is expanded on the basis of RIPV1, but the RIPV2 message format is still similar to RIPV1.
The different fields are as follows:
1. AFI: The address family identifier can also be used to describe authentication information in addition to the type of protocol that is supported.
2. Route tag: Used to mark external routes.
3. Subnet Mask: Specifies the subnet mask of the IP address, which defines the network or subnet portion of the IP address
Score of
4. Next hop: Specify the next hop IP address that leads to the destination address.
RFC1723 has analyzed and discussed the compatibility of RIPV1 and RIPv2, which is no longer described here.
ripv2--Certification
The RIPV2 authentication feature is a method for filtering malicious routing information, which checks packets received from a valid peer device based on the key value. This key value is a display cipher string that can be configured on each interface, with a value of 2 for the corresponding authentication type (authentication type).
The early RIPV2 only supported simple clear-text authentication and was less secure because the plaintext authentication cipher string could be intercepted easily. With the increasing demand for RIP security, RIPV2 introduced cryptographic authentication capabilities, which began with support for MD5 authentication (RFC 2082), and later enhanced security through support for Hmac-sha-1 authentication (RFC 2082). The Huawei AR2200 Series routers support all the authentication methods mentioned above, and this example only describes the principle of simple clear text authentication.
rip--Loop
This example describes the formation of a RIP network routing loop.
, when the RIP network is operational, RTA learns the route to the 10.0.0.0/8 network through RTB, with a measure of 1. Once the router RTB's direct-attached network 10.0.0.0/8 has failed, RTB detects the failure immediately and considers the route unreachable. At this point, RTA has not received information that the route is unreachable and will continue to send routing information to RTB with a measure of 2 to 10.0.0.0/8. RTB learns this routing information and believes it can reach the 10.0.0.0/8 network through RTA. Thereafter, the Update routing table sent by RTB leads to an update of the RTA routing table, and RTA adds a 10.0.0.0/8 network routing table entry with a measure of 3, which forms a routing loop. The process will continue until the measure is 16.
Loop avoidance-Horizontal split
RIP routing protocol introduces many mechanisms to solve the loop problem, in addition to the maximum number of hops previously described, there is a horizontal segmentation mechanism. The principle of horizontal segmentation is that the router learns from an interface and no longer sends it out from that interface. In other words, the routing of the 10.0.0.0/8 network that RTA learns from RTB will no longer be re-advertised to RTB from the RTA receiving interface, thus avoiding the generation of routing loops.
Loop avoidance-toxicity reversal
The anti-ring mechanism of RIP also includes toxicity reversal, and the implementation of the poison reversal mechanism can cause the error route to time out immediately. After a poison reversal has been configured, after the RIP has learned from an interface to a route, the hop count for that route is set to 16 when it is sent back to the neighbor router. This way, you can clear the unwanted routes in the other routing table. In this example, RTB advertises the 10.0.0.0/8 route with a measure value of 1 to RTA, and RTA sets the route metric to 16 when it advertises to RTB. If the 10.0.0.0/8 network fails, RTB will not assume that the 10.0.0.0/8 network can be reached via RTA, thus avoiding the generation of routing loops.
Loop avoidance-triggering updates
By default, a RIP router sends a route table update to the neighbor router every 30 seconds.
When the local routing information changes, the trigger Update feature allows the router to immediately send a trigger update message to the neighbor router to notify the routing information update without waiting for the update timer to time out, thereby accelerating network convergence.
RIP Basic Configuration
RIP The [Process-id] command is used to enable the RIP process. In this command, Process-id specifies the RIP process ID. If Process-id is not specified, the command uses 1 as the default process ID.
The command version 2 can be used to enable RIPV2 to support expansion capabilities, such as support for VLSM, authentication, and so on.
The network command can be used to advertise networks in RIP, and network-address must be the address of a natural network segment. Only the interfaces in this network can receive and send RIP messages.
RIP configuration-metricin
In RIP Networks, command RIP metricin is used to modify the measures applied on the interface (note: The measure specified by the command is added to the measure of the current route). When a router's interface receives a route, the router first increments the additional measure of the interface to that route, and then joins the route to the routing table.
In this example, the RTA sends a 10.0.0.0/8 route entry with a measure of 1, and because RIP Metricin 2 is configured on the RTC's gigabitethernet0/0/0 interface, RTC adds 2 to the route entry's measure when the route reaches the RTC interface. Finally, the route has a measure value of 3.
RIP configuration-metricout
The command RIP metricout is used by routers to modify the metrics of a route when it advertises RIP routes.
In general, RIP adds 1 to the measure before forwarding the route table entry to the next hop. If the RIP metricout command is configured, only the measures configured in the command are applied. That is, when a router publishes a route, the measures configured by this command are appended to the route before the route is published, but the measures in the local routing table do not change.
In this example, by default, the 10.0.0.0/8 route entry for RTA sends a measure of 1. However, because RIP Metricout 2 is configured on the RTA gigabitethernet0/0/0 interface, RTA sets the measure value of the route entry to 2 and then sends it to RTC.
Configure horizontal split & poison reversal
Both horizontal segmentation and poison reversal are configured on a per-interface basis. By default, the RIP Split-horizon command is enabled for each interface (except for the NBMA network) to prevent routing loops. The Huawei ARG3 series routers do not support both horizontal and poison reversal configurations, so when both horizontal and poison reversal are configured on an interface, only the poison reversal takes effect.
Configuration verification
The command display RIP interface verbose is used to confirm the RIP configuration of the router interface. The relevant RIP parameters are displayed in the command echo, including the RIP version and whether horizontal segmentation and poison reversal are applied on the interface. This example shows that the RTC's gigabitethernet0/0/0 interface is configured with a ripv2,metricin of 2, and the ability to split horizontally and poison reversal is enabled.
RIP configuration-output
Command RIP output is used to configure an interface that allows a RIP update message to be sent. If you want to prohibit the specified interface from sending RIP update messages, you can run the command undo RIP outputon the interface. By default, the ARG3 series routers allow the interface to send RIP packets.
In a corporate network, you can prevent interfaces that connect to the extranet from publishing internal routes by running commands to undo RIP output .
RIP configuration-input
The RIP input command is configured to allow the specified interface to receive RIP packets.
The undo Rip Input command is used to prohibit the specified interface from receiving RIP packets. After you run the command undo RIP input , the RIP messages received by the interface are discarded immediately. By default, the interface can receive RIP messages.
Suppress interface
The silent-interface command is used to suppress the interface so that it receives only RIP messages, updates its own routing table, but does not send RIP messages.
Command silent-interface has higher precedence than command RIP input and rip output . The command silent-interface All means that all interfaces are suppressed, this command has the highest precedence, and all interfaces are suppressed after the command is configured.
The command silent-interface is typically configured on the NBMA network. On NBMA networks, some routers need to receive RIP update messages but do not need to broadcast or multicast routers themselves for routing updates, but rather to establish a relationship with peer routers by commanding peers.
Configuration verification
The command display RIP provides a more complete picture of RIP information on the router, including global parameters and some interface parameters. For example, the command can show which interfaces performed the silent-interface command.
Summarize
When was the number of RIP routing bars increased?
For:
The number of route bars for RIP is increased before the router issues a routing advertisement.
19.hcna-hntd--Distance Vector Routing protocol RIP