Re: [nox-dev] Assertion on udp.checksum()

2012-02-01 Thread Murphy McCauley
Thanks for the reminder. In my branch this actually works differently altogether and is, indeed, limited to 16 bits. That'll get pushed into the release version of the destiny branch. -- Murphy On Feb 1, 2012, at 11:25 AM, Aaron Rosen wrote: > Hello, > > I was just merging my local changes

Re: [nox-dev] Assertion on udp.checksum()

2012-02-01 Thread Aaron Rosen
Hello, I was just merging my local changes with whats in the git and noticed this change never made it in. In ipv4.py self.id = int(time.time()) but this should be self.id = int(time.time)) &0x (since the field is only 2bytes) Aaron On Mon, Aug 8, 2011 at 6:31 PM, Murphy McCauley wrote:

Re: [nox-dev] Assertion on udp.checksum()

2011-08-08 Thread Murphy McCauley
It's the identification field of the IPv4 header. Mostly this is used to match up fragments (which should all retain the same value). So time.time() isn't really a very good value for it anyway, as it should be relatively unique, but int(time.time()) is only unique for packets sent in differen

Re: [nox-dev] Assertion on udp.checksum()

2011-08-08 Thread Aaron Rosen
Thanks that did the trick. Yea I thought this was strange too since this used to work a while ago. Out of curiosity what is id in ipv4.py I see that it holds the time but why is that needed? Thanks again, Aaron On Mon, Aug 8, 2011 at 6:13 PM, Murphy McCauley wrote: > Strange, I am positive t

Re: [nox-dev] Assertion on udp.checksum()

2011-08-08 Thread Murphy McCauley
Strange, I am positive that I have fixed this. Maybe it just hasn't gotten pushed yet. In ipv4.py around line 76, try something like... self.id = int(time.time()) & 0x -- Murphy On Aug 8, 2011, at 3:08 PM, Aaron Rosen wrote: > Thanks, > > I hate to bug you again but this looks fine to me

Re: [nox-dev] Assertion on udp.checksum()

2011-08-08 Thread Aaron Rosen
Thanks, I hate to bug you again but this looks fine to me? iplen = 39 len("hello world")(11) + udp header(8) + 20 (ip_header) 17 = UDP_PROTOCOL bad packet [69, 0, 39, 1312840938, 0, 64, 17, 0, 167837954, 167837953] 00019|pyrt|ERR:unable to invoke a Python event handler: Traceback (most

Re: [nox-dev] Assertion on udp.checksum()

2011-08-08 Thread Murphy McCauley
I think you just have a field with a bad value. Try replacing the checksum function with something like this to help you spot it: def checksum(self): try: data = struct.pack('!BBHHBBHII', (self.v << 4) + self.hl, self.tos, self.iplen, self.id,

Re: [nox-dev] Assertion on udp.checksum()

2011-08-08 Thread Aaron Rosen
Hello, I emailed the mailing list about this before but it seems like maybe something changed or maybe I'm blind. Anyways, the following code generates the following execption. Any ideas what's going wrong? def send_udp(mac, dstip, srcip, port, payload): l4 = udp() l4.srcport = 1999

Re: [nox-dev] Assertion on udp.checksum()

2011-06-20 Thread Aaron Rosen
Thanks Murphy! You're right, that did the trick. Aaron On Mon, Jun 20, 2011 at 1:55 PM, Murphy McCauley wrote: > So I think the call to l3.checksum() is extraneous, but the real issue is > probably that l3.iplen should be ipv4.MIN_LEN + l4.len. > > -- Murphy > > On Monday, June 20, 2011 09:42:0

Re: [nox-dev] Assertion on udp.checksum()

2011-06-20 Thread Murphy McCauley
So I think the call to l3.checksum() is extraneous, but the real issue is probably that l3.iplen should be ipv4.MIN_LEN + l4.len. -- Murphy On Monday, June 20, 2011 09:42:07 AM Aaron Rosen wrote: > Hi Murphy, > > wow... Opps... > > I'm trying the following: This doesn't return any errors but i

Re: [nox-dev] Assertion on udp.checksum()

2011-06-20 Thread Aaron Rosen
Hi Murphy, wow... Opps... I'm trying the following: This doesn't return any errors but in wireshark the packet_outs say Malformed UDP packets. def send_udp_message(): l4 = udp() l4.srcport = 1999 l4.dstport = 1888 l4.len = udp.MIN_LEN + len("hello_world") l4.set_payload("Hello_wo

Re: [nox-dev] Assertion on udp.checksum()

2011-06-20 Thread Murphy McCauley
Unfortunately, your tweak breaks the logic of the assert. The assert is asserting that self.next is a packet_base of some sort OR a string. You've set it to a string, so... it should be a string. So it should definitely not be a packet_base. So the first of your asserts will always fail.

Re: [nox-dev] Assertion on udp.checksum()

2011-06-20 Thread Aaron Rosen
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, pack

Re: [nox-dev] Assertion on udp.checksum()

2011-06-20 Thread Murphy McCauley
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 h

Re: [nox-dev] Assertion on udp.checksum()

2011-06-20 Thread Aaron Rosen
Hello, I was able to successfully craft my UDP packets using scapy and then pass that to send_openflow_packet() and that seemed to do the trick for me. (I'm this curious what my issue is with building the packet up using nox though). def send_udp(): packet = scapy.Ether(type=0x800, dst="00:0

Re: [nox-dev] Assertion on udp.checksum()

2011-06-20 Thread Aaron Rosen
I see if I put a = packet_base() l4.next = a That gets me around the first part of the assertion but then I get asserted on: assert(type(self.next) == type('')) Thanks, Aaron On Sun, Jun 19, 2011 at 6:34 PM, Aaron Rosen wrote: > Hello, > > I'm trying to send udp packets from my contr