option skip verif
This commit is contained in:
parent
e754be81f4
commit
76c1b9c08c
3 changed files with 77 additions and 17 deletions
|
|
@ -387,7 +387,11 @@ scp records/wikipedia nancy.g5k:tlsbench/records/
|
||||||
LD_PRELOAD="/home/pengelib/tlsbench/libssl.so.3.6 /home/pengelib/tlsbench/libcrypto.so.3.6" ./netreplay --help
|
LD_PRELOAD="/home/pengelib/tlsbench/libssl.so.3.6 /home/pengelib/tlsbench/libcrypto.so.3.6" ./netreplay --help
|
||||||
```
|
```
|
||||||
|
|
||||||
https://api.grid5000.fr/stable/sites/lyon/metrics?nodes=dahu-6&metrics=wattmetre_power_watt,bmc_node_power_watt&start_time=2026-02-26T14:00&end_time=2026-02-26T14:40
|
#### Wattmetre
|
||||||
|
|
||||||
|
API timestamp at Paris time.
|
||||||
|
|
||||||
|
https://api.grid5000.fr/stable/sites/nancy/metrics?nodes=gros-69&metrics=bmc_node_power_watt&start_time=2026-02-26T14:00&end_time=2026-02-26T14:40
|
||||||
|
|
||||||
## Problems
|
## Problems
|
||||||
|
|
||||||
|
|
|
||||||
39
exp.py
39
exp.py
|
|
@ -208,10 +208,11 @@ CONFIGS = {
|
||||||
# i7-4790 -> i5-7300HQ
|
# i7-4790 -> i5-7300HQ
|
||||||
"i5": {
|
"i5": {
|
||||||
"experiments": [
|
"experiments": [
|
||||||
"impl-cipher-ver",
|
#"impl-cipher-ver",
|
||||||
"impl-cert-ver",
|
#"impl-cert-ver",
|
||||||
"impl-kex-ver",
|
#"impl-kex-ver",
|
||||||
"zrtt",
|
#"zrtt",
|
||||||
|
"realistic",
|
||||||
],
|
],
|
||||||
"sides": [
|
"sides": [
|
||||||
"client",
|
"client",
|
||||||
|
|
@ -222,7 +223,7 @@ CONFIGS = {
|
||||||
True,
|
True,
|
||||||
],
|
],
|
||||||
"records": [
|
"records": [
|
||||||
{ "filename": "wikipedia", "repeat": 2000 },
|
{ "filename": "wikipedia", "repeat": 1000 },
|
||||||
],
|
],
|
||||||
"repo_dir": "/home/tuxmain/reps/tlsbench",
|
"repo_dir": "/home/tuxmain/reps/tlsbench",
|
||||||
"exp_dir": "/dev/shm/exp",
|
"exp_dir": "/dev/shm/exp",
|
||||||
|
|
@ -237,9 +238,12 @@ CONFIGS = {
|
||||||
"rapl": True,
|
"rapl": True,
|
||||||
"sa": True,
|
"sa": True,
|
||||||
"listen_port": 8080,
|
"listen_port": 8080,
|
||||||
"idle": "idle - - - - - - - - - 600.000194311142 0.0 1822 6541 1.3880000000000052 304283035 -",
|
"idle": "idle - - - - - - - - - 1772446308.8950071 1772447508.8950853 1200.000078201294 0 1747 6555 2.4309999999999974 564883014 -",
|
||||||
"notify_listen": ("0.0.0.0", 8090),
|
"notify_listen": ("0.0.0.0", 8090),
|
||||||
"notify_addr": "192.168.3.1: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",
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"i5-local": {
|
"i5-local": {
|
||||||
"experiments": [
|
"experiments": [
|
||||||
|
|
@ -294,7 +298,7 @@ CONFIGS = {
|
||||||
"log_backup_dir": "/home/pengelib",
|
"log_backup_dir": "/home/pengelib",
|
||||||
"local_addr": "TODO",
|
"local_addr": "TODO",
|
||||||
"remote_addr": "172.16.52.6",
|
"remote_addr": "172.16.52.6",
|
||||||
"remote_ssh": "pengelib@nova-6",
|
"remote_ssh": "pengelib@gros-69",
|
||||||
"remote_psw": None,
|
"remote_psw": None,
|
||||||
"remote_repo_dir": "/home/pengelib/tlsbench",
|
"remote_repo_dir": "/home/pengelib/tlsbench",
|
||||||
"wattmeter": False,
|
"wattmeter": False,
|
||||||
|
|
@ -302,11 +306,11 @@ CONFIGS = {
|
||||||
"rapl": False,
|
"rapl": False,
|
||||||
"sa": False,
|
"sa": False,
|
||||||
"listen_port": 8080,
|
"listen_port": 8080,
|
||||||
"idle": "idle - - - - - - - - - 600.000194311142 0.0 1822 6541 1.3880000000000052 304283035 -",#TODO
|
"idle": "idle - - - - - - - - - 1772205368.593937 1772206568.6941307 1200.1001937389374 0 298843 2217803 0 0 -",#TODO
|
||||||
"notify_listen": ("0.0.0.0", 8090),
|
"notify_listen": ("0.0.0.0", 8090),
|
||||||
"notify_addr": "TODO:8090",
|
"notify_addr": "TODO:8090",
|
||||||
"ld_preload": {
|
"ld_preload": {
|
||||||
"openssl": "LD_PRELOAD=/home/pengelib/openssl-openssl-3.6.1/libssl.so.3:/home/pengelib/openssl-openssl-3.6.1/libcrypto.so.3",
|
"openssl": "/home/pengelib/openssl-openssl-3.6.1/libssl.so.3:/home/pengelib/openssl-openssl-3.6.1/libcrypto.so.3",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -362,11 +366,11 @@ CERT_SIGN_ALGS = [
|
||||||
"rsa2048", "rsa3072", "rsa4096", # widely used
|
"rsa2048", "rsa3072", "rsa4096", # widely used
|
||||||
]
|
]
|
||||||
IMPLS = [
|
IMPLS = [
|
||||||
"aws-lc", # Amazon's crypto widely used in Rust stuff
|
#"aws-lc", # Amazon's crypto widely used in Rust stuff
|
||||||
"boring", # Google's fork of OpenSSL used in Chrome and Android
|
#"boring", # Google's fork of OpenSSL used in Chrome and Android
|
||||||
#"graviola", # New crypto in Rust
|
#"graviola", # New crypto in Rust
|
||||||
"openssl", # widely used
|
"openssl", # widely used
|
||||||
"ring", # used in most Rust stuff
|
#"ring", # used in most Rust stuff
|
||||||
#"symcrypt", # Microsoft's crypto
|
#"symcrypt", # Microsoft's crypto
|
||||||
#"wolfcrypt" # used in embedded (won't build with rpxy for now)
|
#"wolfcrypt" # used in embedded (won't build with rpxy for now)
|
||||||
]
|
]
|
||||||
|
|
@ -651,10 +655,10 @@ def run_netreplay_server(ssh, exp_dir, repo_dir, record, listen_addr, listen_por
|
||||||
if tls:
|
if tls:
|
||||||
cmd.append("--tls")
|
cmd.append("--tls")
|
||||||
cmdline = " ".join(cmd)
|
cmdline = " ".join(cmd)
|
||||||
print(cmdline)
|
#print(cmdline)
|
||||||
return ssh_run_bg(ssh, cmdline, env)
|
return ssh_run_bg(ssh, cmdline, env)
|
||||||
|
|
||||||
def run_netreplay_client(ssh, exp_dir, repo_dir, record, remote_addr, remote_port, tls, impl, certs_dir, only_record=None, ciphers=None, kexes=None, earlydata="0", debug=False, notify_addr=None):
|
def run_netreplay_client(ssh, exp_dir, repo_dir, record, remote_addr, remote_port, tls, impl, certs_dir, only_record=None, ciphers=None, kexes=None, earlydata="0", debug=False, notify_addr=None, ld_preload=None, skip_verif=False):
|
||||||
if exp_dir[-1] != "/":
|
if exp_dir[-1] != "/":
|
||||||
exp_dir += "/"
|
exp_dir += "/"
|
||||||
repo_dir = repo_dir.removesuffix("/")
|
repo_dir = repo_dir.removesuffix("/")
|
||||||
|
|
@ -674,8 +678,10 @@ def run_netreplay_client(ssh, exp_dir, repo_dir, record, remote_addr, remote_por
|
||||||
cmd += ["--record", only_record]
|
cmd += ["--record", only_record]
|
||||||
if notify_addr != None:
|
if notify_addr != None:
|
||||||
cmd += ["-n", notify_addr]
|
cmd += ["-n", notify_addr]
|
||||||
|
if skip_verif:
|
||||||
|
cmd.append("-s")
|
||||||
cmdline = " ".join(cmd)
|
cmdline = " ".join(cmd)
|
||||||
print(cmdline)
|
#print(cmdline)
|
||||||
return ssh_run_bg(ssh, cmdline, env)
|
return ssh_run_bg(ssh, cmdline, env)
|
||||||
|
|
||||||
# Run with or without SSH
|
# Run with or without SSH
|
||||||
|
|
@ -693,9 +699,9 @@ def ssh_run(ssh, cmd, env={}, **kwargs):
|
||||||
|
|
||||||
# Run with or without SSH
|
# Run with or without SSH
|
||||||
def ssh_run_bg(ssh, cmd, env={}, **kwargs):
|
def ssh_run_bg(ssh, cmd, env={}, **kwargs):
|
||||||
|
print(cmd)
|
||||||
if ssh == None:
|
if ssh == None:
|
||||||
# As long as there is no argument containing a space (escaped or quoted), we're fine
|
# As long as there is no argument containing a space (escaped or quoted), we're fine
|
||||||
print(cmd)
|
|
||||||
return subprocess.Popen(cmd.split(" "), env=env)
|
return subprocess.Popen(cmd.split(" "), env=env)
|
||||||
else:
|
else:
|
||||||
# https://stackoverflow.com/questions/8775598/how-to-start-a-background-process-with-nohup-using-fabric
|
# https://stackoverflow.com/questions/8775598/how-to-start-a-background-process-with-nohup-using-fabric
|
||||||
|
|
@ -924,6 +930,7 @@ def run_exp(config, only_record=None, idle=False, shutdown=False, debug=False):
|
||||||
debug=debug,
|
debug=debug,
|
||||||
notify_addr=config["notify_addr"],
|
notify_addr=config["notify_addr"],
|
||||||
ld_preload=config["ld_preload"] if "ld_preload" in config else None,
|
ld_preload=config["ld_preload"] if "ld_preload" in config else None,
|
||||||
|
skip_verif=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
prof_filename = "-"
|
prof_filename = "-"
|
||||||
|
|
|
||||||
49
g5kwatt.py
Normal file
49
g5kwatt.py
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
import getpass, time, requests
|
||||||
|
|
||||||
|
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)
|
||||||
|
if resp.status_code != 200:
|
||||||
|
print("Status: ", resp.status_code)
|
||||||
|
print(resp.content)
|
||||||
|
exit(1)
|
||||||
|
data = resp.json()
|
||||||
|
|
||||||
|
energy = 0
|
||||||
|
last_power = None
|
||||||
|
last_time = 0
|
||||||
|
for sample in data:
|
||||||
|
t = time.mktime(time.strptime(sample["timestamp"], "%Y-%m-%dT%H:%M:%S.%f%z"))
|
||||||
|
if last_power != None:
|
||||||
|
energy += last_power * (t - last_time)
|
||||||
|
last_power = None
|
||||||
|
if t >= start and t <= stop:
|
||||||
|
last_power = sample["value"]
|
||||||
|
last_time = t
|
||||||
|
return energy
|
||||||
|
|
||||||
|
def get_psw():
|
||||||
|
psw = None
|
||||||
|
try:
|
||||||
|
f = open("/dev/shm/g5k_psw", "r")
|
||||||
|
psw = f.read()
|
||||||
|
f.close()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
if psw:
|
||||||
|
return psw
|
||||||
|
psw = getpass.getpass("Psw: ")
|
||||||
|
f = open("/dev/shm/g5k_psw", "w")
|
||||||
|
f.write(psw)
|
||||||
|
f.close()
|
||||||
|
return psw
|
||||||
|
|
||||||
|
def main():
|
||||||
|
user = "pengelib"
|
||||||
|
psw = get_psw()
|
||||||
|
print(fetch("nancy", "gros-69", 1772205368.593937, 1772206568.6941307, user, psw))
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue