diff --git a/pq-tls-benchmark-framework/emulation-exp/code/install-prereqs-ubuntu.sh b/pq-tls-benchmark-framework/emulation-exp/code/install-prereqs-ubuntu.sh index fac25d9bc601e6f4f8919d01ab072d7b647dc7d8..056deaf65d45191db0627d62663d34c81e8e18cc 100755 --- a/pq-tls-benchmark-framework/emulation-exp/code/install-prereqs-ubuntu.sh +++ b/pq-tls-benchmark-framework/emulation-exp/code/install-prereqs-ubuntu.sh @@ -39,6 +39,8 @@ mkdir -p ${INSTALL_DIR}/cmake sh cmake-${CMAKE_VERSION}.${CMAKE_BUILD}-linux-x86_64.sh --skip-license --prefix=${INSTALL_DIR}/cmake +# Patch openssl to have a large CRYPTO_RECV_BUF +patch ${ROOT}/openssl/ssl/quic/quic_channel.c < ${ROOT}/../patches/openssl/quic_channel.c.patch # Build OpenSSL so 'libcrypto.so' is avaiable for the build of liboqs. With Ubuntu 22.04 not longer needed. ( @@ -96,7 +98,7 @@ echo "Openssl seems to be installed correctly" # export OPENSSL_CONF=${OPENSSL_INSTALL}/ssl/openssl.cnf # apply patches to nginx source -patch ${ROOT}/nginx-${NGINX_VERSION}/src/event/quic/ngx_event_quic_openssl_compat.c < ${ROOT}/../nginx-${NGINX_VERSION}-patches/ngx_event_quic_openssl_compat.c.diff +patch ${ROOT}/nginx-${NGINX_VERSION}/src/event/quic/ngx_event_quic_openssl_compat.c < ${ROOT}/../patches/nginx-${NGINX_VERSION}-patches/ngx_event_quic_openssl_compat.c.diff # build nginx with dynamically linked custom openssl # NOTE it may be that the first time nginx is built it is not linked correctly to the custom openssl, but just do it again, it should work diff --git a/pq-tls-benchmark-framework/emulation-exp/code/kex/scripts/generate_graphs.py b/pq-tls-benchmark-framework/emulation-exp/code/kex/scripts/generate_graphs.py index 181cb8dc049f4ffa6bd114fdc419c66410dbad98..92dd204acf2a71c4b99a252e184e4dda1e2f6e58 100755 --- a/pq-tls-benchmark-framework/emulation-exp/code/kex/scripts/generate_graphs.py +++ b/pq-tls-benchmark-framework/emulation-exp/code/kex/scripts/generate_graphs.py @@ -13,7 +13,7 @@ import scipy import helper_scripts.helper_functions as helper_functions -RESULTS_DIR = "saved/results-run-20240921-vm-p16" +RESULTS_DIR = "saved/results-run-20241028-vm-p16" FILTER_RESULTS = [] PLOTS_DIR = "plots" FEATHERS_DIR = "feathers" @@ -26,10 +26,10 @@ def main(): data = load_data() # generally they both only seconds for graphs when not generating for single algorithms - # plot_general_plots() # takes about 4 seconds + plot_general_plots() # takes about 4 seconds plot_lines(data) # takes about 1:50 min - # plot_static_data(data) # takes about 4 min - # plot_distributions(data) + plot_static_data(data) # takes about 4 min + plot_distributions(data) def load_data(): @@ -267,7 +267,7 @@ def get_x_axis(scenario, data, length): return data["srv_pkt_loss"] case "delay": return data["srv_delay"] - case "jitter_delay20": + case "jitter_delay20ms": return data["srv_jitter"] case "corrupt": return data["srv_corrupt"] @@ -784,9 +784,9 @@ def plot_distributions(data): sec_level=row["sec_level"], kem_alg=row["kem_alg"], ) - print( - f"scenario: {row['scenario']}, protocol: {row['protocol']}, sec_level: {row['sec_level']}, kem_alg: {row['kem_alg']}, len: {len(filtered_data)}" - ) + # print( + # f"scenario: {row['scenario']}, protocol: {row['protocol']}, sec_level: {row['sec_level']}, kem_alg: {row['kem_alg']}, len: {len(filtered_data)}" + # ) if filtered: filtered_data = pd.concat( @@ -796,7 +796,7 @@ def plot_distributions(data): filtered_data.iloc[[-1]], ] ) - print(filtered_data) + # print(filtered_data) plt.figure() x = get_x_axis(row["scenario"], filtered_data, len(filtered_data)) @@ -837,14 +837,14 @@ def plot_distributions(data): sec_level=row["sec_level"], kem_alg=row["kem_alg"], ) - print( - f"scenario: {row['scenario']}, protocol: {row['protocol']}, sec_level: {row['sec_level']}, kem_alg: {row['kem_alg']}" - ) + # print( + # f"scenario: {row['scenario']}, protocol: {row['protocol']}, sec_level: {row['sec_level']}, kem_alg: {row['kem_alg']}" + # ) for _, row in filtered_data.iterrows(): if row["scenario"] == "static": continue value = get_x_axis(row["scenario"], row, 1) - print(value) + # print(value) plt.figure() plt.violinplot(row["measurements"], showmedians=True) diff --git a/pq-tls-benchmark-framework/emulation-exp/code/kex/scripts/queries.py b/pq-tls-benchmark-framework/emulation-exp/code/kex/scripts/queries.py index fbf1ee7b1d0c521948e6a31288e17d98f0b3f29c..f0c0c0843bda56c3094e474feeacb27f39283bcc 100644 --- a/pq-tls-benchmark-framework/emulation-exp/code/kex/scripts/queries.py +++ b/pq-tls-benchmark-framework/emulation-exp/code/kex/scripts/queries.py @@ -3,26 +3,89 @@ import pandas as pd FEATHERS_DIR = "feathers" import generate_graphs as gg +import helper_scripts.helper_functions as hf def main(): data = pd.read_feather(f"{FEATHERS_DIR}/data.feather") - stats_of_qtl95_of_packetloss(data) + # print_kem_ids() + + # stats_of_qtl95_of_packetloss(data) + error_count_and_rate(data) def stats_of_qtl95_of_packetloss(data): ldata = data print("Stats of qtl95") - ldata = gg.filter_data( - ldata, scenario="packetloss", protocol="quic", sec_level="secLevel1" - ) + ldata = gg.filter_data(ldata, scenario="packetloss", protocol="quic") ldata = ldata.query("kem_alg == 'x25519' or kem_alg == 'frodo640aes'") + # ldata = ldata.query("kem_alg == 'mlkem1024' or kem_alg == 'frodo1344aes'") # ldata = ldata.query - + print("Showing data of packetloss quic") + ldata = ldata.drop( + columns=[ + "scenario", + "protocol", + "sec_level", + "cli_pkt_loss", + "cli_delay", + "cli_rate", + "measurements", + ] + ) print(ldata) +def error_count_and_rate(data): + print("Error count and rate") + ldata = data + print("Total index length") + print(len(ldata.index)) + print("Total error count") + print( + ldata["error_count"].sum() + ) # Grep tells there are 83996 CRYPTO_BUFFER_EXCEEDEDs, while total error count is just a bit above it 84186 + ldata = ldata.query("error_count > 0") + print("Total index length with error count > 0") + print(len(ldata.index)) + ldata = ldata[~ldata["kem_alg"].str.contains("frodo")] + print("Total index length with error count > 0 and without frodo") + print(len(ldata.index)) + print( + ldata[ + [ + "scenario", + "protocol", + "sec_level", + "kem_alg", + "error_count", + "error_rate", + ] + ] + ) + # print(ldata["scenario"].unique()) # all 10 scenarios + print("With error count > 1") + ldata = ldata.query("error_count > 1") + print( + ldata[ + [ + "scenario", + "protocol", + "sec_level", + "kem_alg", + "error_count", + "error_rate", + ] + ] + ) + + +def print_kem_ids(): + data = hf.get_kem_ids() + print(data) + + main() diff --git a/pq-tls-benchmark-framework/emulation-exp/code/nginx-1.26.1-patches/README.md b/pq-tls-benchmark-framework/emulation-exp/code/patches/nginx-1.26.1-patches/README.md similarity index 100% rename from pq-tls-benchmark-framework/emulation-exp/code/nginx-1.26.1-patches/README.md rename to pq-tls-benchmark-framework/emulation-exp/code/patches/nginx-1.26.1-patches/README.md diff --git a/pq-tls-benchmark-framework/emulation-exp/code/nginx-1.26.1-patches/ngx_event_quic_openssl_compat.c.diff b/pq-tls-benchmark-framework/emulation-exp/code/patches/nginx-1.26.1-patches/ngx_event_quic_openssl_compat.c.diff similarity index 100% rename from pq-tls-benchmark-framework/emulation-exp/code/nginx-1.26.1-patches/ngx_event_quic_openssl_compat.c.diff rename to pq-tls-benchmark-framework/emulation-exp/code/patches/nginx-1.26.1-patches/ngx_event_quic_openssl_compat.c.diff diff --git a/pq-tls-benchmark-framework/emulation-exp/code/patches/openssl/quic_channel.c.patch b/pq-tls-benchmark-framework/emulation-exp/code/patches/openssl/quic_channel.c.patch new file mode 100644 index 0000000000000000000000000000000000000000..15120c2ea4f0f25355e676be4fb1ce925694a709 --- /dev/null +++ b/pq-tls-benchmark-framework/emulation-exp/code/patches/openssl/quic_channel.c.patch @@ -0,0 +1,11 @@ +--- quic_channel.c 2024-10-28 22:14:44.035008380 +0100 ++++ quic_channel_with_larger_crypto_recv.c 2024-10-28 22:12:06.339646217 +0100 +@@ -30,7 +30,7 @@ + * TODO(QUIC SERVER): Implement retry logic + */ + +-#define INIT_CRYPTO_RECV_BUF_LEN 16384 ++#define INIT_CRYPTO_RECV_BUF_LEN 24576 + #define INIT_CRYPTO_SEND_BUF_LEN 16384 + #define INIT_APP_BUF_LEN 8192 +