0

I am trying to send an ARP request from an SDN OpenFlow switch to find the MAC address of a pre-defined host(IP address of the host is known : 10.0.0.8/24)

I am trying to use a dummy IP and a MAC address for the controller.

  • Dummy IP for the controller : 10.1.2.3
  • Dummy MAC address for the controller : 00:12:34:56:78:90

Please find the attached image of my topology

What I am trying to do is, crafting an ARP request in the controller when the connection between the controller and the switch is established , and flood the request via the switch.

# respond to switch connection up event
def _handle_ConnectionUp(self, event):
    self.connection = event.connection
    print("connecting to %s" %(self.connection))
    # code to send ARP requests to servers


    r = arp()
    r.hwtype = r.HW_TYPE_ETHERNET
    r.prototype = r.PROTO_TYPE_IP
    r.hwlen = 6
    r.protolen = r.protolen
    r.opcode = r.REQUEST
    r.hwdst = ETHER_BROADCAST
    r.protodst = IPAddr("10.0.0.8")
    r.hwsrc = EthAddr("00:12:34:56:78:90")
    r.protosrc = IPAddr("10.1.2.3")
    e = ethernet(type=ethernet.ARP_TYPE, src=EthAddr("00:12:34:56:78:90") , dst=ETHER_BROADCAST)
    e.set_payload(r)
    msg = of.ofp_packet_out()
    msg.data = e.pack()
    msg.actions.append(of.ofp_action_output(port = of.OFPP_FLOOD))
    event.connection.send(msg)

But I can't see any ARP reply from the host-10.0.0.8 .

tcpdump from the host is attached herewith

Please let me know if I am doing anything wrong with respect to the above code. Thank you very much in advance.

1 Answers1

0

After several failed attempts I came to realize my mistake.

All the nodes should be in a single broadcast domain to send or receive an ARP. Hence the dummy IP of the controller should be changed in to something like 10.0.0.x/24