Ping 在 Mininet、RYU - OpenFlow 1.3 中失败

Ping fails in Mininet, RYU - OpenFlow 1.3

我正在使用 Mininet、RYU 控制器和 OpenFlow 1.3 创建拓扑,其中主机 h1 使用交换机 p0es0 连接到主机 h2,方法如下:

h1 h1-eth0:p0es0-eth3
h2 h2-eth0:p0es0-eth4

在我的 Ryu Controller 应用程序中,我有以下代码片段来在我的 p0es0 开关上安装规则,以便能够从 h2 到达 h1,反之亦然:

    # Install rule to forward packets destined to "10.0.0.2" (h2) via port 3
    ofproto = sw.ofproto        
    match = sw.ofproto_parser.OFPMatch( eth_type = 0x0800, ipv4_dst="10.0.0.1")
    action = sw.ofproto_parser.OFPActionOutput(4)
    inst = [sw.ofproto_parser.OFPInstructionActions(sw.ofproto.OFPIT_APPLY_ACTIONS, [action])]
    mod = sw.ofproto_parser.OFPFlowMod(datapath=sw, match=match,
           instructions=inst, cookie=0, command=ofproto.OFPFC_ADD, idle_timeout=0, 
           hard_timeout=0, priority=100, flags=ofproto.OFPFF_SEND_FLOW_REM)
    sw.send_msg(mod)


    # Install rule to forward packets destined to "10.0.0.1" (h1) via port 4
    match = sw.ofproto_parser.OFPMatch( eth_type = 0x0800, ipv4_dst="10.0.0.1")
    action = sw.ofproto_parser.OFPActionOutput(4)
    inst = [sw.ofproto_parser.OFPInstructionActions(sw.ofproto.OFPIT_APPLY_ACTIONS, [action])]
    mod = sw.ofproto_parser.OFPFlowMod(datapath=sw, match=match,
           instructions=inst, cookie=0, command=ofproto.OFPFC_ADD, idle_timeout=0, 
           hard_timeout=0, priority=100, flags=ofproto.OFPFF_SEND_FLOW_REM)
    sw.send_msg(mod)

我的 dump-flow 命令按预期确认了交换机中规则的正确安装:

*** p0es0 -------------------------------------- ----------------------

OFPST_FLOW 回复 (OF1.3) (xid=0x2):

cookie=0x0,持续时间=1103.417s,table=0,n_packets=0,n_bytes=0,send_flow_rem优先级=100,ip,nw_dst=10.0.0.2 动作=输出:4

cookie=0x0,持续时间=1103.414s,table=0,n_packets=0,n_bytes=0,send_flow_rem优先级=100,ip,nw_dst=10.0.0.1 动作=输出:3


但是,当我尝试从 h1 ping h2 或反之时,我收到目标主机无法访问错误。我尝试在 p0es0-eth3 上使用 tcpdump——我只看到 ARP 请求数据包。

我是不是漏掉了什么?

谢谢。

我是 运行 没有 arp 标志的 Mininet。添加 arp 选项解决了我的问题。

即 sudo mn --arp --custom fTreeTopo.py --topo ftreetopo --controller=remote,ip=127.0.0.1