我正在从事一个复杂的项目,其中包括 Linux 和 Cisco 路由器。我对网络还很陌生,而且我是第一次使用 cisco 命令行,所以请不要客气,不要犹豫,建议/纠正我。
一个简化的网络方案可能是这个 计算机在 Linux/Xenomai 下运行。他们有两个网络接口。实时数据使用 192.168.1.1 地址,只有 UDP。监控/ssh 使用的是 192.168.2.1 地址。
这两个接口连接到 Cisco 路由器,其 WAN 地址为 10.11.151.X。cisco 路由器正在对我们的数据包进行 NAT,因此它们可以穿过网络并访问远处的路由器,NAT 向后。使用端口 2100 的 192.168.1.1 进入路由器,使用端口 2100 被 natted 到 10.11.151.1,反之亦然。
我有两对不同的路由器:Cisco RV325 和 Cisco C891f-k9。C891f-k9 路由器配置如下(我在发布之前删除了用户/安全和未使用的接口):
version 15.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
boot-start-marker
boot-end-marker
!
aqm-register-fnf
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
crypto isakmp policy 1
!
interface FastEthernet0
no ip address
shutdown
duplex auto
speed auto
!
interface GigabitEthernet4
switchport access vlan 11
no ip address
!
interface GigabitEthernet5
switchport access vlan 21
no ip address
!
interface GigabitEthernet8
description PrimaryWANDesc_
ip address 10.11.151.6 255.255.255.0
ip nat outside
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
interface Vlan11
ip address 192.168.1.254 255.255.255.0
ip nat inside
ip virtual-reassembly in
!
interface Vlan21
ip address 192.168.2.254 255.255.255.0
ip nat inside
ip virtual-reassembly in
!
ip forward-protocol nd
no ip http server
no ip http secure-server
no ip http path flash
!
ip nat inside source static tcp 192.168.2.1 22 10.11.151.1 2044
!
ip nat inside source static udp 192.168.1.1 2100 10.11.151.1 2100
ip nat inside source static udp 192.168.1.1 2101 10.11.151.1 2101
ip nat inside source static udp 192.168.1.1 2102 10.11.151.1 2102
!
ip route 0.0.0.0 0.0.0.0 10.11.151.253
!
snmp-server community public RO
!
control-plane
!
mgcp behavior rsip-range tgcp-only
mgcp behavior comedia-role none
mgcp behavior comedia-check-media-src disable
mgcp behavior comedia-sdp-force disable
!
mgcp profile default
!
line con 0
no modem enable
line aux 0
line 3
modem InOut
speed 115200
flowcontrol hardware
line vty 0 4
privilege level 15
password cisco
login local
transport input telnet ssh
!
scheduler allocate 20000 1000
!
end
RV325 是一个非常基本的路由器,配置了 Web 界面。
我使用 RV325 对路由器进行了一些测试,并使用 C891f-K9 进行了相同的测试。使用这种配置,我观察到 C891F 与 RV325 相比性能较差。我无法解释这些差异。我希望高端路由器会比 RV325 做得更好,但事实恰恰相反。我在使用时检查了 C891f 的 CPU 使用率,它只有 10%。
所以我的问题是:这个配置好吗?你有什么技巧可以帮助我解决性能问题吗?是否有一些服务可以关闭以提高路由器效率/延迟?
正如我所说,我是网络和路由的新手,所以请不要犹豫寻求解释或建议。感谢您的帮助。
编辑:
感谢您的帮助。我设法做了一些测试,我们的表现仍然不好。
测试是如何进行的:我们在每台服务器上都插入了一台计算机。该计算机生成流量并记录传入流量。我们的机器配置为仅打包/解包数据包。然后我们比较发送的数据和接收的数据:我们找到对应的数据并比较时间戳。这个时间戳差异为我们提供了穿越系统所需的总时间。
对于 cisco rv325,平均值为 200µs。对于 C891F,平均值为 450µs。我还检查了直接连接到路由器的机器的 ping:rv325 ping >400µs,c891f-k9 约为 600µs。
从现在开始,我相信在配置上我无能为力了。我认为问题在于路由器本身不适合我们的需求。
编辑2:
感谢大家的帮助。这对我帮助很大。结论是这个系列的路由器不适合我们的需求。我们找到的最稳定和最有效的解决方案是在标准计算机上安装 pfSense(intel i5 with 8Go RAM and intel i350 4 ethernet ports)。有了这个,我们有大约 0.2 毫秒的延迟,没有尖峰,也没有丢包。到目前为止,这是我们目前所做的最好的事情,也可能是我们能做到的最好的事情。