Compare commits
No commits in common. "5d4d3e86720dfb5318bfc5480d7cbea6c185f673" and "752055866fed049c56dd2451894c7a124155cfb5" have entirely different histories.
5d4d3e8672
...
752055866f
4 changed files with 469 additions and 399 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
netreplay*
|
netreplay
|
||||||
powercap
|
powercap
|
||||||
__pycache__
|
__pycache__
|
||||||
rpxy_*
|
rpxy_*
|
||||||
|
|
|
||||||
12
README.md
12
README.md
|
|
@ -204,9 +204,7 @@ sudo make install
|
||||||
|
|
||||||
### Record
|
### Record
|
||||||
|
|
||||||
#### Installation
|
Authorize rpxy and netreplay to bind to ports 80 and 443:
|
||||||
|
|
||||||
Authorize netreplay to bind to ports 80 and 443:
|
|
||||||
```bash
|
```bash
|
||||||
sudo setcap CAP_NET_BIND_SERVICE=+eip netreplay
|
sudo setcap CAP_NET_BIND_SERVICE=+eip netreplay
|
||||||
```
|
```
|
||||||
|
|
@ -219,7 +217,11 @@ firefox -P tlsbench
|
||||||
|
|
||||||
In settings, disable DNS security.
|
In settings, disable DNS security.
|
||||||
|
|
||||||
In `about:config`, set `network.dns.forceResolve` to `127.0.0.1`.
|
In `about:config`, set:
|
||||||
|
* `devtools.chrome.enabled` to `true`
|
||||||
|
* `network.dns.forceResolve` to `127.0.0.1`
|
||||||
|
|
||||||
|
In the `about:config` tab, open the console, execute this script to override DNS for the selected names, and redirect them to localhost:
|
||||||
|
|
||||||
Run the shell commands:
|
Run the shell commands:
|
||||||
|
|
||||||
|
|
@ -230,8 +232,6 @@ python exp.py update-certs debug
|
||||||
|
|
||||||
In Firefox, go to security settings, Certificates, import `/dev/shm/exp/certs/prime256v1/ca.crt` and trust it for identifying websites.
|
In Firefox, go to security settings, Certificates, import `/dev/shm/exp/certs/prime256v1/ca.crt` and trust it for identifying websites.
|
||||||
|
|
||||||
#### After installation
|
|
||||||
|
|
||||||
Stop anything running on ports 80 or 443.
|
Stop anything running on ports 80 or 443.
|
||||||
|
|
||||||
Start the record proxy:
|
Start the record proxy:
|
||||||
|
|
|
||||||
53
plots.py
53
plots.py
|
|
@ -77,9 +77,6 @@ def gnuplot_histogram(**kwargs):
|
||||||
kwargs["machine"] = ", " + kwargs["machine"]
|
kwargs["machine"] = ", " + kwargs["machine"]
|
||||||
else:
|
else:
|
||||||
kwargs["machine"] = ""
|
kwargs["machine"] = ""
|
||||||
titleline = ""
|
|
||||||
if kwargs["maketitle"]:
|
|
||||||
titleline = 'set title font "CMU Sans Serif,12" "{object_title} by {criterion_title} ({record}, {side}{machine}) ({unit})"'.format(**kwargs)
|
|
||||||
cluster = ""
|
cluster = ""
|
||||||
for i in range(kwargs["nb_impls"]-1):
|
for i in range(kwargs["nb_impls"]-1):
|
||||||
cluster += """, "" using {}:xticlabels(1) title col""".format(i+4)
|
cluster += """, "" using {}:xticlabels(1) title col""".format(i+4)
|
||||||
|
|
@ -91,7 +88,7 @@ set boxwidth 0.9 absolute
|
||||||
set style fill solid 1.0 border lt -1
|
set style fill solid 1.0 border lt -1
|
||||||
set style histogram clustered gap 1 title textcolor lt -1
|
set style histogram clustered gap 1 title textcolor lt -1
|
||||||
set style data histograms
|
set style data histograms
|
||||||
{titleline}
|
set title font "CMU Sans Serif,12" "{object_title} by {criterion_title} ({record}, {side}{machine}) ({unit})"
|
||||||
#set xtics border in scale 0,0 nomirror rotate by -45 autojustify
|
#set xtics border in scale 0,0 nomirror rotate by -45 autojustify
|
||||||
set xtics border in scale 0,0 nomirror autojustify
|
set xtics border in scale 0,0 nomirror autojustify
|
||||||
#set key fixed right top vertical Right noreverse noenhanced autotitle nobox
|
#set key fixed right top vertical Right noreverse noenhanced autotitle nobox
|
||||||
|
|
@ -106,7 +103,7 @@ plot \
|
||||||
set term cairolatex pdf
|
set term cairolatex pdf
|
||||||
set output "{plots_dir}/{object}_by_{criterion}_{side}_{record}.tex"
|
set output "{plots_dir}/{object}_by_{criterion}_{side}_{record}.tex"
|
||||||
replot
|
replot
|
||||||
""".format(plots_dir=PLOTS_DIR, cluster=cluster, titleline=titleline, **kwargs))
|
""".format(plots_dir=PLOTS_DIR, cluster=cluster, **kwargs))
|
||||||
f.close()
|
f.close()
|
||||||
os.system("gnuplot {plots_dir}/{object}_by_{criterion}_{side}_{record}.gnuplot".format(plots_dir=PLOTS_DIR, **kwargs))
|
os.system("gnuplot {plots_dir}/{object}_by_{criterion}_{side}_{record}.gnuplot".format(plots_dir=PLOTS_DIR, **kwargs))
|
||||||
|
|
||||||
|
|
@ -115,8 +112,6 @@ def gnuplot_stacked_histogram(**kwargs):
|
||||||
kwargs["machine"] = ", " + kwargs["machine"]
|
kwargs["machine"] = ", " + kwargs["machine"]
|
||||||
else:
|
else:
|
||||||
kwargs["machine"] = ""
|
kwargs["machine"] = ""
|
||||||
if kwargs["maketitle"]:
|
|
||||||
titleline = 'set title font "CMU Sans Serif,12" "{object_title} by {criterion_title} ({record}, {side}{machine}) ({unit})"'.format(**kwargs)
|
|
||||||
cluster = ""
|
cluster = ""
|
||||||
#for i in range(kwargs["nb_impls"]-1):
|
#for i in range(kwargs["nb_impls"]-1):
|
||||||
# cluster += """, "" using {}:xticlabels(1) title col""".format(i+4)
|
# cluster += """, "" using {}:xticlabels(1) title col""".format(i+4)
|
||||||
|
|
@ -128,7 +123,7 @@ set boxwidth 0.9 absolute
|
||||||
set style fill solid 1.0 border lt -1
|
set style fill solid 1.0 border lt -1
|
||||||
set style histogram rowstacked
|
set style histogram rowstacked
|
||||||
set style data histograms
|
set style data histograms
|
||||||
{titleline}
|
set title font "CMU Sans Serif,12" "{object_title} by {criterion_title} ({record}, {side}{machine}) ({unit})"
|
||||||
set xtics border in scale 0,0 nomirror noenhanced rotate by 30 right
|
set xtics border in scale 0,0 nomirror noenhanced rotate by 30 right
|
||||||
set lmargin 9
|
set lmargin 9
|
||||||
set rmargin 1
|
set rmargin 1
|
||||||
|
|
@ -145,11 +140,11 @@ set term pict2e font ",10"
|
||||||
set output "{plots_dir}/{object}_by_{criterion}_{side}_{record}.tex"
|
set output "{plots_dir}/{object}_by_{criterion}_{side}_{record}.tex"
|
||||||
set key font ",10" spacing 0.8
|
set key font ",10" spacing 0.8
|
||||||
replot
|
replot
|
||||||
""".format(plots_dir=PLOTS_DIR, cluster=cluster, titleline=titleline, **kwargs).replace("aws_lc", "aws-lc"))
|
""".format(plots_dir=PLOTS_DIR, cluster=cluster, **kwargs).replace("aws_lc", "aws-lc"))
|
||||||
f.close()
|
f.close()
|
||||||
os.system("gnuplot {plots_dir}/{object}_by_{criterion}_{side}_{record}.gnuplot".format(plots_dir=PLOTS_DIR, **kwargs))
|
os.system("gnuplot {plots_dir}/{object}_by_{criterion}_{side}_{record}.gnuplot".format(plots_dir=PLOTS_DIR, **kwargs))
|
||||||
|
|
||||||
def make_log_plot(logs, exp, criterion, side, obj, record, machine=None, version=None, maketitle=True):
|
def make_log_plot(logs, exp, criterion, side, obj, record, machine=None, version=None):
|
||||||
f = open(f"/dev/shm/plots/{obj}_by_{criterion}_{side}_{record}.dat", "w")
|
f = open(f"/dev/shm/plots/{obj}_by_{criterion}_{side}_{record}.dat", "w")
|
||||||
ciphers = {}
|
ciphers = {}
|
||||||
impls = []
|
impls = []
|
||||||
|
|
@ -161,14 +156,14 @@ def make_log_plot(logs, exp, criterion, side, obj, record, machine=None, version
|
||||||
idle_val = float(log[COL[obj]]) / float(log["time"])
|
idle_val = float(log[COL[obj]]) / float(log["time"])
|
||||||
if log["exp"] != exp or log["record"] != record:
|
if log["exp"] != exp or log["record"] != record:
|
||||||
continue
|
continue
|
||||||
if log["side"] == side and log["tls"] == "0":
|
if log["setup"] == "none":
|
||||||
plain_line = "plain {}".format(float(log[COL[obj]]) - idle_val * float(log["time"]))
|
plain_line = "plain {}".format(float(log[COL[obj]]) - idle_val * float(log["time"]))
|
||||||
|
|
||||||
if plain_line == None:
|
if plain_line == None:
|
||||||
return
|
return
|
||||||
|
|
||||||
for log in logs:
|
for log in logs:
|
||||||
if log["exp"] == exp and log["record"] == record and log["side"] == side:
|
if log["exp"] == exp and log["record"] == record and log["setup"] == side:
|
||||||
#ver = VER_LABEL[log["cipher"]]
|
#ver = VER_LABEL[log["cipher"]]
|
||||||
#if log[COL[criterion]]+"/"+ver not in ciphers:
|
#if log[COL[criterion]]+"/"+ver not in ciphers:
|
||||||
# ciphers[log[COL[criterion]]+"/"+ver] = {}
|
# ciphers[log[COL[criterion]]+"/"+ver] = {}
|
||||||
|
|
@ -213,11 +208,10 @@ def make_log_plot(logs, exp, criterion, side, obj, record, machine=None, version
|
||||||
unit=UNIT[obj],
|
unit=UNIT[obj],
|
||||||
nb_impls=len(impls),
|
nb_impls=len(impls),
|
||||||
record=record,
|
record=record,
|
||||||
machine=machine,
|
machine=machine
|
||||||
maketitle=maketitle
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def make_profile_plot(logs, exp, criterion, side, record, no_flamegraph=False, machine=None, maketitle=False):
|
def make_profile_plot(logs, exp, criterion, side, record, no_flamegraph=False, machine=None):
|
||||||
f = open(f"/dev/shm/plots/profile_by_{criterion}_{side}_{record}.dat", "w")
|
f = open(f"/dev/shm/plots/profile_by_{criterion}_{side}_{record}.dat", "w")
|
||||||
runs = []
|
runs = []
|
||||||
functions = []
|
functions = []
|
||||||
|
|
@ -270,8 +264,7 @@ def make_profile_plot(logs, exp, criterion, side, record, no_flamegraph=False, m
|
||||||
unit=UNIT["profile"],
|
unit=UNIT["profile"],
|
||||||
record=record,
|
record=record,
|
||||||
nb_functions=len(functions)+1,
|
nb_functions=len(functions)+1,
|
||||||
machine=machine,
|
machine=machine
|
||||||
maketitle=maketitle
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Are CPU and energy proportional
|
# Are CPU and energy proportional
|
||||||
|
|
@ -391,27 +384,27 @@ if __name__ == "__main__":
|
||||||
os.makedirs("/dev/shm/plots", exist_ok=True)
|
os.makedirs("/dev/shm/plots", exist_ok=True)
|
||||||
|
|
||||||
no_flamegraph = "-f" in sys.argv
|
no_flamegraph = "-f" in sys.argv
|
||||||
|
|
||||||
machine = getargv("-m", None)
|
machine = getargv("-m", None)
|
||||||
maketitle = "-t" not in sys.argv
|
|
||||||
|
|
||||||
if cmd == "log":
|
if cmd == "log":
|
||||||
|
cmp_versions(logs, ["impl-cipher-ver", "impl-cert-ver", "impl-kex-ver"], ["side", "cipher", "cert", "kex", "record"], ["cpu", "energy"])
|
||||||
for side in ["client", "server"]:
|
for side in ["client", "server"]:
|
||||||
for record in records:
|
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, "cpu", record, machine=machine, 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-cipher-ver", "cipher", side, "energy", record, machine=machine, 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, "cpu", record, machine=machine, 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-cert-ver", "cert", side, "energy", record, machine=machine, 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, "cpu", record, machine=machine, 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-kex-ver", "kex", side, "energy", record, machine=machine, version="1.3")
|
||||||
make_log_plot(logs, "zrtt", "ed", side, "cpu", record, machine=machine, maketitle=maketitle, version="1.3")
|
make_log_plot(logs, "zrtt", "ed", side, "cpu", record, machine=machine, version="1.3")
|
||||||
make_log_plot(logs, "zrtt", "ed", side, "energy", record, machine=machine, maketitle=maketitle, version="1.3")
|
make_log_plot(logs, "zrtt", "ed", side, "energy", record, machine=machine, version="1.3")
|
||||||
#cmp_versions(logs, ["impl-cipher-ver", "impl-cert-ver", "impl-kex-ver"], ["side", "cipher", "cert", "kex", "record"], ["cpu", "energy"])
|
|
||||||
elif cmd == "prof":
|
elif cmd == "prof":
|
||||||
for side in ["client-local", "server-local"]:
|
for side in ["client-local", "server-local"]:
|
||||||
for record in records:
|
for record in records:
|
||||||
make_profile_plot(logs, "impl-cipher-ver", "cipher", side, record, no_flamegraph=no_flamegraph, machine=machine, maketitle=maketitle)
|
make_profile_plot(logs, "impl-cipher-ver", "cipher", side, record, no_flamegraph=no_flamegraph, machine=machine)
|
||||||
make_profile_plot(logs, "impl-cert-ver", "cert", side, record, no_flamegraph=no_flamegraph, machine=machine, maketitle=maketitle)
|
make_profile_plot(logs, "impl-cert-ver", "cert", side, record, no_flamegraph=no_flamegraph, machine=machine)
|
||||||
make_profile_plot(logs, "impl-kex-ver", "kex", side, record, no_flamegraph=no_flamegraph, machine=machine, maketitle=maketitle)
|
make_profile_plot(logs, "impl-kex-ver", "kex", side, record, no_flamegraph=no_flamegraph, machine=machine)
|
||||||
elif cmd == "correl":
|
elif cmd == "correl":
|
||||||
from scipy import stats
|
from scipy import stats
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue