【问题标题】:Opendaylight, Mininet and Ubuntu. No ARP, no pingOpendaylight、Mininet 和 Ubuntu。没有ARP,没有ping
【发布时间】:2014-08-26 00:19:36
【问题描述】:

总结: 我无法在使用 Opendaylight 和 Mininet 的主机之间 ping 通,希望能得到一些关于可能是什么问题的指导。

设置和我到目前为止所做的事情: 我已经被困在这两天了,似乎找不到任何关于它的东西。我有一台运行 VMware Workstation 10.0.3 的 Win7 笔记本电脑。我已经使用 Opendaylight 安装了 Ubuntu 12.04,并且运行了 Mininet 2.0。所有 NIC 均已桥接。我可以在它们之间ping通。在 Win7 上运行 Firefox、Putty 和 Xming。我可以登录 Opendaylight。

使用以下命令打开 Putty 并启动 Mininet:sudo mn --mac --controller=remote,ip=192.168.0.118,port=6633 我得到创建网络等的正常响应。Ping 失败。在 Wireshark 中,我看到 ARP 请求但没有答案。控制器现在显示开关。添加网关 10.0.0.254/8 使控制器可以看到主机,但仍然无法 ping。我仍然看到 ARP 请求,但没有答案。我按照说明删除了网关并安装了流程。没有 ping。

我已尝试从 VM 本身执行所有这些操作,跳过 Putty 和笔记本电脑,结果相同。我也尝试过使用 Ubuntu 14.04 和 Mininet 2.10。结果相同。我一直在阅读 Opendaylight wiki,显然没有其他人有这个问题。这意味着我必须缺少一些基本的东西。我就是不知道是什么。

编辑,MININET 输出: (如下要求)

mininet> s1 ovs-ofctl dump-flows s1
ovs-ofctl: 127.0.0.1 is not a bridge or a socket
mininet> s1 ovs-ofctl dump-flows "s1"
NXST_FLOW reply (xid=0x4):
mininet>

所以在控制器上创建的流还没有传递到 Mininet?

再次您好,感谢您的意见。我试着按照你的例子来信,下面是我得到的:

Last login: Thu Jul 10 13:56:17 2014

mininet@mininet-vm:~$ sudo mn --mac --controller=remote,ip=192.168.0.115,port=6633
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2
*** Adding switches:
s1
*** Adding links:
(h1, s1) (h2, s1)
*** Configuring hosts
h1 h2
*** Starting controller
*** Starting 1 switches
s1
*** Starting CLI:
mininet> pingall
*** Ping: testing ping reachability
h1 -> X
h2 -> X
*** Results: 100% dropped (0/2 received)

mininet> s1 ovs-ofctl show "s1"
OFPT_FEATURES_REPLY (xid=0x1): dpid:0000000000000001
n_tables:255, n_buffers:256
capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
 1(s1-eth1): addr:a6:fc:ac:e6:ab:2a
     config:     0
     state:      0
     current:    10GB-FD COPPER
     speed: 10000 Mbps now, 100 Mbps max
 2(s1-eth2): addr:2e:8a:70:b0:48:82
     config:     0
     state:      0
     current:    10GB-FD COPPER
     speed: 10000 Mbps now, 100 Mbps max
 LOCAL(s1): addr:1a:74:aa:bb:5a:49
     config:     PORT_DOWN
     state:      LINK_DOWN
     speed: 100 Mbps now, 100 Mbps max
OFPT_GET_CONFIG_REPLY (xid=0x3): frags=normal miss_send_len=0
mininet>
mininet>
mininet> s1 ovs-ofctl add-flow "s1" priority=1,ip,nw_dst=10.0.0.2,actions=mod_dl_dst:00:00:00:00:00:02,output=2
mininet> s1 ovs-ofctl add-flow "s1" priority=1,ip,nw_dst=10.0.0.1,actions=mod_dl_dst:00:00:00:00:00:01,output=1
mininet>
mininet>
mininet> s1 ovs-ofctl dump-flows "s1"
NXST_FLOW reply (xid=0x4):
 cookie=0x0, duration=44.765s, table=0, n_packets=0, n_bytes=0, idle_age=44, priority=1,ip,nw_dst=10.0.0.1 actions=mod_dl_dst:00:00:00:00:00:01,output:1
 cookie=0x0, duration=71.05s, table=0, n_packets=0, n_bytes=0, idle_age=71, priority=1,ip,nw_dst=10.0.0.2 actions=mod_dl_dst:00:00:00:00:00:02,output:2
mininet>
mininet>
mininet> pingall
*** Ping: testing ping reachability
h1 -> X
h2 -> X
*** Results: 100% dropped (0/2 received)
mininet> h1 ping -c2 h2
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
From 10.0.0.1 icmp_seq=2 Destination Host Unreachable

--- 10.0.0.2 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 999ms
pipe 2
mininet>

我运行了与上面列表中相同的命令,得到了相同的结果。然后我运行了您建议的命令,如下所示,这是输出。我不知道输出中列出了两个控制器,但连接的一个是正确的,具有正确的 IP 地址。

mininet>
mininet> s1 ovs-vsctl list controller
_uuid               : 5c50bc34-725b-497c-86f2-e0b8eafc34f9
connection_mode     : []
controller_burst_limit: []
controller_rate_limit: []
enable_async_messages: []
external_ids        : {}
inactivity_probe    : []
is_connected        : true
local_gateway       : []
local_ip            : []
local_netmask       : []
max_backoff         : 1000
other_config        : {}
role                : other
status              : {sec_since_connect="395", state=ACTIVE}
target              : "tcp:192.168.0.115:6633"

_uuid               : e5ba6cf2-dd48-4c2b-88b7-4546e90f98d0
connection_mode     : []
controller_burst_limit: []
controller_rate_limit: []
enable_async_messages: []
external_ids        : {}
inactivity_probe    : []
is_connected        : false
local_gateway       : []
local_ip            : []
local_netmask       : []
max_backoff         : 1000
other_config        : {}
role                : []
status              : {}
target              : "ptcp:6634"
mininet>

我确实在控制器上运行了 ss 命令,一切都显示为“活动”或“已解决”。

【问题讨论】:

  • 有点不清楚你在问什么。我建议您编辑并添加您问题的简短摘要版本。
  • 你为网桥添加流规则了吗?
  • 我通过单击“添加流”按钮将流(单向)添加到“流”选项卡下的控制器。我还有其他地方需要添加它们吗?我想我对“桥”这个词有点困惑,我以为它们被称为开关。我将再次浏览文档以确保我们谈论的是同一件事。
  • 我们谈论的是同一件事,因为“桥”在 OvS 的文档中随处可见,即使它是一个开关(参见常见问题解答)。 «问:我认为 Open vSwitch 是一个虚拟以太网交换机,但文档一直在谈论网桥。什么是桥? A:在网络中,术语“桥”和“交换机”是同义词。 Open vSwitch 实现了一个以太网交换机,这意味着它也是一个以太网桥。»
  • 您可以编辑您的帖子并在 xterm 或 mininet CLI «s1 ovs-ofctl dump-flows "s1"» 中添加 «ovs-ofctl dump-flows s1» 的结果吗? (如果您使用默认的 mininet 网络,我认为 s1 是网桥(交换机)的名称)。

标签: ubuntu opendaylight mininet sdn


【解决方案1】:

我仍然不知道问题出在哪里,但解决办法是回到原点,重新做所有事情。这次我没有下载预建的 Opendaylight 应用程序,而是自己构建的。无论如何,我都不是 Linux 专家,这就是为什么我以前不愿意这样做。然而,从源头构建显然有所作为。一切都安装和配置好了,现在我有了一个可以工作的控制器。

非常感谢您提供的有关查找位置和查找内容的所有帮助和提示。非常感谢。

【讨论】:

【解决方案2】:

似乎交换机没有任何流规则。您必须手动添加它们。

如果您的网络中有超过 1 个主机(并且在 ping 主机之间没有隧道),mininet CLI 中的“pingall”应该可以工作,因为它会自动将流规则添加到交换机

我使用相同的配置

mn --mac --controller=remote,ip=192.168.2.4,port=6633

我可以 ping 主机,但我们认为它不起作用并删除现有规则。

我使用的网络是默认网络,即 2 台主机连接到同一个交换机

mininet> net
h1 h1-eth0:s1-eth1
h2 h2-eth0:s1-eth2
s1 lo:  s1-eth1:h1-eth0 s1-eth2:h2-eth0
c0

由于流表为空,我们需要向交换机添加流。 所以我们必须知道它使用的端口。

mininet> s1 ovs-ofctl show "s1"
OFPT_FEATURES_REPLY (xid=0x2): dpid:0000000000000001
n_tables:254, n_buffers:256
capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
 1(s1-eth1): addr:6e:ab:c5:6d:e5:ad
     config:     0
     state:      0
     current:    10GB-FD COPPER
     speed: 10000 Mbps now, 0 Mbps max
 2(s1-eth2): addr:da:64:44:ec:d9:66
     config:     0
     state:      0
     current:    10GB-FD COPPER
     speed: 10000 Mbps now, 0 Mbps max
 LOCAL(s1): addr:c2:53:40:c8:d9:4b
     config:     0
     state:      0
     speed: 0 Mbps now, 0 Mbps max
OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0

我们现在知道 «h1 连接到端口 1 的 s1-eth1» 并且 «h2 连接到端口 2 的 s1-eth2»

要从 h1 ping 到 h2,请添加更改 host_ip 和 host_mac 的规则(最终适应您自己的网络拓扑)

mininet> s1 ovs-ofctl add-flow "s1" priority=1,ip,nw_dst=<host2_ip>,actions=mod_dl_dst:<host2_mac>,output=2
mininet> s1 ovs-ofctl add-flow "s1" priority=1,ip,nw_dst=<host1_ip>,actions=mod_dl_dst:<host1_mac>,output=1

让我们验证流表

mininet> s1 ovs-ofctl dump-flows "s1"
NXST_FLOW reply (xid=0x4):
 cookie=0x0, duration=14.02s, table=0, n_packets=0, n_bytes=0, idle_age=14, priority=1,ip,nw_dst=10.0.0.2 actions=mod_dl_dst:00:00:00:00:00:02,output:2
 cookie=0x0, duration=7.692s, table=0, n_packets=0, n_bytes=0, idle_age=7, priority=1,ip,nw_dst=10.0.0.1 actions=mod_dl_dst:00:00:00:00:00:01,output:1

现在主机可以互相ping通了!

mininet> h1 ping -c2 h2
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=43.9 ms
64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=0.100 ms

如果您的网络不同,您可以调整规则,但步骤相同

【讨论】:

  • 我将您的建议结果添加到原帖中。
  • 首先,你的控制器在运行吗? mininet&gt; s1 ovs-vsctl list controller(您应该将 is_connected 设置为 true)如果控制器未运行,请登录 OpenDayLight VM 并运行它。然后在 osgi CLI 中通过键入 ss 验证是否所有模块都已加载(即处于活动状态)
  • 在原帖中添加了命令的输出。虽然没有任何区别......
  • 现在我没有解决您的问题的方法,因为即使我重新安装并重新启动您的配置,我也没有这个问题。也许尝试选项 -v debug 来打印调试消息
  • 为了确保问题不是您的标准拓扑,您可以更改 mininet 使用的交换机版本--swith=ivs or ovsk or ovsl or user。您也可以更改网络的标准拓扑(使用带有 2 个开关的选项 --topo=linear=2 或对于 2high 树的 --topo=tree,2拓扑,即带有 3 个开关)
【解决方案3】:

我遇到了和上面一样的情况。这个命令对我有用:

 sudo mn --mac --arp --controller=remote,ip=192.168.1.33,port=6633

【讨论】:

    【解决方案4】:

    我认为您应该添加另一个允许 ARP 请求的流程,如下所示:

    mininet> sh ovs-ofctl add-flow s1 dl_type=0x806,nw_proto=1,actions=flood

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-01-17
      • 1970-01-01
      • 2017-04-04
      • 2012-09-08
      • 2018-10-21
      • 1970-01-01
      • 2018-01-17
      • 1970-01-01
      相关资源
      最近更新 更多