Hi Murphy,

I'm using zaku but the one in destiny looked the same to be.

I changed to assert to be on two lines so I could see which one was firing.

    def checksum(self):
        #assert(isinstance(self.next, packet_base) or type(self.next)
== type(''))
        assert(isinstance(self.next, packet_base))
        assert(type(self.next) == type(''))


Thanks,

Aaron

On Mon, Jun 20, 2011 at 12:19 PM, Murphy McCauley <jam...@nau.edu> wrote:
> What NOX are you using?  Your udp.py does not seem to be the one in zaku or
> destiny...
>
> -- Murphy
>
> On Sunday, June 19, 2011 03:34:20 PM Aaron Rosen wrote:
>> Hello,
>>
>> I'm trying to send udp packets from my controller but I'm getting the
>> following assertion when I call udp().checksum(). I was hoping someone
>> could point out where I'm going wrong.
>>
>> Thanks,
>>
>> Aaron
>>
>> Traceback (most recent call last):
>>   File "./nox/lib/util.py", line 116, in f
>>     event.total_len, buffer_id, packet)
>>   File "./nox/coreapps/examples/sos.py", line 299, in packet_in_callback
>>     learn(dpid, inport, packet)
>>   File "./nox/coreapps/examples/sos.py", line 56, in learn
>>     send_packet = send_udp_message()
>>   File "./nox/coreapps/examples/sos.py", line 48, in send_udp_message
>>     l4.csum = l4.checksum()
>>   File "./nox/lib/packet/udp.py", line 111, in checksum
>>     assert(isinstance(self.next, packet_base))
>> AssertionError
>>
>>
>> def send_udp_message():
>>
>>     l4 = udp()
>>     l4.srcport = 1999
>>     l4.dstport = 1888
>>     l4.len = udp.MIN_LEN + len("hello_world")
>>     l4.set_payload("Hello_world")
>>
>>     l3 = ipv4()
>>     l3.iplen = ipv4.MIN_LEN
>>     l3.protocol = ipv4.UDP_PROTOCOL
>>     l3.dstip = ipstr_to_int("130.127.39.7");
>>     l3.srcip = ipstr_to_int("1.1.1.1");
>>     l3.set_payload(l4)
>>
>>     l2 = ethernet()
>>     l2.set_payload(l3)
>>     l2.dst = octstr_to_array("00:00:00:00:00:02")
>>     l2.dst = octstr_to_array("a1:00:04:00:0a:04")
>>     l2.type = ethernet.IP_TYPE
>>     l3.checksum()
>>     l4.csum = l4.checksum()
>>
>>     return l2
>>
>>
>> ....
>>     send_packet = send_udp_message()
>>     inst.send_openflow_packet(dpid, send_packet.tostring(),
>> openflow.OFPP_FLOOD, inport)
>



-- 
Aaron O. Rosen
Masters Student - Network Communication
306B Fluor Daniel
_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev

Reply via email to