-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathrun-experiment1
More file actions
executable file
·94 lines (85 loc) · 4.11 KB
/
run-experiment1
File metadata and controls
executable file
·94 lines (85 loc) · 4.11 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh -eu
# ==========================================================================
# _ _ _ ____ __ __ __ _
# | \ | | ___| |_| _ \ ___ _ __ / _| \/ | ___| |_ ___ _ __
# | \| |/ _ \ __| |_) / _ \ '__| |_| |\/| |/ _ \ __/ _ \ '__|
# | |\ | __/ |_| __/ __/ | | _| | | | __/ || __/ |
# |_| \_|\___|\__|_| \___|_| |_| |_| |_|\___|\__\___|_|
#
# NetPerfMeter -- Network Performance Meter
# Copyright (C) 2009-2026 by Thomas Dreibholz
# ==========================================================================
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contact: dreibh@simula.no
# Homepage: https://www.nntb.no/~dreibh/netperfmeter/
NAME="experiment1"
RUNTIME=30
CONTROL="--control-over-tcp" # E.g.: --control-over-tcp --local=... --controllocal=...
DESTINATIONS="127.0.0.1"
FLOWS="const0:const1024:const0:const1024"
PROTOCOLS="tcp sctp"
OPTION1="value1"
OPTION2="test1"
# ------ Prepare results directory --------------------------------------------------------
mkdir -p "$NAME"
cd "$NAME"
if [ ! -e results.summary ] ; then
echo "--varnames=Timestamp Destination Protocol Flow Option1 Option2 Directory" >results.summary
fi
for destination in $DESTINATIONS ; do
for flow in $FLOWS ; do
for protocol in $PROTOCOLS ; do
for option1 in $OPTION1 ; do
for option2 in $OPTION2 ; do
# ------ Prepare a unique directory for the results ------------------------
now="$(date -u -Iseconds)" # <- Unique name by using date
run="$now:$destination-$flow-$protocol-$option1-$option2"
directory="run-$(echo "$run" | sha1sum | cut -d' ' -f1)"
mkdir -p "$directory"
timestamp="$(getabstime)" # Current time as Unix timestamp in microseconds
# Do something, to configure non-NetPerfMeter options
# something-to-configure-option1 "$option1"
# something-to-configure-option2 "$option2"
# ...
# ------ Run NetPerfMeter --------------------------------------------------
(
cd "$directory"
# *******************************************************************
# NOTE: Add option `--vector "run.vec.bz2"` only when necessary!
# Vectors may use a lot of storage capacity for high-bandwidth flows!
# *******************************************************************
netperfmeter "[$destination]:9000" \
--config "run.config" \
--scalar "run.sca.bz2" \
--vector "run.vec.bz2" \
--runtime "$RUNTIME" \
${CONTROL} \
"--$protocol" const0:const1024:const0:const1024
)
# ------ Append run to results.summary -------------------------------------
(
echo "--values=$timestamp $destination $protocol $flow $option1 $option2 $directory"
echo "--input=$directory/run-active.sca.bz2"
echo "--values=$timestamp $destination $protocol $flow $option1 $option2 $directory"
echo "--input=$directory/run-passive.sca.bz2"
) >>results.summary
done
done
done
done
done
# ------ Run CreateSummary ----------------------------------------------------------------
createsummary --batch <results.summary