首页 文章

Opendaylight,Mininet和Ubuntu . 没有ARP,没有ping

提问于
浏览
4

简介:我无法使用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 .

我试过从虚拟机本身做的所有这些,跳过Putty和笔记本电脑,结果相同 . 我也尝试过使用Ubuntu 14.04和Mininet 2.10 . 结果相同 . 我一直在阅读Opendaylight wiki,显然没有其他人有这个问题 . 这意味着我必须遗漏一些基本的东西 . 我只是想不通它是什么 .

EDIT,MININET OUTPUT :(如下所述)

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命令,所有内容都显示为“Active”或“Resolved” .

3 回答

  • 2

    我仍然不知道问题是什么,但决议是回到原点,并重新做一切 . 这次我没有下载预先构建的Opendaylight应用程序,我自己构建了它 . 我不是任何方式的Linux专家,这就是我之前不愿意这样做的原因 . 然而,从源头建设显然有所作为 . 安装和配置了所有东西,现在我有一个工作的控制器 .

    非常感谢所有帮助和提示,了解在哪里寻找,以及寻找什么 . 非常感激 .

  • 4

    看来交换机没有任何流量规则 . 您必须手动添加它们 .

    如果您的网络中有多个主机(并且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连接到s1-eth1,即端口1»,«h2连接到s1-eth2,即端口2»

    要从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
    

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

  • 0

    我和上面的情况一样 . 这个命令对我有用:

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

相关问题