Closed 0xabdi closed 3 years ago
I think you can probably just remove the ord
.
This looks like it had been missed until now in the Python 3 (#192) transition.
If removing the ord
fixes it, we should push it.
After removing ord() "ERROR:packet:(dns) parsing questions: sequence item 0: expected str instance, bytes found" this error is shown . what should be done?
I don't have a lot of time to work on this right now. The basic issue is a Python2/Python3 conversion problem that didn't get caught yet. Here are some options:
I added b in join and it worked . "def read_dns_name_from_index(cls, l, index): retlist = [] next = cls._read_dns_name_from_index(l, index, retlist) return (next + 1,b".".join(retlist))"
I'd forgotten about this issue, but have made a bunch of fixes to DNS (including the problem above) in this branch of my fork: https://github.com/MurphyMc/pox/tree/gar-wip3
... that stuff should probably eventually all get upstreamed.
Hi dears does this issue effect the result of measuring RTT and Throughput of network working under Pox controller? or it can be neglected?
Hey, firendly reminder to put this fix on main.
The problem still persists
I added b in join and it worked . "def read_dns_name_from_index(cls, l, index): retlist = [] next = cls._read_dns_name_from_index(l, index, retlist) return (next + 1,b".".join(retlist))"
Can you share withus the code of DHCP after removing ord and DNS code
I had to both add that "b" in read_dns_name_from_index and remove the ord's in _read_dns_name_from_index to get rid of the problem
I had to both add that "b" in read_dns_name_from_index and remove the ord's in _read_dns_name_from_index to get rid of the problem
I don't have enough experience to edit, I tried and the error still appears
Can you send the code files after modification to make DHCP work?
I had to both add that "b" in read_dns_name_from_index and remove the ord's in _read_dns_name_from_index to get rid of the problem
I don't have enough experience to edit, I tried and the error still appears
Can you send the code files after modification to make DHCP work?
I don't know about the DHCP problem, but it fixed the DNS problem for me, maybe you can do what I did to dns.py in dhcp.py, just replace pox/pox/lib/packet/dns.py with the dns.py in this zip dns.zip
I had to both add that "b" in read_dns_name_from_index and remove the ord's in _read_dns_name_from_index to get rid of the problem
I don't have enough experience to edit, I tried and the error still appears Can you send the code files after modification to make DHCP work?
I don't know about the DHCP problem, but it fixed the DNS problem for me, maybe you can do what I did to dns.py in dhcp.py, just replace pox/pox/lib/packet/dns.py with the dns.py in this zip dns.zip
Thanks for the help, I appreciate it
But the problem persists, I think from the DHCP file
TypeError: ord() expected string of length 1, but int found ERROR:core:Exception while handling Connection!PacketIn... Traceback (most recent call last): File "/home/mohsen/pox/pox/lib/revent/revent.py", line 242, in raiseEventNoErrors return self.raiseEvent(event, *args, kw) File "/home/mohsen/pox/pox/lib/revent/revent.py", line 295, in raiseEvent rv = event._invoke(handler, *args, *kw) File "/home/mohsen/pox/pox/lib/revent/revent.py", line 168, in _invoke return handler(self, args, kw) File "/home/mohsen/pox/pox/forwarding/topo_proactive.py", line 382, in _handle_PacketIn packet = event.parsed File "/home/mohsen/pox/pox/openflow/init.py", line 193, in parsed return self.parse() File "/home/mohsen/pox/pox/openflow/init.py", line 185, in parse self._parsed = ethernet(self.data) File "/home/mohsen/pox/pox/lib/packet/ethernet.py", line 106, in init self.parse(raw) File "/home/mohsen/pox/pox/lib/packet/ethernet.py", line 127, in parse self.next = ethernet.parse_next(self, self.type, raw, ethernet.MIN_LEN) File "/home/mohsen/pox/pox/lib/packet/ethernet.py", line 134, in parse_next return parser(raw[offset:], prev) File "/home/mohsen/pox/pox/lib/packet/ipv4.py", line 93, in init self.parse(raw) File "/home/mohsen/pox/pox/lib/packet/ipv4.py", line 158, in parse self.next = udp(raw=raw[self.hl*4:length], prev=self) File "/home/mohsen/pox/pox/lib/packet/udp.py", line 68, in init self.parse(raw) File "/home/mohsen/pox/pox/lib/packet/udp.py", line 100, in parse self.next = dhcp(raw=raw[udp.MIN_LEN:],prev=self) File "/home/mohsen/pox/pox/lib/packet/dhcp.py", line 142, in init self.parse(raw) File "/home/mohsen/pox/pox/lib/packet/dhcp.py", line 215, in parse self.parseOptions() File "/home/mohsen/pox/pox/lib/packet/dhcp.py", line 232, in parseOptions self.parseOptionSegment(self._raw_options) File "/home/mohsen/pox/pox/lib/packet/dhcp.py", line 248, in parseOptionSegment opt = ord(barr[ofs]) TypeError: ord() expected string of length 1, but int found
File "/home/mohsen/pox/pox/lib/packet/dhcp.py", line 248, in parseOptionSegment opt = ord(barr[ofs]) TypeError: ord() expected string of length 1, but int found
Try editing that file, line 248, and just remove that ord call, so it says opt = barr[ofs], do the same with other "ord"s you see in that same function
Just a note that you are using an old version of POX. I suspect this problem is fixed in the halosaur branch.
The Selecting a Branch / Version section of the manual hasn't been updated for a while, but describes the POX versioning scheme and the procedure to select them.
The Selecting a Branch / Version section of the manual hasn't been updated for a while, but describes the POX versioning scheme and the procedure to select them.
File a new issue and include relevant information (such as the command line / configuration you are using).
- after dhclient and dhclient -r commands the IP address is still the same on mininet hosts. How can change or renew with different IPs?
@Jaisaiarun Thanks for sharing the tip.
Would you check the code line of return (next + 1,b".".join(retlist))"
? The " isn't pair. The last " should by typo?
@aperezleiras I try to apply your tip of removing ord
in the "_read_dns_name_from_index" function. I see two code lines with ord
:
chunk_size = ord(l[index])
offset = ( (ord(l[index]) & 0x3) << 8 ) | ord(l[index + 1])
These lines should be like:
chunk_size = l[index]
offset = ( (l[index] & 0x3) << 8 ) | l[index + 1]
?
My git branch: "gar-experimental"
Why not just upgrade to the halosaur branch, where this was fixed almost two years ago?
@MurphyMc Thanks for your suggestion. I will switch the branch to "halosaur" and check the message during runtime.
Up to this point, everything works fine until I ran this from the mininet prompt: h1 dhclient h1-eth0
The mininet prompt hangs for minutes and the following appears on the pox prompt: