gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] 110/164: Improved IBF with salt + prime ibf size


From: gnunet
Subject: [gnunet] 110/164: Improved IBF with salt + prime ibf size
Date: Fri, 30 Jul 2021 15:32:56 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

commit 15d001feacc3ce279e467e5501018efed6b06cd8
Author: Elias Summermatter <elias.summermatter@seccom.ch>
AuthorDate: Wed May 26 10:05:21 2021 +0200

    Improved IBF with salt + prime ibf size
---
 src/setu/gnunet-service-setu.c                  | 23 ++++++++++++++---------
 src/setu/gnunet-service-setu_strata_estimator.c |  6 +++---
 src/setu/perf_setu_api.c                        |  4 ++--
 3 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index d56fcd1f2..3531e930a 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -53,12 +53,17 @@
 /**
  * Size of the IBFs in the strata estimator.
  */
-#define SE_IBF_SIZE 80
+#define SE_IBF_SIZE 79
+
+/**
+ * Primes for all 4 different strata estimators 79,83,89,97
+ */
+#define SE_IBFS_TOTAL_SIZE 348
 
 /**
  * The hash num parameter for the difference digests and strata estimators.
  */
-#define SE_IBF_HASH_NUM 4
+#define SE_IBF_HASH_NUM 3
 
 /**
  * Number of buckets that can be transmitted in one message.
@@ -806,7 +811,7 @@ load_config(struct Operation * op) {
     setu_cfg = GNUNET_CONFIGURATION_create();
     GNUNET_CONFIGURATION_load(setu_cfg,"perf_setu.conf");
 
-    /**
+
     long long number;
     float fl;
     GNUNET_CONFIGURATION_get_value_float(setu_cfg,"IBF", 
"BUCKET_NUMBER_FACTOR", &fl);
@@ -821,7 +826,7 @@ load_config(struct Operation * op) {
 
     GNUNET_CONFIGURATION_get_value_number(setu_cfg,"BOUNDARIES", 
"UPPER_ELEMENT", &number);
     op->upper_element_boundary = number;
-     **/
+
 
     op->peer_site = 0;
     op->active_passive_switches = 0;
@@ -1917,7 +1922,7 @@ check_union_p2p_strata_estimator (void *cls,
                      msg->header.type));
   len = ntohs (msg->header.size) - sizeof(struct StrataEstimatorMessage);
   if ((GNUNET_NO == is_compressed) &&
-      (len != SE_STRATA_COUNT * SE_IBF_SIZE * IBF_BUCKET_SIZE))
+      (len != SE_STRATA_COUNT * SE_IBFS_TOTAL_SIZE * IBF_BUCKET_SIZE))
   {
     GNUNET_break (0);
     return GNUNET_SYSERR;
@@ -1982,7 +1987,7 @@ handle_union_p2p_strata_estimator (void *cls,
   }
 
   remote_se = strata_estimator_create (SE_STRATA_COUNT,
-                                       SE_IBF_SIZE,
+                                       SE_IBFS_TOTAL_SIZE,
                                        SE_IBF_HASH_NUM);
   if (NULL == remote_se)
   {
@@ -3894,7 +3899,7 @@ handle_client_create_set (void *cls,
     struct MultiStrataEstimator *se;
 
     se = strata_estimator_create (SE_STRATA_COUNT,
-                                  SE_IBF_SIZE,
+                                  SE_IBFS_TOTAL_SIZE,
                                   SE_IBF_HASH_NUM);
     if (NULL == se)
     {
@@ -4619,13 +4624,13 @@ handle_client_accept (void *cls,
 
     /* kick off the operation */
     se = op->se;
-    buf = GNUNET_malloc (se->stratas[0]->strata_count * IBF_BUCKET_SIZE * 
se->stratas[0]->ibf_size * 4);
+    buf = GNUNET_malloc (se->stratas[0]->strata_count * IBF_BUCKET_SIZE * 
SE_IBFS_TOTAL_SIZE);
     len = strata_estimator_write (se,
                                   buf);
     perf_rtt.se.sent += 1;
     perf_rtt.se.sent_var_bytes += len;
 
-    if (len < se->stratas[0]->strata_count * IBF_BUCKET_SIZE * 
se->stratas[0]->ibf_size * 4)
+    if (len < se->stratas[0]->strata_count * IBF_BUCKET_SIZE * 
SE_IBFS_TOTAL_SIZE)
       type = GNUNET_MESSAGE_TYPE_SETU_P2P_SEC;
     else
       type = GNUNET_MESSAGE_TYPE_SETU_P2P_SE;
diff --git a/src/setu/gnunet-service-setu_strata_estimator.c 
b/src/setu/gnunet-service-setu_strata_estimator.c
index 55b7ad5ba..16ee83124 100644
--- a/src/setu/gnunet-service-setu_strata_estimator.c
+++ b/src/setu/gnunet-service-setu_strata_estimator.c
@@ -97,7 +97,7 @@ strata_estimator_read (const void *buf,
   dbuf = NULL;
   if (GNUNET_YES == is_compressed)
   {
-    osize = se->stratas[0]->ibf_size * IBF_BUCKET_SIZE * 
se->stratas[0]->strata_count * 4;
+    osize = SE_IBFS_TOTAL_SIZE * IBF_BUCKET_SIZE * 
se->stratas[0]->strata_count;
     dbuf = GNUNET_decompress (buf,
                               buf_len,
                               osize);
@@ -110,7 +110,7 @@ strata_estimator_read (const void *buf,
     buf_len = osize;
   }
 
-  if (buf_len != se->stratas[0]->strata_count * se->stratas[0]->ibf_size * 
IBF_BUCKET_SIZE * 4)
+  if (buf_len != se->stratas[0]->strata_count * SE_IBFS_TOTAL_SIZE * 
IBF_BUCKET_SIZE)
   {
     GNUNET_break (0);  /* very odd error */
     GNUNET_free (dbuf);
@@ -146,7 +146,7 @@ strata_estimator_insert (struct MultiStrataEstimator *se,
 
       struct IBF_Key salted_key;
       salt_key (&key,
-                strata_ctr,
+                strata_ctr ,
                 &salted_key);
       v = salted_key.key_val;
       for (i = 0; v & 1; v >>= 1, i++) {
diff --git a/src/setu/perf_setu_api.c b/src/setu/perf_setu_api.c
index 7188dc963..fad9baf68 100644
--- a/src/setu/perf_setu_api.c
+++ b/src/setu/perf_setu_api.c
@@ -447,7 +447,7 @@ static void execute_perf() {
     //FILE *out = fopen("perfstats.log", "w");
     //fprintf(out, "se_diff,active_passive_switches,bytes_transmitted,rtt\n");
     int full_diff_ctr=0;
-    for (int out_out_ctr = 3; out_out_ctr <= 4; out_out_ctr++) {
+    for (int out_out_ctr = 3; out_out_ctr <= 3; out_out_ctr++) {
 
         for (int out_ctr = 20; out_ctr <= 20; out_ctr++) {
             float base = 0.1;
@@ -477,7 +477,7 @@ static void execute_perf() {
                         GNUNET_ERROR_TYPE_ERROR,
                         _("Failed to write subsystem default identifier map to 
`%s'.\n"),
                         setu_cfg);
-            run_petf_thread(100000);
+            run_petf_thread(10000000);
         }
     }
     return 0;

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]