summaryrefslogtreecommitdiff
path: root/script/setup_kernel_env.sh
blob: 4718aeb150456cb45ee9712940fcf90687fdab86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Run this script using `sudo sh setup_kernel_env.sh [PATH_TO_PCAP]`
# And the new kernel needs a restart to be activated

#!/bin/bash

if [ "$(id -u)" != "0" ]; then
   echo "[ERROR] This script must be run as root!"
   exit
fi

echo "[INFO] This script needs to run before executing `replicate_results.sh`."
echo "It (1) downloads traffic capture, "
echo "   (2) splits the giant pcap into smaller pcap files for different connections"
echo "   (3) install instrumented kernel and reboot the OS for activating the new kernel"
echo "Please choose the kernel named `Linux 5.6.3-customnetfilter` in the `Advanced options for Ubuntu` start menu"
echo "to enter the newly installed kernel."

echo "[INFO] Step0A: Download and split raw traffic captures"
mkdir $1
if [ $2 == "full_test" ]; then
    wget --directory-prefix $1/ http://mawi.nezu.wide.ad.jp/mawi/samplepoint-F/2020/202004071400.pcap.gz
    gzip -d $1/202004071400.pcap.gz
    ../bin/PcapSplitter -f $1/202004071400.pcap -m connection -o $1
    rm $1/202004071400.pcap.gz $1/202004071400.pcap
else
    wget --directory-prefix $1/ https://s3.amazonaws.com/tcpreplay-pcap-files/smallFlows.pcap
    ../bin/PcapSplitter -f $1/smallFlows.pcap -m connection -o $1
    rm $1/smallFlows.pcap
fi

echo "[INFO] Step0B: Install instrumented kernel"
sudo dpkg -i ../bin/*.deb
sudo reboot