openssl-static
This commit is contained in:
parent
76c1b9c08c
commit
3ef86c3593
3 changed files with 130 additions and 92 deletions
65
exp.py
65
exp.py
|
|
@ -72,11 +72,11 @@ CONFIGS = {
|
|||
# i7-4790 -> pi3
|
||||
"pi3": {
|
||||
"experiments": [
|
||||
"impl-cipher-ver",
|
||||
"impl-cert-ver",
|
||||
"impl-kex-ver",
|
||||
"zrtt",
|
||||
#"realistic"
|
||||
#"impl-cipher-ver",
|
||||
#"impl-cert-ver",
|
||||
#"impl-kex-ver",
|
||||
#"zrtt",
|
||||
"realistic"
|
||||
],
|
||||
"sides": [
|
||||
"client",
|
||||
|
|
@ -106,38 +106,6 @@ CONFIGS = {
|
|||
"notify_listen": ("0.0.0.0", 8090),
|
||||
"notify_addr": "192.168.3.1:8090",
|
||||
},
|
||||
"pi3-local": {
|
||||
"experiments": [
|
||||
"impl-cipher-ver",
|
||||
"impl-cert-ver",
|
||||
"impl-kex-ver",
|
||||
],
|
||||
"sides": [
|
||||
"client",
|
||||
"server",
|
||||
],
|
||||
"tls": [
|
||||
False,
|
||||
True,
|
||||
],
|
||||
"records": [
|
||||
{ "filename": "wikipedia", "repeat": 5 },
|
||||
],
|
||||
"repo_dir": "/home/exp/exp",
|
||||
"exp_dir": "/dev/shm/exp",
|
||||
"log_backup_dir": "/home/exp",
|
||||
"local_addr": "127.0.0.1",
|
||||
"remote_addr": "127.0.0.1",
|
||||
"remote_repo_dir": "/home/exp/exp",
|
||||
"wattmeter": False,
|
||||
"perf": True,
|
||||
"rapl": False,
|
||||
"sa": True,
|
||||
"perf_dir": "/home/exp/.cache/exp",
|
||||
"listen_port": 8080,
|
||||
"notify_listen": ("127.0.0.1", 8090),
|
||||
"notify_addr": "127.0.0.1:8090",
|
||||
},
|
||||
# i7-4790 -> core2
|
||||
"core2": {
|
||||
"experiments": [
|
||||
|
|
@ -242,7 +210,7 @@ CONFIGS = {
|
|||
"notify_listen": ("0.0.0.0", 8090),
|
||||
"notify_addr": "192.168.3.1:8090",
|
||||
"ld_preload": {
|
||||
"openssl": "/home/tuxmain/reps/tlsbench/libssl.so.3:/home/tuxmain/reps/tlsbench/libcrypto.so.3",
|
||||
"openssl": "/home/tuxmain/reps/tlsbench/libssl.so:/home/tuxmain/reps/tlsbench/libcrypto.so",
|
||||
}
|
||||
},
|
||||
"i5-local": {
|
||||
|
|
@ -291,7 +259,7 @@ CONFIGS = {
|
|||
True,
|
||||
],
|
||||
"records": [
|
||||
{ "filename": "wikipedia", "repeat": 400 },
|
||||
{ "filename": "wikipedia", "repeat": 12000 },
|
||||
],
|
||||
"repo_dir": "/home/pengelib/tlsbench",
|
||||
"exp_dir": "/dev/shm/exp",
|
||||
|
|
@ -306,7 +274,7 @@ CONFIGS = {
|
|||
"rapl": False,
|
||||
"sa": False,
|
||||
"listen_port": 8080,
|
||||
"idle": "idle - - - - - - - - - 1772205368.593937 1772206568.6941307 1200.1001937389374 0 298843 2217803 0 0 -",#TODO
|
||||
"idle": "idle - - - - - - - - - 1772205368.593937 1772206568.6941307 1200.1001937389374 0 298843 2217803 16.6 0 -",
|
||||
"notify_listen": ("0.0.0.0", 8090),
|
||||
"notify_addr": "TODO:8090",
|
||||
"ld_preload": {
|
||||
|
|
@ -370,6 +338,7 @@ IMPLS = [
|
|||
#"boring", # Google's fork of OpenSSL used in Chrome and Android
|
||||
#"graviola", # New crypto in Rust
|
||||
"openssl", # widely used
|
||||
#"openssl-static",
|
||||
#"ring", # used in most Rust stuff
|
||||
#"symcrypt", # Microsoft's crypto
|
||||
#"wolfcrypt" # used in embedded (won't build with rpxy for now)
|
||||
|
|
@ -406,9 +375,9 @@ EXPERIMENTS = {
|
|||
"AES_128_GCM_SHA256",
|
||||
"AES_256_GCM_SHA384",
|
||||
"CHACHA20_POLY1305_SHA256",
|
||||
#"ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,ECDHE_RSA_WITH_AES_128_GCM_SHA256",
|
||||
#"ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,ECDHE_RSA_WITH_AES_256_GCM_SHA384",
|
||||
#"ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
|
||||
"ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,ECDHE_RSA_WITH_AES_128_GCM_SHA256",
|
||||
"ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,ECDHE_RSA_WITH_AES_256_GCM_SHA384",
|
||||
"ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
|
||||
],
|
||||
"kexes": ["X25519"],
|
||||
"cert": ["prime256v1"],
|
||||
|
|
@ -419,7 +388,7 @@ EXPERIMENTS = {
|
|||
"impls": IMPLS,
|
||||
"ciphers": [
|
||||
"AES_128_GCM_SHA256",
|
||||
#"ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,ECDHE_RSA_WITH_AES_128_GCM_SHA256",
|
||||
"ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,ECDHE_RSA_WITH_AES_128_GCM_SHA256",
|
||||
],
|
||||
"kexes": ["X25519"],
|
||||
"cert": [
|
||||
|
|
@ -436,7 +405,7 @@ EXPERIMENTS = {
|
|||
"impls": IMPLS,
|
||||
"ciphers": [
|
||||
"AES_128_GCM_SHA256",
|
||||
#"ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,ECDHE_RSA_WITH_AES_128_GCM_SHA256",
|
||||
"ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,ECDHE_RSA_WITH_AES_128_GCM_SHA256",
|
||||
],
|
||||
"kexes": [
|
||||
"X25519",
|
||||
|
|
@ -505,9 +474,9 @@ def alg_filter(kex, cert, cipher, impl):
|
|||
if "MLKEM" in kex and "WITH" in cipher:
|
||||
# WITH means TLS1.2
|
||||
return False
|
||||
if "MLKEM" in kex and impl != "openssl" and impl != "aws-lc" and impl != "graviola":
|
||||
if "MLKEM" in kex and "openssl" not in impl and impl != "aws-lc" and impl != "graviola":
|
||||
return False
|
||||
if kex == "SECP256R1MLKEM768" and impl == "openssl":
|
||||
if kex == "SECP256R1MLKEM768" and "openssl" in impl:
|
||||
return False
|
||||
if cert == "secp384r1" and impl == "boring":
|
||||
return False
|
||||
|
|
@ -515,7 +484,7 @@ def alg_filter(kex, cert, cipher, impl):
|
|||
return False
|
||||
if kex == "MLKEM768" and impl == "graviola":
|
||||
return False
|
||||
if cipher == "ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,ECDHE_RSA_WITH_AES_256_GCM_SHA384" and impl == "openssl":
|
||||
if cipher == "ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,ECDHE_RSA_WITH_AES_256_GCM_SHA384" and "openssl" in impl:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
|
|
|||
74
g5kwatt.py
74
g5kwatt.py
|
|
@ -1,10 +1,12 @@
|
|||
import getpass, time, requests
|
||||
import getpass, time, requests, sys
|
||||
|
||||
def fetch(site, node, start, stop, user, psw):
|
||||
start_str = time.strftime("%Y-%m-%dT%H:%M", time.localtime(int(start)))
|
||||
stop_str = time.strftime("%Y-%m-%dT%H:%M", time.localtime(int(stop+61)))
|
||||
auth = requests.auth.HTTPBasicAuth(user, psw)
|
||||
resp = requests.get(f"https://api.grid5000.fr/stable/sites/{site}/metrics?nodes={node}&metrics=bmc_node_power_watt&start_time={start_str}&end_time={stop_str}", auth=auth)
|
||||
url = f"https://api.grid5000.fr/stable/sites/{site}/metrics?nodes={node}&metrics=bmc_node_power_watt&start_time={start_str}&end_time={stop_str}"
|
||||
print(url)
|
||||
resp = requests.get(url, auth=auth)
|
||||
if resp.status_code != 200:
|
||||
print("Status: ", resp.status_code)
|
||||
print(resp.content)
|
||||
|
|
@ -22,7 +24,60 @@ def fetch(site, node, start, stop, user, psw):
|
|||
if t >= start and t <= stop:
|
||||
last_power = sample["value"]
|
||||
last_time = t
|
||||
return energy
|
||||
ws = energy
|
||||
wh = ws / 3600
|
||||
return {
|
||||
"Ws": ws,
|
||||
"Wh": wh,
|
||||
"w_avg": ws / (stop - start)
|
||||
}
|
||||
|
||||
def insert_wh_into_logfile(path, site, node, user, psw):
|
||||
# Read
|
||||
logfile = open(path, "r")
|
||||
lines = logfile.readlines()
|
||||
logfile.close()
|
||||
|
||||
# Parse
|
||||
colnames = lines[0].removesuffix("\n").split(" ")
|
||||
col_start = colnames.index("start")
|
||||
col_start = colnames.index("stop")
|
||||
col_start = colnames.index("Wh")
|
||||
|
||||
logs = []
|
||||
records = {}
|
||||
for line in lines[1:]:
|
||||
cols = line.removesuffix("\n").split(" ")
|
||||
log = {}
|
||||
for col in range(len(cols)):
|
||||
log[colnames[col]] = cols[col]
|
||||
if log["record"] != "-":
|
||||
records[log["record"]] = ()
|
||||
logs.append(log)
|
||||
|
||||
# Modify & Write
|
||||
abort = False
|
||||
outfile = open(path+"-wh", "w")
|
||||
outfile.write(lines[0])
|
||||
for log in logs:
|
||||
line = ""
|
||||
for col in colnames:
|
||||
if line != "":
|
||||
line += " "
|
||||
|
||||
# Modify
|
||||
if col == "Wh" and (log[col] == "-" or log[col] == "0") and not abort:
|
||||
try:
|
||||
measure = fetch(site, node, float(log["start"]), float(log["stop"]), user, psw)
|
||||
log[col] = str(measure["Wh"])
|
||||
except Exception as e:
|
||||
print("Abort:", e)
|
||||
abort = True
|
||||
|
||||
line += log[col]
|
||||
line += "\n"
|
||||
outfile.write(line)
|
||||
outfile.close()
|
||||
|
||||
def get_psw():
|
||||
psw = None
|
||||
|
|
@ -41,9 +96,18 @@ def get_psw():
|
|||
return psw
|
||||
|
||||
def main():
|
||||
user = "pengelib"
|
||||
if len(sys.argv) < 5:
|
||||
print("Usage:")
|
||||
print("python g5watt.py <user> <site> <node> <logfile_path>")
|
||||
exit(0)
|
||||
|
||||
user = sys.argv[1]
|
||||
site = sys.argv[2]
|
||||
node = sys.argv[3]
|
||||
path = sys.argv[4]
|
||||
|
||||
psw = get_psw()
|
||||
print(fetch("nancy", "gros-69", 1772205368.593937, 1772206568.6941307, user, psw))
|
||||
insert_wh_into_logfile(path, site, node, user, psw)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
|||
83
plots.py
83
plots.py
|
|
@ -48,7 +48,7 @@ COL = {
|
|||
"cert": "alg",
|
||||
"kex": "kex",
|
||||
"ed": "ed",
|
||||
"side": "setup",
|
||||
"side": "side",
|
||||
"record": "record",
|
||||
}
|
||||
# Physical units by object
|
||||
|
|
@ -225,16 +225,18 @@ def make_log_plot(logs, exp, criterion, side, obj, record, machine=None, version
|
|||
|
||||
for log in logs:
|
||||
if log["exp"] == exp and log["record"] == record and log["side"] == side:
|
||||
#ver = VER_LABEL[log["cipher"]]
|
||||
#if log[COL[criterion]]+"/"+ver not in ciphers:
|
||||
# ciphers[log[COL[criterion]]+"/"+ver] = {}
|
||||
#ciphers[log[COL[criterion]]+"/"+ver][log["impl"]] = float(log[COL[obj]]) - idle_val * float(log["time"])
|
||||
if version != None and VER_LABEL[log["cipher"]] != version:
|
||||
continue
|
||||
if log[COL[criterion]] not in ciphers:
|
||||
ciphers[log[COL[criterion]]] = {}
|
||||
n = float(log.get("n", "1000"))
|
||||
ciphers[log[COL[criterion]]][log["impl"]] = (float(log[COL[obj]]) * conv_factor - idle_val * float(log["time"])) / n
|
||||
if version == None:
|
||||
ver = VER_LABEL[log["cipher"]]
|
||||
if log[COL[criterion]]+"/"+ver not in ciphers:
|
||||
ciphers[log[COL[criterion]]+"/"+ver] = {}
|
||||
ciphers[log[COL[criterion]]+"/"+ver][log["impl"]] = (float(log[COL[obj]]) * conv_factor - idle_val * float(log["time"])) / n
|
||||
else:
|
||||
if log[COL[criterion]] not in ciphers:
|
||||
ciphers[log[COL[criterion]]] = {}
|
||||
ciphers[log[COL[criterion]]][log["impl"]] = (float(log[COL[obj]]) * conv_factor - idle_val * float(log["time"])) / n
|
||||
if log["impl"] not in impls:
|
||||
impls.append(log["impl"])
|
||||
impls.sort()
|
||||
|
|
@ -244,22 +246,24 @@ def make_log_plot(logs, exp, criterion, side, obj, record, machine=None, version
|
|||
for impl in impls:
|
||||
if impl not in ciphers[cipher]:
|
||||
ciphers[cipher][impl] = 0
|
||||
#cipher_parts = cipher.split("/")
|
||||
#f.write("{}({}) - {}\n".format(
|
||||
# ALG_LABEL[cipher_parts[0]],
|
||||
# cipher_parts[1],
|
||||
# " ".join([
|
||||
# str(ciphers[cipher][impl])
|
||||
# for impl in impls
|
||||
# ]),
|
||||
#))
|
||||
f.write("{} - {}\n".format(
|
||||
ALG_LABEL[cipher],
|
||||
" ".join([
|
||||
str(ciphers[cipher][impl])
|
||||
for impl in impls
|
||||
]),
|
||||
))
|
||||
if version == None:
|
||||
cipher_parts = cipher.split("/")
|
||||
f.write("{}({}) - {}\n".format(
|
||||
ALG_LABEL[cipher_parts[0]],
|
||||
cipher_parts[1],
|
||||
" ".join([
|
||||
str(ciphers[cipher][impl])
|
||||
for impl in impls
|
||||
]),
|
||||
))
|
||||
else:
|
||||
f.write("{} - {}\n".format(
|
||||
ALG_LABEL[cipher],
|
||||
" ".join([
|
||||
str(ciphers[cipher][impl])
|
||||
for impl in impls
|
||||
]),
|
||||
))
|
||||
f.close()
|
||||
gnuplot_histogram(
|
||||
object=obj,
|
||||
|
|
@ -392,7 +396,7 @@ def make_profile_plot_grouped(logs, exp, criterion, side, record, group_by, no_f
|
|||
)
|
||||
|
||||
# Are CPU and energy proportional
|
||||
def make_linear_regression(logs):
|
||||
def make_linear_regression(logs, cat="impl"):
|
||||
idle_cpu = None
|
||||
idle_energy = None
|
||||
for log in logs:
|
||||
|
|
@ -410,11 +414,11 @@ def make_linear_regression(logs):
|
|||
sample_energy = float(log["Wh"]) - idle_energy * float(log["time"])
|
||||
samples_cpu["global"].append(sample_cpu)
|
||||
samples_energy["global"].append(sample_energy)
|
||||
if log["impl"] not in samples_cpu:
|
||||
samples_cpu[log["impl"]] = []
|
||||
samples_energy[log["impl"]] = []
|
||||
samples_cpu[log["impl"]].append(sample_cpu)
|
||||
samples_energy[log["impl"]].append(sample_energy)
|
||||
if log[cat] not in samples_cpu:
|
||||
samples_cpu[log[cat]] = []
|
||||
samples_energy[log[cat]] = []
|
||||
samples_cpu[log[cat]].append(sample_cpu)
|
||||
samples_energy[log[cat]].append(sample_energy)
|
||||
print("Pearson correlation coefficients (energy/cpu)")
|
||||
results = {}
|
||||
for impl in samples_cpu:
|
||||
|
|
@ -441,7 +445,7 @@ def cmp_versions(logs, exps, criteria, objs):
|
|||
idle_val = {obj:float(log[COL[obj]]) / float(log["time"]) for obj in objs}
|
||||
|
||||
for log in logs:
|
||||
if log["exp"] not in exps or log["setup"] == "none":
|
||||
if log["exp"] not in exps or log["tls"] == "0":
|
||||
continue
|
||||
ver = VER_LABEL[log["cipher"]]
|
||||
if ver not in ciphers:
|
||||
|
|
@ -510,19 +514,20 @@ if __name__ == "__main__":
|
|||
no_flamegraph = "-f" in sys.argv
|
||||
machine = getargv("-m", None)
|
||||
maketitle = "-t" not in sys.argv
|
||||
version = getargv("-v", None)
|
||||
|
||||
if cmd == "log":
|
||||
for side in ["client", "server"]:
|
||||
for record in records:
|
||||
make_log_plot(logs, "impl-cipher-ver", "cipher", side, "cpu", record, machine=machine, maketitle=maketitle, version="1.3")
|
||||
make_log_plot(logs, "impl-cipher-ver", "cipher", side, "energy", record, machine=machine, maketitle=maketitle, version="1.3")
|
||||
make_log_plot(logs, "impl-cert-ver", "cert", side, "cpu", record, machine=machine, maketitle=maketitle, version="1.3")
|
||||
make_log_plot(logs, "impl-cert-ver", "cert", side, "energy", record, machine=machine, maketitle=maketitle, version="1.3")
|
||||
make_log_plot(logs, "impl-kex-ver", "kex", side, "cpu", record, machine=machine, maketitle=maketitle, version="1.3")
|
||||
make_log_plot(logs, "impl-kex-ver", "kex", side, "energy", record, machine=machine, maketitle=maketitle, version="1.3")
|
||||
make_log_plot(logs, "impl-cipher-ver", "cipher", side, "cpu", record, machine=machine, maketitle=maketitle, version=version)
|
||||
make_log_plot(logs, "impl-cipher-ver", "cipher", side, "energy", record, machine=machine, maketitle=maketitle, version=version)
|
||||
make_log_plot(logs, "impl-cert-ver", "cert", side, "cpu", record, machine=machine, maketitle=maketitle, version=version)
|
||||
make_log_plot(logs, "impl-cert-ver", "cert", side, "energy", record, machine=machine, maketitle=maketitle, version=version)
|
||||
make_log_plot(logs, "impl-kex-ver", "kex", side, "cpu", record, machine=machine, maketitle=maketitle, version=version)
|
||||
make_log_plot(logs, "impl-kex-ver", "kex", side, "energy", record, machine=machine, maketitle=maketitle, version=version)
|
||||
make_log_plot(logs, "zrtt", "ed", side, "cpu", record, machine=machine, maketitle=maketitle, version="1.3")
|
||||
make_log_plot(logs, "zrtt", "ed", side, "energy", record, machine=machine, maketitle=maketitle, version="1.3")
|
||||
#cmp_versions(logs, ["impl-cipher-ver", "impl-cert-ver", "impl-kex-ver"], ["side", "cipher", "cert", "kex", "record"], ["cpu", "energy"])
|
||||
cmp_versions(logs, ["impl-cipher-ver", "impl-cert-ver", "impl-kex-ver"], ["side", "cipher", "cert", "kex", "record"], ["cpu", "energy"])
|
||||
elif cmd == "prof":
|
||||
for side in ["client", "server"]:
|
||||
for record in records:
|
||||
|
|
@ -536,4 +541,4 @@ if __name__ == "__main__":
|
|||
from scipy import stats
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
make_linear_regression(logs)
|
||||
make_linear_regression(logs, "alg")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue