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

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

相关推荐
cocologin19 分钟前
RIP 技术深度解析
运维·网络·网络协议
cv高级工程师YKY29 分钟前
SRE - - PV、UV、VV、IP详解及区别
大数据·服务器·uv
眠修1 小时前
Kuberrnetes 服务发布
linux·运维·服务器
GalaxyPokemon1 小时前
RPC-Client模块
网络·网络协议·rpc
chirrupy_hamal2 小时前
如何避免 SYN 攻击?
网络·tcp
BAOYUCompany2 小时前
暴雨服务器成功中标华中科技大学集成电路学院服务器采购项目
运维·服务器
guojl2 小时前
深度解决大文件上传难题
架构
DemonAvenger3 小时前
Go语言中的TCP编程:基础实现与最佳实践
网络协议·架构·go
怦然星动_3 小时前
ip网络基础
网络·智能路由器
数据与人工智能律师3 小时前
数字资产革命中的信任之锚:RWA法律架构的隐形密码
大数据·网络·人工智能·云计算·区块链