Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

RIP Protocol for dynamic routing

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

one。 Overview of RIP Protocol for dynamic routing

RIP protocol was originally designed for the Xerox parc general protocol of Xerox network system, and it is a commonly used routing protocol in Internet. RIP uses the distance vector algorithm, that is, the router chooses a route according to the distance, so it is also called the distance vector protocol. The router collects all the different paths that can reach the destination and saves path information about the minimum number of sites to reach each destination, discarding any information except the best path to the destination. At the same time, the router also notifies the neighboring routers of the collected routing information using RIP protocol. In this way, the correct routing information gradually spread to the whole network. `

RIP is widely used. It is simple, reliable, and easy to configure. However, RIP is only suitable for small, homogeneous networks because it allows a maximum of 15 sites, and any destination with more than 15 sites is marked as unreachable. And the routing information broadcast of RIP every 30 seconds is also one of the important reasons for the broadcast storm of the network.

two。 What is a distance vector routing protocol based on a distance vector algorithm: also known as Bellman-ford or Ford-Fulkerson algorithm. The origin of the distance vector name is that the route is advertised in the form of a vector (distance, direction), where the distance is determined by the metric. The popular point is: the distance in a certain direction. Periodic updates: each router periodically sends its own routing table to other routers that are directly connected. Principle: distance vector protocols directly transmit their routing table information. Routers in the network get routing information from their neighbor routers and send these routing information together with their own local routing information to other neighbors, which are passed on at one level to achieve network-wide synchronization. Each router does not know the entire network topology, they only know the network that is directly connected to them, and update their routes based on the routing information they get from their neighbors. Characteristics of RIP routing protocol RIP:Routing Information Protocol (routing Information Protocol) is a distance vector routing protocol that belongs to IGP protocol. RIP protocol is suitable for small and medium-sized networks, and there are two versions of RIPv1 and RIPv2. Among them: RIPv1 is a classful routing protocol, does not support VLSM and CIDR to send messages in the form of broadcast, does not support verifying that RIPv2 is a classless routing protocol, supports VLSM, supports route aggregation and CIDR supports sending messages in the form of broadcast or multicast (224.0.0.9), supports plaintext verification and MD5 ciphertext verification using UDP for routing information interaction, the destination port number is 520. RIP supports: split horizon (technology to avoid routing loops and speed up route aggregation), toxicity reversal (an improved split horizon) # # IV. Routing loop: update cycle 30s R1 R2 r3r3 there is a link down, its entry hop is 16 can not reach 30 seconds, R2 will learn the entry cycle of R3 30s, the entry hop of R3 will become 2 packets will be looped back by these two routers

five。 Configure the RIP protocol according to the experiment

Experimental environment: R1, R2, R3, three routers, PC1,PC2, two hosts, simulation in GNS3. Experimental purpose: hosts are interconnected, three routers learn routing tables from each other, and routing loops. # 1. In the GNS3, configure the address of the router interface and the IP address of the host PC1: 192.168.10.2/24R1F0/0: 192.168.10.1/24R1F0/1: 192.168.20.1 Universe 30 subnet mask: 255.255.255.252R2F0/0: 192.168.20.2 Unix 30 subnet mask: 255.255.255.252R2F0/1: 192.168.30.1 Universe 30 subnet mask: 255.255.255. 252R3F0/0: 192.168.30.2 Universe 30 Subnet Mask: 255.255.255.252R3F0/1: 192.168.40.1/24PC2: 192.168.40.2 Universe 24 subnet mask # 2. Configure the addresses of the two interfaces on R1 And check to see if the address is in effect R1 (config) # int f0bank 0 R1 (config-if) # ip add 192.168.10.1 255.255.255.0 / / configuration address R1 (config-if) # no shut / / enable R1 (config-if) # exR1 (config) # int * Mar 1 00config-if 036. 027:% LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up*Mar 1 0001Plus 37. 027:% LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0 Changed state to upR1 (config) # int f0/1R1 (config-if) # ip add 192.168.20.1 255.255.255.252R1 (config-if) # no shutR1 (config-if) # ex R1 (config) # * Mar 1 00VOO 01RH 58.459:% LINK-3-UPDOWN: Interface FastEthern*Mar 100R01RH 59.459:% LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upR1 (config) # do show ip route / / View routing table Codes: C-connected S-static, R-RIP, M-mobile, B-BGP D-EIGRP, EX-EIGRP external, O-OSPF, IA-OSPF inter area N1-OSPF NSSA external type 1, N2-OSPF NSSA external type 2 E1-OSPF external type 1, E2-OSPF external type 2i-IS-IS, su-IS-IS summary, L1-IS-IS level-1, L2-IS-IS level-2 ia-IS-IS inter area, *-candidate default U-per-user static route o-ODR, P-periodic downloaded static routeGateway of last resort is not setC 192.168.10.0 is subnetted 24 is directly connected, FastEthernet0/0 192.168.20.0 is directly connected 30 is subnetted, 1 subnetsC 192.168.20.0 is directly connected, FastEthernet0/1 configures the addresses of the R2 interfaces And check whether the address is valid R2 (config) # int f0/0R2 (config-if) # ip add 192.168.20.2 255.255.255.252R2 (config-if) # no shutR2 (config-if) # exR2 (config) # int fMar 1 00 LINK-3-UPDOWN 02ip add 55.115:% LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to upMar 1 00 02config-if 56.115:% LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0 Changed state to upR2 (config) # int f0/1R2 (config-if) # ip add 192.168.30.1 255.255.255.252R2 (config-if) # no shutR2 (config-if) # exR2 (config) # Mar 1 0015 0315 18.619:% LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to upMar 1 00 03int f0/1R2 19.619:% LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upR2 (config) # do show ip routeCodes: C-connected, S-static, R-RIP M-mobile, B-BGPD-EIGRP, EX-EIGRP external, O-OSPF, IA-OSPF inter area N1-OSPF NSSA external type 1, N2-OSPF NSSA external type 2E1-OSPF external type 1, E2-OSPF external type 2i-IS-IS, su-IS-IS summary, L1-IS-IS level-1, L2-IS-IS level-2ia-IS-IS inter area, *-candidate default, U-per-user static routeo-ODR, P-periodic downloaded static routeGateway of last resort is not set0/30 is subnetted 1 subnetsC 192.168.30.0 is directly connected, FastEthernet0/10/30 is subnetted, 1 subnetsC 192.168.20.0 is directly connected, FastEthernet0/0**3. Configure the two interface addresses of R3 and check whether the routing table address is in effect. R3 (config) # int f0/0R3 (config-if) # ip add 192.168.30.2 255.255.255.252R3 (config-if) # no shutR3 (config-if) # exR3 (config) # int f*Mar 100 LINK-3-UPDOWN 03config-if 56.759:% LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up*Mar 1 00VAN03VOD 57.759:% LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0 Changed state to upR3 (config) # int f0/1R3 (config-if) # ip add 192.168.40.1 255.255.255.0R3 (config-if) # no shutR3 (config-if) # exR3 (config) # * Mar 1 00VOO 04int f0/1R3 15.899:% LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up*Mar 1 00R04VOR 16.899:% LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upR3 (config) # do show ip routeCodes: C-connected, S-static R-RIP, M-mobile, B-BGP D-EIGRP, EX-EIGRP external, O-OSPF, IA-OSPF inter area N1-OSPF NSSA external type 1, N2-OSPF NSSA external type 2 E1-OSPF external type 1, E2-OSPF external type 2 I-IS-IS, su-IS-IS summary, L1-IS-IS level-1, L2-IS-IS level-2 ia-IS-IS inter area, *-candidate default, U-per-user static route o-ODR P-periodic downloaded static routeGateway of last resort is not set 192.168.30.0 take 30 is subnetted, 1 subnets

C 192.168.30.0 is directly connected, FastEthernet0/0

C 192.168.40.0/24 is directly connected, FastEthernet0/1

4. Assign RIP2 protocol to R1 And view the routing table R1 (config) # router rip / / enter the RIP protocol process R1 (config-router) # network 192.168.10.0 / announce the network segment R1 (config-router) # network 192.168.20.0 / declare the network segment R1 (config-router) # version 2 / / choose 2 protocol R1 (config-router) # no auto-summary / / turn off route summary R1 (config-router) # exR1 (config) # do show ip Route / / View routing table Codes: C-connected S-static, R-RIP, M-mobile, B-BGP D-EIGRP, EX-EIGRP external, O-OSPF, IA-OSPF inter area N1-OSPF NSSA external type 1, N2-OSPF NSSA external type 2 E1-OSPF external type 1, E2-OSPF external type 2i-IS-IS, su-IS-IS summary, L1-IS-IS level-1, L2-IS-IS level-2 ia-IS-IS inter area, *-candidate default U-per-user static route o-ODR, P-periodic downloaded static routeGateway of last resort is not set 192.168.30.0 via 30 is subnetted, 1 subnetsR 192.168.30.0 [120 ODR 1] via 192.168.20.2, 00:00:18, FastEthernet0/1C 192.168.10.0 is directly connected 24 is directly connected, FastEthernet0/0R 192.168.40.0 via 192.168.20.2, 00:00:00 FastEthernet0/1 192.168.20.0/30 is subnetted, 1 subnetsC 192.168.20.0 is directly connected, FastEthernet0/15. Assign RIP2 protocol to R2 And view the routing table R2 (config) # router ripR2 (config-router) # network 192.168.20.0R2 (config-router) # network 192.168.30.0R2 (config-router) # version 2R2 (config-router) # no auto-summaryR2 (config-router) # exR2 (config) # do show ip routeCodes: C-connected, S-static, R-RIP, M-mobile, B-BGP D-EIGRP, EX-EIGRP external, O-OSPF, IA-OSPF inter area N1-OSPF NSSA external type 1 N2-OSPF NSSA external type 2 E1-OSPF external type 1, E2-OSPF external type 2i-IS-IS, su-IS-IS summary, L1-IS-IS level-1, L2-IS-IS level-2 ia-IS-IS inter area, *-candidate default, U-per-user static route o-ODR, P-periodic downloaded static routeGateway of last resort is not set 192.168.30.0 is subnetted, 1 subnetsC 192.168.30.0 is directly connected FastEthernet0/1R 192.168.10.0/24 [120/1] via 192.168.20.1, 00:00:13, FastEthernet0/0R 192.168.40.0/24 [120/1] via 192.168.30.2, 00:00:12, FastEthernet0/1 192.168.20.0/30 is subnetted, 1 subnetsC 192.168.20.0 is directly connected, FastEthernet0/0

6.。 Assign RIP2 protocol to R3 and check the routing table```

R3 (config) # router ripR3 (config-router) # network 192.168.30.0R3 (config-router) # network 192.168.40.0R3 (config-router) # version 2R3 (config-router) # no auto-summaryR3 (config-router) # exR3 (config) # do show ip routeCodes: C-connected, S-static, R-RIP, M-mobile, B-BGPD-EIGRP, EX-EIGRP external, O-OSPF, IA-OSPF inter area N1-OSPF NSSA external type 1, N2-OSPF NSSA external type 2E1-OSPF external type 1 E2-OSPF external type 2i-IS-IS, su-IS-IS summary, L1-IS-IS level-1, L2-IS-IS level-2ia-IS-IS inter area, *-candidate default, U-per-user static routeo-ODR, P-periodic downloaded static routeGateway of last resort is not set192.168.30.0/30 is subnetted, 1 subnetsC 192.168.30.0 is directly connected, FastEthernet0/0R 192.168.10.0Gap 24 [120amp] via 192.168.30.1, 00:00:14 FastEthernet0/0C 192.168.40.0/24 is directly connected, FastEthernet0/1192.168.20.0/30 is subnetted, 1 subnetsR 192.168.20.0 [120/1] via 192.168.30.1, 00:00:14, FastEthernet0/0### 7. Assign IP addresses to two PCs and test whether they can be interconnected > PC1 > ip 192.168.10.2 192.168.10.2 192.168.10.1 > Checking for duplicate address... > PC1: 192.168.10.2 255.255.0 gateway 192.168.10.1 > PC1 > ping 192.168.40.2 > 84 bytes from 192.168.40.2 icmp_seq=1 ttl=61 time=93.730 ms > 84 bytes from 192.168.40.2 icmp_seq=2 ttl=61 time=93.728 ms > 84 bytes from 192. 168.40.2 icmp_seq=3 ttl=61 time=93.729 ms > 84 bytes from 192.168.40.2 icmp_seq=4 ttl=61 time=93.697 ms > PC2 > ip 192.168.40.2 192.168.40.1 > Checking for duplicate address... > PC1: 192.168.40.2 255.255.0 gateway 192.168.40.1 > > PC2 > ping 192.168.10.2 > 84 bytes from 192.168.10.2 icmp_seq=1 ttl=61 time=93.762 ms > 84 bytes from 192.168.10.2 icmp_seq=2 Ttl=61 time=93.729 ms > 84 bytes from 192.168.10.2 icmp_seq=3 ttl=61 time=93.729 ms > 84 bytes from 192.168.10.2 icmp_seq=4 ttl=61 time=93.695 ms > 84 bytes from 192.168.10.2 icmp_seq=5 ttl=61 time=93.696 ms## is our dynamic routing RIP protocol # # look forward to the following blog OSPF protocol

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report