Hello Everyone,

I seem to be unable to form a correct ARP reply packet - whatever I do the packet that is being sent out is malformed (as verified by Wireshark), even though it is supposed to work since I got most/all of the code from the NOX mailing list.

Here is the code.  Any help will be greatly appreciated.

    def ARP (self, dpid, inport, packet, buf, bufid):
        arph = packet.find('arp')
        original_eth = packet.find('ethernet')

        if (arph.opcode == arp.REQUEST):
            SOURCE_MAC_ADDR = "00:00:00:00:00:02"

            arp_reply = arp()
            arp_reply.hwtype     = 1
            arp_reply.hwlen      = arph.hwlen
            arp_reply.prototype  = arp.PROTO_TYPE_IP
            arp_reply.protolen   = arph.protolen
            arp_reply.opcode     = arp.REPLY

            arp_reply.hwsrc      = octstr_to_array(SOURCE_MAC_ADDR)
            arp_reply.hwdst      = arph.hwsrc

            arp_reply.protodst   = arph.protosrc
            arp_reply.protosrc   = arph.protodst

            eth = ethernet()
            eth.set_payload(arp_reply)
            eth.src        = octstr_to_array(SOURCE_MAC_ADDR)
            eth.dst        = packet.src
            eth.type        = ethernet.ARP_TYPE
            eth.hdr_len = ethernet.MIN_LEN

            self.send_openflow_packet(dpid, eth.__str__(), inport)

        else:
            print "ARP response"

The packet that is being sent is almost twice the size of the ARP request packet (128 vs. 230 bytes). Does anyone know what I am doing wrong?

Thank you,
Vlad
_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev

Reply via email to