From: Matt Corallo Date: Sat, 15 Jun 2024 15:31:48 +0000 (+0000) Subject: Clarify what collision_prob is calculating for users X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=22574c7a573751bfe6c1a1006a17727577b150ea;p=flowspec-xdp Clarify what collision_prob is calculating for users --- diff --git a/collision_prob.py b/collision_prob.py index 36df0c9..9d3ee7d 100644 --- a/collision_prob.py +++ b/collision_prob.py @@ -40,36 +40,40 @@ def print_entry(e, t, b): #print_entry(300, 20000, 1) #print_entry(300, 20000*2, 2) -print("Table and bucket sizes mapped to rough element count which has a 1% bucket-overflow probability") -print("Note that we currently have a hard-coded bucket size of 16 elements") +print("For each table size below, we list the number of sources before a bucket storing 16 entries") +print(" has a 1% chance of overflowing, cause it to spuriously accept packets from all 16 sources.") +#print("Note that we currently have a hard-coded bucket size of 16 elements") +print() +print("Entry sizes are generally 16 bytes for IPv4 or IPv6 matching source /64s or less.") +print(" When matching IPv6 sources longer than /64s entries are 32 bytes.") print() print("128K table * 16 bytes = %dMiB." % (128*16/1024)) -print_entry(4000, 128*1024, 4) -print_entry(15000, 128*1024, 8) +#print_entry(4000, 128*1024, 4) +#print_entry(15000, 128*1024, 8) print_entry(33000, 128*1024, 16) -print_entry(53000, 128*1024, 32) +#print_entry(53000, 128*1024, 32) print("256K table * 16 bytes = %dMiB." % (256*16/1024)) -print_entry(7000, 256*1024, 4) -print_entry(28000, 256*1024, 8) +#print_entry(7000, 256*1024, 4) +#print_entry(28000, 256*1024, 8) print_entry(63000, 256*1024, 16) -print_entry(104000, 256*1024, 32) +#print_entry(104000, 256*1024, 32) print("512K table * 16 bytes = %dMiB." % (512*16/1024)) -print_entry(13000, 512*1024, 4) -print_entry(52000, 512*1024, 8) +#print_entry(13000, 512*1024, 4) +#print_entry(52000, 512*1024, 8) print_entry(119000, 512*1024, 16) -print_entry(200000, 512*1024, 32) +#print_entry(200000, 512*1024, 32) print("1M table * 16 bytes = %dMiB." % (1024*16/1024)) -print_entry(23000, 1024*1024, 4) -print_entry(95000, 1024*1024, 8) +#print_entry(23000, 1024*1024, 4) +#print_entry(95000, 1024*1024, 8) print_entry(227000, 1024*1024, 16) -print_entry(387000, 1024*1024, 32) +#print_entry(387000, 1024*1024, 32) print("2M table * 16 bytes = %dMiB." % (2*1024*16/1024)) -print_entry(40000, 2*1024*1024, 4) -print_entry(175000, 2*1024*1024, 8) +#print_entry(40000, 2*1024*1024, 4) +#print_entry(175000, 2*1024*1024, 8) print_entry(431000, 2*1024*1024, 16) -print_entry(749000, 2*1024*1024, 32) +#print_entry(749000, 2*1024*1024, 32)