Begin to introduce commented out code, use metadata
This commit is contained in:
parent
f9ce0b92a6
commit
8b8f70e6a0
6 changed files with 585 additions and 478 deletions
94
doc/plan.org
94
doc/plan.org
|
|
@ -358,8 +358,30 @@
|
|||
| | - 15m q&a | |
|
||||
| | | |
|
||||
| | | |
|
||||
| 2019-06-24 | | |
|
||||
| | Laurent meeting | |
|
||||
| | | |
|
||||
| 2018-06-27 | | |
|
||||
| | Checksums | |
|
||||
| | - 16 bit sum of fields, later one/two complement | |
|
||||
| | - various implementations | |
|
||||
| | - is a sum -> commutative law | |
|
||||
| | - overflow (delta > payload) handling unclear | |
|
||||
| | | |
|
||||
| | Netpfga | |
|
||||
| | - Old one had several failure messages (one in DDR area) | |
|
||||
| | - New one: tables can be written | |
|
||||
| | - Need 3 ports: v4, v6, management | |
|
||||
| | | |
|
||||
| | Next steps: | |
|
||||
| | - Test checksums delta on software switch | |
|
||||
| | - Begin to port code to netpfga one-by-one | |
|
||||
| | | |
|
||||
| | Follow up notes: | |
|
||||
| | - Checkout Hendrik thesis / right / left shift | |
|
||||
| | - Fix computer in lab | |
|
||||
| | | |
|
||||
| | | |
|
||||
| 2019-06-27 | | |
|
||||
| | Target Hardware: code running | |
|
||||
| | | |
|
||||
| 2019-07-11 | | |
|
||||
|
|
@ -3000,6 +3022,76 @@ b'AAAA'
|
|||
[14:18] line:bin% python3 checksum_from_scapy.py BBAA
|
||||
b'BBAA'
|
||||
31868
|
||||
[14:18] line:bin% python3 checksum_from_scapy.py AA
|
||||
b'AA'
|
||||
48830
|
||||
[14:20] line:bin% python3 checksum_from_scapy.py BB
|
||||
b'BB'
|
||||
48573
|
||||
>>> bin(48830)
|
||||
'0b1011111010111110'
|
||||
>>> bin(48573)
|
||||
'0b1011110110111101'
|
||||
>>>
|
||||
|
||||
>>> array.array("H", "AAAA".encode("utf-8"))
|
||||
array('H', [16705, 16705])
|
||||
>>> array.array("H", "AA".encode("utf-8"))
|
||||
array('H', [16705])
|
||||
|
||||
-> bit concat on 16:
|
||||
AA:
|
||||
>>> 0b100000101000001
|
||||
16705
|
||||
|
||||
Order in 16 bit tuples does not matter:
|
||||
|
||||
[14:24] line:bin% python3 checksum_from_scapy.py AABB
|
||||
b'AABB'
|
||||
sum=33667
|
||||
31868
|
||||
[14:28] line:bin% python3 checksum_from_scapy.py BBAA
|
||||
b'BBAA'
|
||||
sum=33667
|
||||
31868
|
||||
|
||||
[14:28] line:bin% python3 checksum_from_scapy.py BBCCAA
|
||||
b'BBCCAA'
|
||||
sum=50886
|
||||
14649
|
||||
[14:28] line:bin% python3 checksum_from_scapy.py BBAACC
|
||||
b'BBAACC'
|
||||
sum=50886
|
||||
14649
|
||||
|
||||
Sum on shorts does not stay in short area:
|
||||
|
||||
>>> sum(array.array("H", [48830, 48573]))
|
||||
97403
|
||||
>>> sum(array.array("H", "AAAA".encode("utf-8")))
|
||||
33410
|
||||
>>> sum(array.array("H", "AABB".encode("utf-8")))
|
||||
33667
|
||||
>>> sum(array.array("H", "AABBCC".encode("utf-8")))
|
||||
50886
|
||||
>>> sum(array.array("H", "AABBCCDD".encode("utf-8")))
|
||||
68362
|
||||
|
||||
Adding with overflow control works:
|
||||
|
||||
>>> s = 97403
|
||||
>>> s = (s >> 16) + (s & 0xffff)
|
||||
>>> s
|
||||
31868
|
||||
>>> s += s >> 16
|
||||
>>> s
|
||||
31868
|
||||
|
||||
[14:29] line:bin% python3 checksum_from_scapy.py AABB
|
||||
b'AABB'
|
||||
sum=33667
|
||||
31868
|
||||
|
||||
|
||||
#+END_CENTER
|
||||
*** TODO Get ANY p4 program to successfully run on netpfga
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue