Hi,

Instead of this:
self.send_openflow_packet(dpid, eth.__str__(), inport)

Try this:
self.send_openflow_packet(dpid, eth.tostring(), inport)

________________________________________
From: [email protected] [[email protected]] On Behalf Of 
Volodymyr Bulakh [[email protected]]
Sent: Sunday, February 26, 2012 3:28 AM
To: [email protected]
Subject: [nox-dev] Malformed ARP reply packet

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

CONFIDENTIALITY: This email is intended solely for the person(s) named and may 
be confidential and/or privileged. If you are not the intended recipient, 
please delete it, notify us and do not copy, use, or disclose its content.

Towards A Sustainable Earth: Print Only When Necessary. Thank you.
_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev

Reply via email to