Browse Source

redone graphs for after pass 1 of Chapter 5

Stan Gurtler 2 years ago
parent
commit
c431a5f72c

BIN
prsona/plt/rep_verify-lambda-bandwidth-2.pdf → prsona/plt/epoch-lambda-bandwidth-all-2-loglog.pdf


BIN
prsona/plt/epoch-lambda-bandwidth-all-2.pdf


BIN
prsona/plt/epoch-lambda-cpu-all-2-loglog.pdf


BIN
prsona/plt/epoch-lambda-cpu-all-2.pdf


BIN
prsona/plt/epoch-servers-bandwidth-half-50.pdf → prsona/plt/epoch-servers-bandwidth-any-50-loglog.pdf


BIN
prsona/plt/epoch-workloads-bandwidth-25-50.pdf → prsona/plt/epoch-servers-bandwidth-any-50.pdf


BIN
prsona/plt/epoch-servers-cpu-any-50-loglog.pdf


BIN
prsona/plt/epoch-servers-cpu-half-50.pdf → prsona/plt/epoch-servers-cpu-any-50.pdf


BIN
prsona/plt/loglog-epoch-workloads-bandwidth-2-50.pdf → prsona/plt/epoch-workloads-bandwidth-2-50-loglog.pdf


BIN
prsona/plt/epoch-workloads-bandwidth-2-50.pdf


BIN
prsona/plt/loglog-epoch-workloads-cpu-2-50.pdf → prsona/plt/epoch-workloads-cpu-2-50-loglog.pdf


BIN
prsona/plt/epoch-workloads-cpu-2-50.pdf


BIN
prsona/plt/hbc-epoch-workloads-cpu-2-50-loglog.pdf


BIN
prsona/plt/hbc-epoch-workloads-cpu-2-50.pdf


+ 117 - 85
prsona/plt/plots.json

@@ -6,114 +6,177 @@
         "xVariable": "numClients",
         "whichGraph": "overall_epoch_cpu",
         "xLabel": "Number of clients",
-        "yLabel": "CPU time to calculate an epoch (s)",
-        "title": "Comparing CPU time for epochs across workloads",
+        "yLabel": "CPU time per server to calculate an epoch (s)",
+        "title": "Comparing CPU time for covert security\nepoch calculations across workloads",
         "fileNameStr": "epoch-workloads-cpu-2-50",
         "legendLoc": "upper left"
-    },
-    {
+    }, {
         "data": "server",
         "dataParts": ["", "2", "", "50"],
         "lineVariable": "workload",
         "xVariable": "numClients",
         "whichGraph": "overall_epoch_cpu",
         "xLabel": "Number of clients",
-        "yLabel": "CPU time to calculate an epoch (s)",
+        "yLabel": "CPU time per server to calculate an epoch (s)",
         "loglog": true,
-        "title": "Comparing CPU time for epochs across workloads",
-        "fileNameStr": "loglog-epoch-workloads-cpu-2-50",
+        "title": "Comparing CPU time for covert security\nepoch calculations across workloads (in loglog)",
+        "fileNameStr": "epoch-workloads-cpu-2-50-loglog",
         "legendLoc": "upper left"
-    },
-    {
+    }, {
         "data": "server",
-        "dataParts": ["", "2", "", "50"],
+        "dataParts": ["", "2", "", "0"],
         "lineVariable": "workload",
         "xVariable": "numClients",
-        "whichGraph": "overall_epoch_total",
+        "whichGraph": "overall_epoch_cpu",
+        "xLabel": "Number of clients",
+        "yLabel": "CPU time per server to calculate an epoch (s)",
+        "title": "Comparing CPU time for HBC security\nepoch calculations across workloads",
+        "fileNameStr": "hbc-epoch-workloads-cpu-2-50",
+        "legendLoc": "upper left"
+    }, {
+        "data": "server",
+        "dataParts": ["", "2", "", "0"],
+        "lineVariable": "workload",
+        "xVariable": "numClients",
+        "whichGraph": "overall_epoch_cpu",
         "xLabel": "Number of clients",
-        "yLabel": "Data sent/received to calculate an epoch (B)",
+        "yLabel": "CPU time per server to calculate an epoch (s)",
         "loglog": true,
-        "title": "Comparing bandwidth for epochs across workloads",
-        "fileNameStr": "loglog-epoch-workloads-bandwidth-2-50",
+        "title": "Comparing CPU time for HBC security\nepoch calculations across workloads (in loglog)",
+        "fileNameStr": "hbc-epoch-workloads-cpu-2-50-loglog",
         "legendLoc": "upper left"
-    },
-    {
+    }, {
         "data": "server",
-        "dataParts": ["", "", "25", "50"],
+        "dataParts": ["", "2", "", "50"],
         "lineVariable": "workload",
-        "xVariable": "numServers",
+        "xVariable": "numClients",
         "whichGraph": "overall_epoch_total",
-        "xLabel": "Number of servers",
-        "yLabel": "Data sent/received to calculate an epoch (B)",
-        "title": "Comparing bandwidth for epochs across workloads",
-        "fileNameStr": "epoch-workloads-bandwidth-25-50",
+        "xLabel": "Number of clients",
+        "yLabel": "Server-server bandwidth per server\nused to calculate an epoch (MB)",
+        "yUnit": "MB",
+        "title": "Comparing bandwidth for covert security\nepoch calculations across workloads",
+        "fileNameStr": "epoch-workloads-bandwidth-2-50",
         "legendLoc": "upper left"
-    },
-    {
+    }, {
         "data": "server",
         "dataParts": ["", "2", "", "50"],
         "lineVariable": "workload",
         "xVariable": "numClients",
         "whichGraph": "overall_epoch_total",
         "xLabel": "Number of clients",
-        "yLabel": "Data sent/received to calculate an epoch (MB)",
+        "yLabel": "Server-server bandwidth per server\nused to calculate an epoch (MB)",
         "yUnit": "MB",
-        "title": "Comparing bandwidth for epochs across workloads",
-        "fileNameStr": "epoch-workloads-bandwidth-2-50",
+        "loglog": true,
+        "title": "Comparing bandwidth for covert security\nepoch calculations across workloads (in loglog)",
+        "fileNameStr": "epoch-workloads-bandwidth-2-50-loglog",
         "legendLoc": "upper left"
-    },
-    {
+    }, {
         "data": "server",
         "dataParts": ["half", "", "", "50"],
         "lineVariable": "numServers",
         "xVariable": "numClients",
+        "ignoreWorkload": true,
         "whichGraph": "overall_epoch_cpu",
         "xLabel": "Number of clients",
         "yLabel": "CPU time to calculate an epoch (s)",
-        "title": "Comparing CPU time for epochs across numbers of servers",
-        "fileNameStr": "epoch-servers-cpu-half-50",
+        "title": "Comparing CPU time for covert security\nepoch calculations across numbers of servers",
+        "fileNameStr": "epoch-servers-cpu-any-50",
         "legendLoc": "upper left"
-    },
-    {
+    }, {
+        "data": "server",
+        "dataParts": ["half", "", "", "50"],
+        "lineVariable": "numServers",
+        "xVariable": "numClients",
+        "ignoreWorkload": true,
+        "whichGraph": "overall_epoch_cpu",
+        "xLabel": "Number of clients",
+        "yLabel": "CPU time to calculate an epoch (s)",
+        "loglog": true,
+        "title": "Comparing CPU time for covert security\nepoch calculations across numbers of servers (in loglog)",
+        "fileNameStr": "epoch-servers-cpu-any-50-loglog",
+        "legendLoc": "upper left"
+    }, {
         "data": "server",
         "dataParts": ["half", "", "", "50"],
         "lineVariable": "numServers",
         "xVariable": "numClients",
+        "ignoreWorkload": true,
         "whichGraph": "overall_epoch_total",
         "xLabel": "Number of clients",
-        "yLabel": "Data sent/received to calculate an epoch (MB)",
+        "yLabel": "Server-server bandwidth per server\nused to calculate an epoch (MB)",
         "yUnit": "MB",
-        "title": "Comparing bandwidth for epochs across numbers of servers",
-        "fileNameStr": "epoch-servers-bandwidth-half-50",
+        "title": "Comparing bandwidth for covert security\nepoch calculations across numbers of servers",
+        "fileNameStr": "epoch-servers-bandwidth-any-50",
         "legendLoc": "upper left"
-    },
-    {
+    }, {
+        "data": "server",
+        "dataParts": ["half", "", "", "50"],
+        "lineVariable": "numServers",
+        "xVariable": "numClients",
+        "ignoreWorkload": true,
+        "whichGraph": "overall_epoch_total",
+        "xLabel": "Number of clients",
+        "yLabel": "Server-server bandwidth per server\nused to calculate an epoch (MB)",
+        "yUnit": "MB",
+        "loglog": true,
+        "title": "Comparing bandwidth for covert security\nepoch calculations across numbers of servers (in loglog)",
+        "fileNameStr": "epoch-servers-bandwidth-any-50-loglog",
+        "legendLoc": "upper left"
+    }, {
 
         "data": "server",
         "dataParts": ["all", "2", "", ""],
         "lineVariable": "lambda",
         "xVariable": "numClients",
+        "ignoreWorkload": true,
         "whichGraph": "overall_epoch_cpu",
         "xLabel": "Number of clients",
         "yLabel": "CPU time to calculate an epoch (s)",
-        "title": "Comparing CPU time for epochs\nacross different values of lambda",
+        "title": "Comparing CPU time for covert security\nepoch calculations across different values of lambda",
         "fileNameStr": "epoch-lambda-cpu-all-2",
         "legendLoc": "upper left"
-    },
-    {
+    }, {
+
+        "data": "server",
+        "dataParts": ["all", "2", "", ""],
+        "lineVariable": "lambda",
+        "xVariable": "numClients",
+        "ignoreWorkload": true,
+        "whichGraph": "overall_epoch_cpu",
+        "xLabel": "Number of clients",
+        "yLabel": "CPU time to calculate an epoch (s)",
+        "loglog": true,
+        "title": "Comparing CPU time for covert security\nepoch calculations across different values of lambda\n(in loglog)",
+        "fileNameStr": "epoch-lambda-cpu-all-2-loglog",
+        "legendLoc": "upper left"
+    }, {
         "data": "server",
         "dataParts": ["all", "2", "", ""],
         "lineVariable": "lambda",
         "xVariable": "numClients",
+        "ignoreWorkload": true,
         "whichGraph": "overall_epoch_total",
         "xLabel": "Number of clients",
-        "yLabel": "Data sent/received to calculate an epoch (MB)",
+        "yLabel": "Server-server bandwidth per server\nused to calculate an epoch (MB)",
         "yUnit": "MB",
-        "title": "Comparing bandwidth for epochs\nacross different values of lambda",
+        "title": "Comparing bandwidth for covert security\nepoch calculations across different values of lambda",
         "fileNameStr": "epoch-lambda-bandwidth-all-2",
         "legendLoc": "upper left"
-    },
-    {
+    }, {
+        "data": "server",
+        "dataParts": ["all", "2", "", ""],
+        "lineVariable": "lambda",
+        "xVariable": "numClients",
+        "ignoreWorkload": true,
+        "whichGraph": "overall_epoch_total",
+        "xLabel": "Number of clients",
+        "yLabel": "Server-server bandwidth per server\nused to calculate an epoch (MB)",
+        "yUnit": "MB",
+        "loglog": true,
+        "title": "Comparing bandwidth for covert security\nepoch calculations across different values of lambda\n(in loglog)",
+        "fileNameStr": "epoch-lambda-bandwidth-all-2-loglog",
+        "legendLoc": "upper left"
+    }, {
 
         "data": "client",
         "dataParts": ["vote", "2", "", ""],
@@ -125,21 +188,19 @@
         "title": "Comparing CPU time for making vote rows\nacross different values of lambda",
         "fileNameStr": "vote-lambda-cpu-2",
         "legendLoc": "upper left"
-    },
-    {
+    }, {
         "data": "client",
         "dataParts": ["vote", "2", "", ""],
         "lineVariable": "lambda",
         "xVariable": "numClients",
-        "whichGraph": "vote_total",
+        "whichGraph": "vote_sent",
         "xLabel": "Number of clients",
-        "yLabel": "Data sent/received to make a new vote row (KB)",
+        "yLabel": "Client-server bandwidth\nused to make a new vote row (KB)",
         "yUnit": "KB", 
         "title": "Comparing bandwidth for making vote rows\nacross different values of lambda",
         "fileNameStr": "vote-lambda-bandwidth-2",
         "legendLoc": "upper left"
-    },
-    {
+    }, {
 
         "data": "client",
         "dataParts": ["rep", "2", "", ""],
@@ -150,24 +211,22 @@
         "yLabel": "CPU time to make a new reputation proof (s)",
         "title": "Comparing CPU time for making reputation proofs\nacross different values of lambda",
         "fileNameStr": "rep_prove-lambda-cpu-2",
-        "legendLoc": "upper right",
-        "legendBBoxAnchor": [1, 1]
-    },
-    {
+        "legendLoc": "lower right",
+        "legendBBoxAnchor": [1, 0]
+    }, {
         "data": "client",
         "dataParts": ["rep", "2", "", ""],
         "lineVariable": "lambda",
         "xVariable": "numClients",
         "whichGraph": "rep_prove_total",
         "xLabel": "Number of clients",
-        "yLabel": "Data sent/received to make a new reputation proof (KB)",
+        "yLabel": "Client-client bandwidth\nused to make and verify a new reputation proof (KB)",
         "yUnit": "KB", 
         "title": "Comparing bandwidth for making reputation proofs\nacross different values of lambda",
         "fileNameStr": "rep_prove-lambda-bandwidth-2",
         "legendLoc": "lower right",
         "legendBBoxAnchor": [1, 0]
-    },
-    {
+    }, {
 
         "data": "client",
         "dataParts": ["rep", "2", "", ""],
@@ -180,32 +239,5 @@
         "fileNameStr": "rep_verify-lambda-cpu-2",
         "legendLoc": "lower right",
         "legendBBoxAnchor": [1, 0]
-    },
-    {
-        "data": "client",
-        "dataParts": ["rep", "2", "", ""],
-        "lineVariable": "lambda",
-        "xVariable": "numClients",
-        "whichGraph": "rep_verify_total",
-        "xLabel": "Number of clients",
-        "yLabel": "Data sent/received to verify a new reputation proof (KB)",
-        "yUnit": "KB", 
-        "title": "Comparing bandwidth for verifying reputation proofs\nacross different values of lambda",
-        "fileNameStr": "rep_verify-lambda-bandwidth-2",
-        "legendLoc": "lower right",
-        "legendBBoxAnchor": [1, 0]
-    },
-    {
-        "data": "server",
-        "dataParts": ["all", "", "", "50"],
-        "lineVariable": "numServers",
-        "xVariable": "numClients",
-        "whichGraph": "vote_update_cpu",
-        "xLabel": "Number of clients",
-        "yLabel": "CPU time to verify a new vote row proof (s)",
-        "title": "Comparing CPU time for verifying vote row proofs\nacross different numbers of servers",
-        "fileNameStr": "vote_update_cpu-numServers-numClients-50",
-        "legendLoc": "lower right",
-        "legendBBoxAnchor": [1, 0]
     }
 ]

BIN
prsona/plt/rep_prove-lambda-bandwidth-2.pdf


BIN
prsona/plt/rep_prove-lambda-cpu-2.pdf


BIN
prsona/plt/rep_verify-lambda-cpu-2.pdf


BIN
prsona/plt/vote-lambda-bandwidth-2.pdf


BIN
prsona/plt/vote-lambda-cpu-2.pdf


BIN
prsona/plt/vote_update_cpu-numServers-numClients-50.pdf


+ 45 - 19
prsona/scripts/make_graphs.py

@@ -12,17 +12,32 @@ from contextlib import contextmanager
 PLOT_OPTIONS = {
     "workload": {
         "all": {
-            "legend": 'Workload: "all"',
+            "legend": 'Covert Security, Workload: "all"',
             "marker": '^',
             "color": "red"
         }, 
         "half": {
-            "legend": 'Workload: "half"',
+            "legend": 'Covert Security, Workload: "half"',
             "marker": 'X',
             "color": "green"
         }, 
         "no": {
-            "legend": 'Workload: "no"',
+            "legend": 'Covert Security, Workload: "no"',
+            "marker": '*',
+            "color": "blue"
+        },
+        "hbcall": {
+            "legend": 'HBC Security, Workload: "all"',
+            "marker": '^',
+            "color": "red"
+        }, 
+        "hbchalf": {
+            "legend": 'HBC Security, Workload: "half"',
+            "marker": 'X',
+            "color": "green"
+        }, 
+        "hbcno": {
+            "legend": 'HBC Security, Workload: "no"',
             "marker": '*',
             "color": "blue"
         }
@@ -38,11 +53,6 @@ PLOT_OPTIONS = {
             "marker": 'X',
             "color": "blue"
         },
-        3.5: {
-            "legend": "3 servers / 3 * 2",
-            "marker": '.',
-            "color": "magenta"
-        },
         4: {
             "legend": "4 servers",
             "marker": '*',
@@ -306,16 +316,19 @@ def readData(dataDirectory):
                         with open(os.path.expanduser(os.path.join(realDirectory, test, whichEntity, 'repProver.out')), 'r') as repProverFile:
                             for line in repProverFile:
                                 lineParts = line.rstrip().split(',')
-                                wallTime = float(lineParts[0])
-                                cpuTime = float(lineParts[1])
-                                dataRecv = float(lineParts[2])
-                                dataSent = float(lineParts[3])
+                                
+                                if not ('*' in lineParts[0]):
+                                    wallTime = float(lineParts[0])
+                                    cpuTime = float(lineParts[1])
+                                    dataRecv = float(lineParts[2])
+                                    dataSent = float(lineParts[3])
+
+                                    clientData[testParts[0]][testParts[1]][testParts[2]][testParts[3]]['rep_prove_wall'].append(wallTime)
+                                    clientData[testParts[0]][testParts[1]][testParts[2]][testParts[3]]['rep_prove_cpu'].append(cpuTime)
+                                    clientData[testParts[0]][testParts[1]][testParts[2]][testParts[3]]['rep_prove_recv'].append(dataRecv)
+                                    clientData[testParts[0]][testParts[1]][testParts[2]][testParts[3]]['rep_prove_sent'].append(dataSent)
+                                    clientData[testParts[0]][testParts[1]][testParts[2]][testParts[3]]['rep_prove_total'].append(dataRecv + dataSent)
 
-                                clientData[testParts[0]][testParts[1]][testParts[2]][testParts[3]]['rep_prove_wall'].append(wallTime)
-                                clientData[testParts[0]][testParts[1]][testParts[2]][testParts[3]]['rep_prove_cpu'].append(cpuTime)
-                                clientData[testParts[0]][testParts[1]][testParts[2]][testParts[3]]['rep_prove_recv'].append(dataRecv)
-                                clientData[testParts[0]][testParts[1]][testParts[2]][testParts[3]]['rep_prove_sent'].append(dataSent)
-                                clientData[testParts[0]][testParts[1]][testParts[2]][testParts[3]]['rep_prove_total'].append(dataRecv + dataSent)
                     except FileNotFoundError as e:
                         pass
 
@@ -351,6 +364,7 @@ def plotComparison(data, dataParts, xVariable, lineVariable, whichGraph, **kwarg
     loglog = kwargs['loglog'] if 'loglog' in kwargs else False
     yLim = kwargs['yLim'] if 'yLim' in kwargs else False
     aspect = kwargs['aspect'] if 'aspect' in kwargs else None
+    ignoreWorkload = kwargs['ignoreWorkload'] if 'ignoreWorkload' in kwargs else False
 
     fig = plt.figure()
     ax = fig.gca()
@@ -363,9 +377,10 @@ def plotComparison(data, dataParts, xVariable, lineVariable, whichGraph, **kwarg
         whichLines = 0
         lineSelection = [str(x) for x in data.keys() if x != "rep" and x != "vote"]
         lineSelection.sort()
+        ignoreWorkload = False
     elif lineVariable == 'numServers':
         whichLines = 1
-        lineSelection = [int(x) for x in data['all'].keys()]
+        lineSelection = [int(x) for x in data['no'].keys()]
         lineSelection.sort()
     elif lineVariable == 'numClients':
         whichLines = 2
@@ -381,6 +396,7 @@ def plotComparison(data, dataParts, xVariable, lineVariable, whichGraph, **kwarg
     if xVariable == 'workload':
         whichX = 0
         xSelection = data.keys()
+        ignoreWorkload = False
     elif xVariable == 'numServers':
         whichX = 1
         xSelection = [int(x) for x in data['all'].keys()]
@@ -412,7 +428,15 @@ def plotComparison(data, dataParts, xVariable, lineVariable, whichGraph, **kwarg
             dataParts[whichX] = str(x)
 
             try:
-                curr_data = data[dataParts[0]][dataParts[1]][dataParts[2]][dataParts[3]][whichGraph]
+                curr_data = []
+                if ignoreWorkload == False:
+                    curr_data = data[dataParts[0]][dataParts[1]][dataParts[2]][dataParts[3]][whichGraph]
+                else:
+                    for workload in ['all', 'half', 'no']:
+                        try:
+                            curr_data.extend(data[workload][dataParts[1]][dataParts[2]][dataParts[3]][whichGraph])
+                        except KeyError as e:
+                            pass
 
                 if len(curr_data) == 0:
                     continue
@@ -518,6 +542,8 @@ def main(dataDirectory, plotOptionsFile):
             kwargs["yLim"] = option["yLim"]
         if "aspect" in option:
             kwargs["aspect"] = option["aspect"]
+        if "ignoreWorkload" in option:
+            kwargs["ignoreWorkload"] = option["ignoreWorkload"]
 
         plotComparison(data, dataParts, xVariable, lineVariable, whichGraph, **kwargs)