++netpfga updates

Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
Nico Schottelius 2019-06-17 19:39:07 +02:00
parent ecdb6d4f9b
commit 2b5d5ea62d
3 changed files with 123 additions and 0 deletions

37
bin/checksum_test.py Normal file
View file

@ -0,0 +1,37 @@
#!/usr/bin/python3
from scapy.all import *
if __name__ == '__main__':
p = []
e0 = Ether(src="00:00:00:00:00:00",
dst="00:00:00:00:00:00")
e = Ether(src="02:53:55:42:45:01",
dst='ff:ff:ff:ff:ff:ff')
i0 = IP(src = "0.0.0.0",
dst = "0.0.0.0")
i4 = IP(src = "192.168.1.1",
dst = "192.168.4.2")
i6 = IPv6(src = "2001:db8:42::1",
dst = "2001:db8::2")
t0 = TCP(dport=0, sport=0)
t = TCP(dport=80, sport=random.randint(49152,65535))
d0 = ""
d = "A"
p.append(e0 / i0 / t0 / d0)
p.append(e / i4 / t / d)
# p.append(e / i6 / t / d)
for test in p:
print("p = {}".format(test.__repr__())!)
packet_raw = str(test)
checksum_scapy = IP(packet_raw)[TCP].chksum
print("chk = {}".format(checksum_scapy))

View file

@ -4602,6 +4602,92 @@ Likely requires "Installation of Digilent Adept Tools"
(website does not load as of 2019-06-17, 10:39)!
Install deb that supports the hardware test:
#+BEGIN_CENTER
10-ipv6-privacy.conf Desktop digilent.adept.runtime_2.19.2-amd64.deb
root@rainbow16:~# dpkg -i digilent.adept.runtime_2.19.2-amd64.deb
Selecting previously unselected package digilent.adept.runtime.
(Reading database ... 275077 files and directories currently installed.)
Preparing to unpack digilent.adept.runtime_2.19.2-amd64.deb ...
Unpacking digilent.adept.runtime (2.19.2) ...
Setting up digilent.adept.runtime (2.19.2) ...
Processing triggers for libc-bin (2.23-0ubuntu11) ...
root@rainbow16:~#
#+END_CENTER
The required tool does not seem to be included in the adept runtime:
#+BEGIN_CENTER
root@rainbow16:~# dpkg -l | grep digilent
ii digilent.adept.runtime 2.19.2 amd64 Digilent Adept Runtime
root@rainbow16:~# dpkg -L digilent.adept.runtime | grep djtgcfg
root@rainbow16:~#
#+END_CENTER
Trying -tools as well
#+BEGIN_CENTER
[12:55] line:Downloads% scp digilent.adept.utilities_2.2.1-amd64.deb root@rainbow16.place6.ungleich.ch:
digilent.adept.utilities_2.2.1-amd64.deb 100% 465KB 1.2MB/s 00:00
[12:56] line:Downloads%
root@rainbow16:~# ls
10-ipv6-privacy.conf Desktop digilent.adept.runtime_2.19.2-amd64.deb digilent.adept.utilities_2.2.1-amd64.deb
root@rainbow16:~# dpkg -i digilent.adept.utilities_2.2.1-amd64.deb
Selecting previously unselected package digilent.adept.utilities.
(Reading database ... 275201 files and directories currently installed.)
Preparing to unpack digilent.adept.utilities_2.2.1-amd64.deb ...
Unpacking digilent.adept.utilities (2.2.1) ...
Setting up digilent.adept.utilities (2.2.1) ...
Processing triggers for man-db (2.7.5-1) ...
root@rainbow16:~# which djtgcfg
/usr/bin/djtgcfg
root@rainbow16:~#
#+END_CENTER
New error from the hardware test:
#+BEGIN_CENTER
---------------------------------------------
[pcie]: Running Auto Test
---------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py", line 16765, in <lambda>
lambda event: event.callable(*event.args, **event.kw) )
File "sw/host/script/NfSumeTest.py", line 848, in UpdateProgress
self.progressDlg.Update(self.curProgress, str(localLine))
File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py", line 16710, in __getattr__
raise PyDeadObjectError(self.attrStr % self._name)
wx._core.PyDeadObjectError: The C++ part of the NfSumeProgress object has been deleted, attribute access no longer allowed.
Exception in thread Thread-21:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "sw/host/script/NfSumeTest.py", line 947, in run
self.target(*self.data)
File "sw/host/script/NfSumeTest.py", line 466, in TestInterface
self.serialCon.readlines()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 495, in read
raise SerialException('device reports readiness to read but returned no data (device disconnected or multiple access on port?)')
SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
#+END_CENTER
*** 2019-06-17: checksum delta / diff approach
**** crc / checksum operation
"The checksum field is the 16 bit one's complement of the one's
complement sum of all 16-bit words in the header and text."
https://en.wikipedia.org/wiki/Transmission_Control_Protocol#Checksum_computation
** References / Follow up
*** RFC 791 IPv4 https://tools.ietf.org/html/rfc791
*** RFC 792 ICMP https://tools.ietf.org/html/rfc792

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB