2
votes

I am using Mininet, RYU controller and OpenFlow 1.3, to create a topology where host h1 is connected to host h2 using a switch p0es0 in the following way:

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

In my Ryu Controller application, I have the following code snippet to install rules on my p0es0 switch to be able to reach h1 from h2 and vice-versa:

    # 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)

My dump-flow command confirms the correct installation of rules in the switch as expected:

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

OFPST_FLOW reply (OF1.3) (xid=0x2):

cookie=0x0, duration=1103.417s, table=0, n_packets=0, n_bytes=0, send_flow_rem priority=100,ip,nw_dst=10.0.0.2 actions=output:4

cookie=0x0, duration=1103.414s, table=0, n_packets=0, n_bytes=0, send_flow_rem priority=100,ip,nw_dst=10.0.0.1 actions=output:3


However, when I attempt to ping h2 from h1 or vice-versa, I get Destination Host Unreachable error. I tried using tcpdump on p0es0-eth3 -- I see only ARP Request packets.

Am I missing something here?

Thanks.

1

1 Answers

1
votes

I was running Mininet without the arp flag. Adding the arp option fixed my problem.

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