RIP协议在简单网络架构的使用

目录

注意:本文的配置为上文《复杂园区网基本分支的构建》拓展,主要记录rip协议在简单网络架构的使用。

RIP(Routing Information Protocol,路由信息协议)是一种基于距离向量算法的内部网关协议(IGP),用于在局域网或广域网中交换路由信息。

基本概念

  • 距离向量算法:RIP使用距离向量算法来计算到达目的地的最佳路径。每个路由器维护一个路由表,记录到达每个目的地的距离和下一跳路由器。距离通常以跳数(hop count)来表示。
  • 跳数(Hop Count):RIP使用跳数作为度量标准,跳数表示从源到目的地之间经过的路由器数量。RIP协议的最大跳数限制为15跳,超过15跳的网络被视为不可达。

路由更新机制

  • 定期广播:RIP路由器每隔30秒向相邻路由器广播自己的路由表信息。这种定期广播机制确保网络中的路由信息能够及时更新。
  • 触发更新:当路由器的路由表发生变化时(如发现更优路径或路径失效),会立即向相邻路由器发送触发更新,以快速传播路由变化信息。
  • 水平分割(Split Horizon):为避免路由环路,RIP采用水平分割技术。一个路由器不会向其接收路由信息的接口发送相同的路由信息。
  • 毒性逆转(Poison Reverse):当路由器从某个接口接收到路由信息后,会将该路由的跳数设置为无穷大(通常为16),再从该接口发送出去,以防止路由环路。
  • 计时器
    • 路由超时计时器:如果在180秒内未收到某个路由的更新信息,该路由将被标记为不可达。
    • 垃圾收集计时器:被标记为不可达的路由会在300秒后从路由表中删除。

特点与局限性

  • 优点
    • 实现简单:RIP协议结构简单,易于实现和维护。
    • 适合小型网络:对于小型网络或拓扑结构相对稳定的网络,RIP能够有效工作。
  • 缺点
    • 收敛速度慢:由于定期广播和跳数限制,RIP在大型网络或拓扑变化频繁的网络中收敛速度较慢。
    • 路径选择有限:最大跳数限制为15跳,限制了RIP在大型网络中的应用。
    • 路由环路风险:在复杂网络中,RIP容易产生路由环路,尽管有水平分割和毒性逆转等机制来减少环路风险,但无法完全避免。

RIP协议适用于小型、稳定的网络环境,对于大型或拓扑变化频繁的网络,通常会选择其他更先进的路由协议,如OSPF(开放最短路径优先)或EIGRP(增强内部网关路由协议)等。

场景模拟

网络拓扑

配置新加的接口

bash 复制代码
<R-1>system-view 
Enter system view, return user view with Ctrl+Z.
[R-1]interface GigabitEthernet 0/0/3
[R-1-GigabitEthernet0/0/3]ip address 10.0.0.9 30
[R-1-GigabitEthernet0/0/3]quit
[R-1]quit
<R-1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 17.
Save the configuration successfully.
<R-1>
<R-1>
bash 复制代码
<R-3>system-view 
Enter system view, return user view with Ctrl+Z.
[R-3]interface GigabitEthernet 0/0/3
[R-3-GigabitEthernet0/0/3]ip address 10.0.0.10 30
[R-3-GigabitEthernet0/0/3]quit
[R-3]quit
<R-3>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 17.
Save the configuration successfully.
<R-3>

配置rip并测试

bash 复制代码
<RS-1>sys	
<RS-1>system-view 
Enter system view, return user view with Ctrl+Z.
[RS-1]rip 1
[RS-1-rip-1]version 2
[RS-1-rip-1]network 192.168.100.0
[RS-1-rip-1]network 192.168.101.0
[RS-1-rip-1]network 10.0.0.0
[RS-1-rip-1]quit
[RS-1]quit
<RS-1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<RS-1>
bash 复制代码
<RS-2>system-view 
Enter system view, return user view with Ctrl+Z.
[RS-2]rip 1
[RS-2-rip-1]version 2	
[RS-2-rip-1]network 192.168.102.0
[RS-2-rip-1]network 192.168.103.0
[RS-2-rip-1]network 10.0.0.0
[RS-2-rip-1]quit
[RS-2]quit
<RS-2>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<RS-2>
bash 复制代码
<RS-3>system-view 
Enter system view, return user view with Ctrl+Z.
[RS-3]rip 1
[RS-3-rip-1]version 2
[RS-3-rip-1]network 192.168.104.0
[RS-3-rip-1]network 192.168.105.0
[RS-3-rip-1]network 10.0.0.0
[RS-3-rip-1]quit
[RS-3]quit
<RS-3>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<RS-3>
bash 复制代码
<RS-4>system-view 
Enter system view, return user view with Ctrl+Z.
[RS-4]rip 1
[RS-4-rip-1]version 2
[RS-4-rip-1]network 192.168.106.0
[RS-4-rip-1]network 192.168.107.0
[RS-4-rip-1]network 10.0.0.0
[RS-4-rip-1]quit
[RS-4]quit
<RS-4>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<RS-4>
bash 复制代码
<R-1>system-view 
Enter system view, return user view with Ctrl+Z.
[R-1]rip 1
[R-1-rip-1]version 2
[R-1-rip-1]network 10.0.0.0
[R-1-rip-1]quit
[R-1]quit
<R-1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 17.
Save the configuration successfully.
<R-1>
bash 复制代码
<R-2>system-view 
Enter system view, return user view with Ctrl+Z.
[R-2]rip 1
[R-2-rip-1]version 2
[R-2-rip-1]network 10.0.0.0
[R-2-rip-1]quit
[R-2]quit
<R-2>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 17.
Save the configuration successfully.
<R-2>
bash 复制代码
<R-3>system-view 
Enter system view, return user view with Ctrl+Z.
[R-3]rip 1	
[R-3-rip-1]version 2
[R-3-rip-1]network 10.0.0.0
[R-3-rip-1]quit
[R-3]quit
<R-3>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 17.
Save the configuration successfully.
<R-3>

查看R-1路由表,已经可以通过动态路由协议RIP获取到达非直连网络路由,其中如图,优先级为100,度量值为2,到达目标网络需要2个路由设备。

192.168.104.0/24 RIP 100 2 D 10.0.0.10 GigabitEthernet 0/0/3

192.168.105.0/24 RIP 100 2 D 10.0.0.10 GigabitEthernet 0/0/3

192.168.106.0/24 RIP 100 2 D 10.0.0.10 GigabitEthernet 0/0/3

192.168.107.0/24 RIP 100 2 D 10.0.0.10 GigabitEthernet 0/0/3

最后测试通信情况,每两台主机之间能够互相通信。

相关推荐
_板栗_4 分钟前
HTTP 错误状态码以及常用解决方案
网络·网络协议·http
生命不息战斗不止(王子晗)19 分钟前
mybatis中${}和#{}的区别
java·服务器·tomcat
镜舟科技28 分钟前
湖仓一体架构在金融典型数据分析场景中的实践
starrocks·金融·架构·数据分析·湖仓一体·物化视图·lakehouse
熙曦Sakura30 分钟前
【Linux网络】 HTTP cookie与session
linux·网络·http
Ramseyuu41 分钟前
Mybatis-plus
微服务·云原生·架构
yyy0002001 小时前
BGP联邦实验
网络
Ha-gd1 小时前
Linux基础开发工具一(yum/apt ,vim)
linux·服务器
为美好的生活献上中指1 小时前
java每日精进 5.11【WebSocket】
java·javascript·css·网络·sql·websocket·网络协议
三天不学习1 小时前
如何配置光猫+路由器实现外网IP访问内部网络?
网络·tcp/ip·智能路由器
charlie1145141911 小时前
内核深入学习3——分析ARM32和ARM64体系架构下的Linux内存区域示意图与页表的建立流程
linux·学习·架构·内存管理