Skip to Content.

rare-dev - Re: [rare-dev] polka is approaching rare... was: Re: custom crc32 library in freerouter

Subject: Rare project developers

List archive


Re: [rare-dev] polka is approaching rare... was: Re: custom crc32 library in freerouter


Chronological Thread 
  • From: mc36 <>
  • To: Cristina Klippel Dominicini <>
  • Cc: Rafael Silva Guimarães <>, "" <>, "Moises R. N. Ribeiro" <>, Magnos Martinello <>
  • Subject: Re: [rare-dev] polka is approaching rare... was: Re: custom crc32 library in freerouter
  • Date: Thu, 28 Oct 2021 00:38:14 +0200

hi,
thanks for adding me... i've cross-checked the calculators and found that
yours and mine create the same routeid...
did some cosmetical changes, the printer functions and the sX and oX arrays
have been updated in your code...
below are the runs from yours and mine, both calculate the same routeid:
0x999e998f5578001
but interestingly, i had to comment out the irreducible check: throw new
Exception("NodeID polynomial is not irreducible");
egards,
cs

long s1Array[] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
long s2Array[] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
long s3Array[] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1};
long s4Array[] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1};

long o1Array[] = {0, 0, 0, 1};
long o2Array[] = {0, 0, 1, 0};
long o3Array[] = {0, 0, 1, 1};
long o4Array[] = {0, 0, 0, 0};



Oct 28, 2021 12:19:52 AM polka.PolKA <init>
FINE: PolKA Constructor
Oct 28, 2021 12:19:52 AM polka.PolKA <init>
FINE: S = [x^15, 1+x^15, 1+x+x^15, 1+x^2+x^15]
Oct 28, 2021 12:19:52 AM polka.PolKA <init>
FINE: O = [1, x, 1+x, 0]
Oct 28, 2021 12:19:52 AM polka.PolKA calculateR
INFO: PolKA RouteID Computation
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: S0 = 1000000000000000 = 0x8000
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: S1 = 1000000000000001 = 0x8001
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: S2 = 1000000000000011 = 0x8003
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: S3 = 1000000000000101 = 0x8005
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: O0 = 0001 = 0x1
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: O1 = 0010 = 0x2
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: O2 = 0011 = 0x3
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: O3 = 0000 = 0x0
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: t0 = 1000000000000111000000000001001000000000001111 = 0x2001c004800f
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: t1 = 1000000000000110000000000001111000000000000000 = 0x200180078000
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: t2 = 1000000000000100000000000000101000000000000000 = 0x200100028000
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: t3 = 1000000000000010000000000000011000000000000000 = 0x200080018000
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: n0 = 11001100110011 = 0x3333
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: n1 = 1000000000000 = 0x1000
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: n2 = 100101010101011 = 0x4aab
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: n3 = 110100110011010 = 0x699a
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: xx0 = 11001100110010001100110011010010101010101001000000000000001 =
0x666466695548001
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: xx1 = 10000000000001100000000000011110000000000000000000000000000 =
0x4003000f0000000
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: xx2 = 1101111111111011111111111110011010000000001001000000000000000 =
0x1bff7ffcd0048000
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: xx3 = 0000 = 0x0
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: x = 1100110011001000010011001101010110101010100000000000000000001 =
0x1999099ab5500001
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: m = 1000000000000111000000000001001000000000001111000000000000000 =
0x1000e00240078000
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: f = 0100110011001111010011001100011110101010101111000000000000001 =
0x999e998f5578001
Oct 28, 2021 12:19:52 AM polka.PolKA calculateR
FINE: Check[0]:
Oct 28, 2021 12:19:52 AM polka.PolKA calculateR
FINE: == true
Oct 28, 2021 12:19:52 AM polka.PolKA calculateR
FINE: Check[1]:
Oct 28, 2021 12:19:52 AM polka.PolKA calculateR
FINE: == true
Oct 28, 2021 12:19:52 AM polka.PolKA calculateR
FINE: Check[2]:
Oct 28, 2021 12:19:52 AM polka.PolKA calculateR
FINE: == true
Oct 28, 2021 12:19:52 AM polka.PolKA calculateR
FINE: Check[3]:
Oct 28, 2021 12:19:52 AM polka.PolKA calculateR
FINE: == true
Oct 28, 2021 12:19:52 AM polka.PolKA printPoly
INFO: R = 0100110011001111010011001100011110101010101111000000000000001 =
0x999e998f5578001
BUILD SUCCESSFUL (total time: 0 seconds)




s0=1000000000000000
s1=1000000000000001
s2=1000000000000011
s3=1000000000000101
s4=1000000000001001
s5=1000000000010001
s6=1000000000010111
s7=1000000000011011
s8=1000000000100001
s9=1000000000101101
t0 = 2001c004800f
n0 = 3333
t1 = 200180078000
n1 = 1000
t2 = 200100028000
n2 = 4aab
t3 = 200080018000
n3 = 699a
xx0 = 666466695548001
xx1 = 4003000f0000000
xx2 = 1bff7ffcd0048000
xx3 = 0
x = 1999099ab5500001
o0=0x0001
o1=0x0002
o2=0x0003
o3=0x0000
o4=0x0f26
o5=0x27db
o6=0x2df6
o7=0x3ca4
o8=0x4382
o9=0x1d24
r= 00 00 00 00 00 00 00 00 09 99 e9 98 f5 57 80 01
crc=d581 dif=8001 xor=5580
mc36@safe:/data.pub/src$






On 10/27/21 23:25, mc36 wrote:
hi,
ohh, i forgot to mention that if you're interested to execute the tests then
do the following:

$ wget src.nop.hu/rtr.zip
$ unzip rtr.zip
$ cd src
src$ ./c.sh
src$ java -jar rtr.jar test tester rout-bgp529 wait

it'll start the processes for the bgp based polka test...
then it'll pause at the end... then in some new windows, you can access the
routers:

$ telnet localhost 20001     #for r1
$ telnet localhost 20002     #for r2
$ telnet localhost 20003     #for r3

not too much to see there, just bare minimal at the moment:
- show ipv4 srindex v1       #to see the nodeid to prefix mapping
table... in the dataplanes, it'll be a shortcut to a nexthop...
- show ipv6 srindex v1       #to see the nodeid to prefix mapping
table... in the dataplanes, it'll be a shortcut to a nexthop...
- display inter eth1 ether   #here you can see the polka packets
received/sent counters per interface... ctrl+q to stop viewing...
- debug iface polka          #to activate polka packet debugging on
a given router...
- term mon                   #to see the debugs interactive
- show logg                  #to see the historical debugs

regards,
cs


On 10/27/21 22:42, mc36 wrote:
hi,
sorry for the spam... so i introduced polka in freerouter with this huge
change:
https://github.com/mc36/freeRouter/commit/2f0981910316236abc044eaaffa694a531bb7ff3
unfortunately for now, the forwarding can only work with the cryPoly class,
which is a nicer version i previously sent to you... the issue i'm facing
right now is that i cannot figure out how to apply crc16 properly...
i'm generating the S values and compute a routeid that i can decode with the S
according to your paper, but when it comes to applying crc16, i fail
somehow...
the value that come out after the final xor is invalid...
i've written a small tester for that at http://src.nop.hu/src/zzz.java
it generates 10 16bit polynomials starting at 32768, those are the Sn
values...
then encodes the path 1->3 3->5 5->7 7->8 8->9... then it decode with the
poly class, those are the On values... whose appear on the left side,
those right side seems correct... the rest have garbage, obviously...
but when it come to crc16, it fails to decode correctly...:(
any idea is highly welcome! :)
thanks,
cs

here is how you can try it yourself:

$ wget src.nop.hu/rtr.zip > /dev/null
$ unzip rtr.zip
$ cd src
src$ ./c.sh
src$ ./zzz.sh

it gives you the following:

s0=1000000000000000
s1=1000000000000001
s2=1000000000000011
s3=1000000000000101
s4=1000000000001001
s5=1000000000010001
s6=1000000000010111
s7=1000000000011011
s8=1000000000100001
s9=1000000000101101
o0=0x04a6
o1=0x0003
o2=0x7371
o3=0x0005
o4=0x5da0
o5=0x0007
o6=0x2ce9
o7=0x0008
o8=0x0009
o9=0x0000
r= 00 00 00 00 00 e7 52 d4 f9 b9 4a b7 a9 0a 04 a6
crc=2254 dif=04a6 xor=26f2




On 10/27/21 14:28, mc36 wrote:
hi,
as said before, i came up with my own poly.java which is specific to gf(2),
had add,sub,mul,div and modinv...
at the moment it have an S generator and a checker... below is a test run,
first some basic poly math, then
your paper's calculation, which is fine, then a randomly generated S and O,
encoding of R and verification of it...
everything seems fine at least as i see, but i have issues with your
polka.patch... there, you propose the numbers
0x2b,0x2d,0x39,0x3f,0x47,0x53,0x8d,0xbd,0xd7,0xf5, i checked some and it
seems to me that these are not irreducible...
for an example, i picked up randomly 0x3f and 0x53 and according to my poly
lib, it have a gcm of 1001... you can verify it at
http://www.ee.unb.ca/cgi-bin/tervo/calc.pl?num=111111&den=1001&f=d and
http://www.ee.unb.ca/cgi-bin/tervo/calc.pl?num=1010011&den=1001&f=d
both of them give back 000 as remainder...
as for now, i have everything, i'll slowly integrate it to freerouter to see
how it fits... :)
seeking for your comments,
regards,
cs





[..]




Archive powered by MHonArc 2.6.19.

Top of Page