[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[freehaven-cvs] To say these were the last simulations would be to p...



Update of /home/freehaven/cvsroot/doc/e2e-traffic/src
In directory moria.mit.edu:/tmp/cvs-serv29632

Modified Files:
	PLAN.3 analyze.py sim.cpp simmain.cpp trials.cpp 
Log Message:
To say these were the last simulations would be to put hope above experience

Index: PLAN.3
===================================================================
RCS file: /home/freehaven/cvsroot/doc/e2e-traffic/src/PLAN.3,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- PLAN.3	23 Jan 2004 00:32:15 -0000	1.10
+++ PLAN.3	24 Jan 2004 05:49:24 -0000	1.11
@@ -89,9 +89,8 @@
      N:8192    m:1,2   pM:60,90    4
      N:16384   m:1,2   pM:60,90    4
 
-  Total: 130 (easy!) {2u.1}   sekrit M19:00: 0 L:76.49 M:87.67 N:121.39
+  Total: 130 (easy!) {2u.1}  
                      {2u.1.1 running in reverse order}
-                              zermello Th01:38
           24         {2u.2}
 
 ===case 3.2: timed dyn-pool mix. (esox)
@@ -241,7 +240,11 @@
    .9           .5           {5b.7}
    .8,.7,.6,.5  .5           {5b.8}  
    .6,.5,.4     .5           {5b.8.1}
+   .5,.4        .5           {5b.8.1}
    .9           .6,.7,.8     {5b.9}
+   
+   .9           .5,.4,.3,.2,.1  {5b.10}
+   
 
 
 ===case 6: impact of partial observation
@@ -266,7 +269,7 @@
   .6        .30,.20       (case6.7.1)
   .1    .40,.30,.20       (case6.8)
   .6    .10,.05           (case6.9)
-  .1    .10               (case6.10.1) <dhcp14-49> Th:19:08
+  .1    .10               (case6.10.1)
   .1    .05               (case6.10.2) <cassandra> Th:19:08
 
 ----------------------------------------------------------------------

Index: analyze.py
===================================================================
RCS file: /home/freehaven/cvsroot/doc/e2e-traffic/src/analyze.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- analyze.py	23 Jan 2004 00:34:19 -0000	1.7
+++ analyze.py	24 Jan 2004 05:49:24 -0000	1.8
@@ -79,23 +79,25 @@
     return int(x*100)
 
 class RecipientDistribution:
-    MAXIMUM = 2000000 #off the scale
+    MAXIMUM = 1e50 #off the scale
     def __init__(self, M):
         self.M=M
         self.items = 0
-        self.lst = [[], #1/2,
+        self.lst = [[], #1st
+                    [], #1/2,
                     [], #3/4
                     [], #7/8
                     [], #15/16
                     [], #all-but-1
                     [], #all.
                     ]
-        self.positions = [ (0, M//2),
-                           (1, (M*3)//4),
-                           (2, (M*7)//8),
-                           (3, (M*15)//16),
-                           (4, M-1),
-                           (5, M) ]
+        self.positions = [ (0, 1),
+                           (1, M//2),
+                           (2, (M*3)//4),
+                           (3, (M*7)//8),
+                           (4, (M*15)//16),
+                           (5, M-1),
+                           (6, M) ]
         self.nGuessedAtRoundN = {}
     def addResult(self,res):
         got=len(res)-1
@@ -112,7 +114,7 @@
                 self.nGuessedAtRoundN[r] += 1
             except KeyError:
                 self.nGuessedAtRoundN[r] = 1
-    def getPercentile(self,pctile,maximum=2000000): # off the scale
+    def getPercentile(self,pctile): 
         r = []
         p = int(math.ceil(self.items * (pctile/100.0)))
         for l in self.lst:
@@ -120,7 +122,7 @@
             if p < len(l):
                 r.append(l[p])
             else:
-                r.append(maximum)
+                r.append(self.MAXIMUM)
         return r
 
 class ResultSet:
@@ -212,7 +214,7 @@
                    %(dp, nT, int(pS*100), int(pG*100), avgR, avgRA)),
 
             N_NAMES=6
-            names = ["1_2","3_4", "7_8", None, "but1", "all"]
+            names = ["1st","1_2","3_4", "7_8", None, "but1", "all"]
             for percentile in 50,80,90,95:
                 pct = nrtgn.getPercentile(percentile)
                 for idx in xrange(N_NAMES):

Index: sim.cpp
===================================================================
RCS file: /home/freehaven/cvsroot/doc/e2e-traffic/src/sim.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- sim.cpp	8 Jan 2004 03:57:30 -0000	1.10
+++ sim.cpp	24 Jan 2004 05:49:24 -0000	1.11
@@ -41,8 +41,7 @@
 void
 UniformBackground::addNTraffic(vec<int> &v_out, int nMessages)
 {
-  assert(nMessages >= 0);
-  while (nMessages--) {
+  while (nMessages-- > 0) {
     ++v_out[rng(nRecipients)];
   }
 }

Index: simmain.cpp
===================================================================
RCS file: /home/freehaven/cvsroot/doc/e2e-traffic/src/simmain.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- simmain.cpp	23 Jan 2004 00:32:15 -0000	1.30
+++ simmain.cpp	24 Jan 2004 05:49:24 -0000	1.31
@@ -407,6 +407,62 @@
   trial2u_base(5, 16384,  1,2,2,  .9, true);
 }
 
+
+void trial2r_base(int batchSize, int nRecips, int nAMin, int nAMax,
+		  int nAStep,
+		  double pMsg, bool sgw=false)
+		  
+{
+  for (int nAR = nAMin; (nAR <= nAMax && nAR < nRecips); nAR *= nAStep) {
+    UnkBGBatchTrialSpec s;
+    s.setNRecipients(nRecips).setNAliceRecipients(nAR)
+      .setBatchSize(batchSize).setPaddingLevel(0)
+      .setExpMsgDist(pMsg)
+      .setPMsgAlice(0.9)
+      .setPDummyAlice(0.0);
+    
+    if (sgw) {
+      s.setAliceIsSmallworld(1).setWeightAlice(1);
+    } else {
+      s.setAliceIsSmallworld(1).setWeightAlice(0);
+    } 
+      
+    s.setGranularity(10);
+    s.setCutoff(1000000);
+    int nBad = 0;
+    int nGood = 0;
+    for (int i = 1; i <= 100; ++i) {
+      s.write(std::cout);
+      std::cout << "\"" << i << "/" << 100 << "\"" << std::endl;
+      UnkBGBatchTrial trial(s);
+      TrialResult res = trial.attempt();
+      std::cout << res << std::endl << std::endl; 
+      if (res.failed)
+	++nBad;
+      else
+	++nGood;
+      if (nBad >= 5 && nGood < nBad/2) {
+	break;
+      }
+    }
+  }
+}
+
+void trial2r_1() {
+  for (int n = 32; n <= 65536; n *= 2) {
+    trial2r_base(125, n, 8,16,2, .5, false);
+  }
+}
+
+void trial2r_2() {
+  for (int n = 32; n <= 65536; n *= 2) {
+    trial2r_base(125, n, 8,16,2, .5, true);
+  }
+}
+
+
+
+
 void trial3()
 {
   // attack with small-worlds network and unknown background.
@@ -861,6 +917,20 @@
   trial5a_base(.6,.6,.9,1);
 }
 
+void trial5a_5()
+{
+  trial5a_base(.6,.6,  .5, 1);
+  trial5a_base(.6,.6,  .65, 1);
+  trial5a_base(.6,.6,  .7, 1);
+  trial5a_base(.6,.6,  .8, 1);
+}
+void trial5a_6()
+{
+  trial5a_base(.6,.6,  .5, 4);
+  trial5a_base(.6,.6,  .65, 4);
+  trial5a_base(.6,.6,  .7, 4);
+  trial5a_base(.6,.6,  .8, 4);
+}
 
 void trial5b_base(double pMsgA, double pDelay, int nPad, double pOnline,
 		  int pathLen=4)
@@ -880,7 +950,7 @@
 
   s.setGranularity(10);
   
-  s.setCutoff(1500000);
+  s.setCutoff(1000000);
   int nBad = 0;
   int nGood = 0;
   for (int i = 1; i <= 100; ++i) {
@@ -974,6 +1044,29 @@
   trial5b_base(.8,  .1, 1,  .9, 1);
 }
 
+void trial5b_10()
+{
+  trial5b_base(.5,  .1, 1,  .9, 1);
+  trial5b_base(.4,  .1, 1,  .9, 1);
+  trial5b_base(.3,  .1, 1,  .9, 1);
+  trial5b_base(.2,  .1, 1,  .9, 1);
+  trial5b_base(.1,  .1, 1,  .9, 1);
+}
+
+
+void trial5b_11()
+{
+  trial5b_base(.6,.6,2,.1,1);
+  trial5b_base(.6,.6,2,.3,1);
+  trial5b_base(.6,.6,2,.6,1);
+  trial5b_base(.6,.6,2,.9,1);
+}
+
+void trial5b_12()
+{
+  trial5b_base(.6,.1,2,.1,1);
+  trial5b_base(.9,.1,2,.1,1);
+}
 
 void trial6_base(double pDelay, double pObserve)
 {
@@ -1096,6 +1189,9 @@
   { "2u.1.1", trial2u_1_1 },
   { "2u.2", trial2u_2 },
 
+  { "2r.1", trial2r_1 },
+  { "2r.2", trial2r_2 },
+
   { "3", trial3 },
   { "3.1", trial3_1 },
   { "3.2", trial3_2 },
@@ -1132,6 +1228,8 @@
   { "5a.4.1", trial5a_4_1 },
   { "5a.4.2", trial5a_4_2 },
   { "5a.4.3", trial5a_4_3 },
+  { "5a.5", trial5a_5 },
+  { "5a.6", trial5a_6 },
 
   { "5b.1", trial5b_1 },
   { "5b.2", trial5b_2 },
@@ -1145,6 +1243,9 @@
   { "5b.8", trial5b_8 },
   { "5b.8.1", trial5b_8_1 },
   { "5b.9", trial5b_9 },
+  { "5b.10", trial5b_10 },
+  { "5b.11", trial5b_11 },
+  { "5b.12", trial5b_12 },
 
   { "6.1",    trial6_1 },
   { "6.2",    trial6_2 },

Index: trials.cpp
===================================================================
RCS file: /home/freehaven/cvsroot/doc/e2e-traffic/src/trials.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- trials.cpp	19 Jan 2004 01:02:54 -0000	1.14
+++ trials.cpp	24 Jan 2004 05:49:24 -0000	1.15
@@ -54,10 +54,11 @@
       res.nMsgsAliceReal += trafficIn.total(0);
       res.nRoundsAlice += 1;
     }
-    background->addNTraffic(trafficIn, nBatch-nAlice);
+    int bgvol = nBatch-nAlice; if (bgvol<0) bgvol=0;
+    background->addNTraffic(trafficIn, bgvol);
     res.nMsgs += nBatch;
     //std::cout << n << " "<< aTraffic << std::endl;
-    mixnet->addRound(trafficIn, nAlice, nBatch-nAlice, attacker);
+    mixnet->addRound(trafficIn, nAlice, bgvol, attacker);
     ++n;
     if (!(n % gran)) {
       if (n>=(gran*20) && gran <= granularity*128)

***********************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe freehaven-cvs       in the body. http://freehaven.net/