Skip to content

Commit

Permalink
Update Braktooth release & Documentation (ARM64 support)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matheus-Garbelini committed Aug 31, 2024
1 parent 41a60eb commit d3795b5
Show file tree
Hide file tree
Showing 80 changed files with 205,362 additions and 71 deletions.
458 changes: 390 additions & 68 deletions README.md

Large diffs are not rendered by default.

Binary file removed README.pdf
Binary file not shown.
Binary file added docs/figures/architecture_folders.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/drivers/esp-wrover-kit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/drivers/usrpb210.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/example_wdissector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/exploits/knob.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/gui_bt_controls.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/gui_bt_driver.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/gui_fuzzing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/gui_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/gui_server.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figures/ipc_latency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions docs/figures/latency/gen_latency_plots_serial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/usr/bin/env python3

# %%

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np


data1 = pd.read_csv('latency_5.10_4.txt', sep=" ", header=None)
data2 = pd.read_csv('latency_5.10_4_rt.txt', sep=" ", header=None)

max_us1 = np.max(data1)[0]
mean_us1 = np.mean(data1)[0]
min_us1 = np.min(data1)[0]
max_us2 = np.max(data2)[0]
mean_us2 = np.mean(data2)[0]
min_us2 = np.min(data2)[0]

print('Samples: %d' % (data1[0].count()))
print('Max time: %d' % (max_us1))
print('Min time: %d' % (min_us1))
print('Median time: %d' % (mean_us1))


# Configure font defaults
plt.rcParams.update({'font.size': 11, 'font.weight': 'bold'})
plt.rc('pdf', fonttype=42) # embed pdf fonts (truetype)

# Configure Grid
plt.grid(alpha=0.6)

# Main Plot code
plt.hist(data1, bins=100, range=[100, 500], density=True,
histtype='step', linewidth=1.8, linestyle='-',
label='Kernel 5.10\nMax: %d us\nMin: %d\nMean: %d' % (max_us1, min_us1, mean_us1))

plt.axvline(mean_us1, color='k', linestyle='-',
linewidth=1.3, alpha=0.8, label='_nolegend_')


plt.hist(data2, bins=100, range=[100, 500], histtype='step',
linewidth=1.8, linestyle='--', density=True,
label='Kernel 5.10 RT\nMax: %d us\nMin: %d\nMean: %d' % (max_us2, min_us2, mean_us2))

plt.axvline(min_us1, color='k', linestyle='-',
linewidth=1.3, alpha=0.8, label='_nolegend_')

min_ylim, max_ylim = plt.ylim()
plt.text(180, max_ylim*1.01, '%d us' % (min_us1))
plt.text(270, max_ylim*1.01, '%d us' % (mean_us1))


# Configure Legend
# plt.legend(labelspacing=0.1)
plt.legend(labelspacing=1.0, prop={'weight': 'bold', 'style': 'italic'})



# plt.xlabel('Interception Round Trip Time (us)')
# plt.xlabel('Interceptssion Round Trip Time (us)', fontweight='bold')

# Hide yaxis label
plt.gca().axes.yaxis.set_visible(False)
plt.subplots_adjust(top=0.5, right=0.95, left=0.05)
plt.gca().set_xlim(left = 150, right=500)
plt.gca().set_ylim(top=0.0125)

# Save/Show figure
# plt.savefig('interception_latency.svg')
plt.savefig('interception_latency.pdf') # requires latest lxml
plt.show()

# %%
40 changes: 40 additions & 0 deletions docs/figures/latency/gen_latency_plots_wifi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python3

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

# %%

data1 = pd.read_csv('wifi_interception_5.11_lowlatency.txt', sep=" ", header=None)

max_us1 = np.max(data1)[0]
mean_us1 = np.mean(data1)[0]
min_us1 = np.min(data1)[0]


print('Samples: %d' % (data1[0].count()))
print('Max time: %d' % (max_us1))
print('Min time: %d' % (min_us1))
print('Median time: %d' % (mean_us1))

plt.grid(alpha=0.6)
plt.hist(data1, bins=100, range=[10, 200], density=True,
histtype='step', linewidth=2, linestyle='-',
label='Kernel 5.11\nMax: %d us\nMin: %d\nMean: %d' % (max_us1, min_us1, mean_us1))

plt.axvline(mean_us1, color='k', linestyle='-',
linewidth=1, alpha=0.7, label='_nolegend_')


plt.axvline(min_us1, color='k', linestyle='-',
linewidth=1, alpha=0.7, label='_nolegend_')

min_ylim, max_ylim = plt.ylim()
plt.text(22, max_ylim*1.01, '%d us' % (min_us1))
plt.text(87, max_ylim*1.01, '%d us' % (mean_us1))

# plt.subplots_adjust(top=0.5)
plt.legend(labelspacing=1.5)

plt.savefig('interception_latency_wifi.svg')
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
88 changes: 88 additions & 0 deletions docs/figures/latency/geovani/gen_bridge_latency.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/usr/bin/env python3

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import matplotlib.patheffects as path_effects
from os import system


data = pd.read_csv('latency_data.txt', sep=" ", header=None)

def calc_stats(data):
max_us = np.max(data)[0]
mean_us = np.mean(data)[0]
min_us = np.min(data)[0]
print('Samples: %d' % (data[0].count()))
print('Max time: %d' % (max_us))
print('Min time: %d' % (min_us))
print('Median time: %d' % (mean_us))
return [max_us, mean_us, min_us]


def get_median_label(ax, fmt='.1f'):
lines = ax.get_lines()
boxes = [c for c in ax.get_children() if type(c).__name__ == 'PathPatch']
lines_per_box = int(len(lines) / len(boxes))
for median in lines[4:len(lines):lines_per_box]:
x, y = (data.mean() for data in median.get_data())
# choose value depending on horizontal or vertical plot orientation
value = x if (median.get_xdata()[1] - median.get_xdata()[0]) == 0 else y
# text = ax.text(x, y, f'{value:{fmt}}', ha='center', va='center',
# fontweight='bold', color='white')
# # create median-colored border around white text for contrast
# text.set_path_effects([
# path_effects.Stroke(linewidth=3, foreground=median.get_color()),
# path_effects.Normal(),
# ])

return value


[max_us1, mean_us1, min_us1] = calc_stats(data)
x_min = min_us1

# Configure font defaults
# plt.rcParams.update({'font.size': 10, 'font.weight': 'bold'})
plt.rcParams.update({'font.size': 10})
plt.rc('pdf', fonttype=42) # embed pdf fonts (truetype)

# Create axis
f, (ax_box, axs) = plt.subplots(2, sharex=True, gridspec_kw={"height_ratios": (.15, .85)})

# Create Plots
boxplot = sns.boxplot(data=data[0], orient="h", ax=ax_box, linewidth=1.2, color='cornflowerblue', saturation=1.0)
sns.histplot(data=data[0], bins=8000, element="step",
stat="frequency",
label='Max: %d us\nMin: %d us\nMedian: %d us' % (max_us1, min_us1, get_median_label(boxplot)),
color='cornflowerblue')

for i,box in enumerate(boxplot.artists):
box.set_edgecolor('black')
# iterate over whiskers and median lines
for j in range(6*i,6*(i+1)):
boxplot.lines[j].set_color('black')

# Graph Limits
axs.set_xlim(left=20, right=150)
ax_box.set_ylim(-0.7,0.7)

# Texts
axs.legend(labelspacing=0.8, prop={'style': 'italic'})
plt.xlabel('')
# plt.xlabel('BLEDefender Bridging Latency (us)')
plt.ylabel('Frequency')
plt.yticks([])
boxplot.set(yticklabels=[])
axs.grid(alpha=0.6)

# Size Adjust
plt.subplots_adjust(top=0.5, right=0.9, left=0.1, hspace=0.08)

# Save/Show figure
plt.savefig('interception_latency.pdf') # requires latest lxml
system("pdfcrop interception_latency.pdf --margin 0.1 interception_latency.pdf")


plt.show()
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit d3795b5

Please sign in to comment.