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

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

相关推荐
DC_BLOG25 分钟前
Linux-GlusterFS进阶分布式卷
linux·运维·服务器·分布式
yourkin66634 分钟前
TCP...
服务器·网络·tcp/ip
cookies_s_s1 小时前
Linux--进程(进程虚拟地址空间、页表、进程控制、实现简易shell)
linux·运维·服务器·数据结构·c++·算法·哈希算法
大腕先生1 小时前
微服务环境搭建&架构介绍(附超清图解&源代码)
微服务·云原生·架构
文军的烹饪实验室2 小时前
处理器架构、单片机、芯片、光刻机之间的关系
单片机·嵌入式硬件·架构
猫头虎-人工智能2 小时前
NVIDIA A100 SXM4与NVIDIA A100 PCIe版本区别深度对比:架构、性能与场景解析
gpt·架构·机器人·aigc·文心一言·palm
阿里妈妈技术2 小时前
提效10倍:基于Paimon+Dolphin湖仓一体新架构在阿里妈妈品牌业务探索实践
架构
诶尔法Alpha2 小时前
Linux上使用dify构建RAG
linux·运维·服务器
哑巴语天雨2 小时前
前端面试-网络协议篇
websocket·网络协议·http·面试·https
JAMES费3 小时前
figure机器人技术架构的演进初探——Helix人形机器人控制的革新
架构·机器人