Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
47dbf238
Commit
47dbf238
authored
Sep 15, 2021
by
Hejing Li
Committed by
Antoine Kaufmann
Jan 17, 2022
Browse files
pktgen script dumbbell
parent
1f4fbb86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
4 deletions
+52
-4
experiments/pyexps/pktgen.sh
experiments/pyexps/pktgen.sh
+52
-4
No files found.
experiments/pyexps/pktgen.sh
View file @
47dbf238
...
@@ -5,6 +5,7 @@ RUN_DIR="/tmp/hejing-work/pktgen"
...
@@ -5,6 +5,7 @@ RUN_DIR="/tmp/hejing-work/pktgen"
NUM_HOST
=
$1
NUM_HOST
=
$1
ALL_PIDS
=
""
ALL_PIDS
=
""
PKTGEN_PIDS
=
""
PKTGEN_PIDS
=
""
SWITCH_PIDS
=
""
# -inst num
# -inst num
run_pktgen
(){
run_pktgen
(){
echo
"starting host
$1
"
echo
"starting host
$1
"
...
@@ -35,6 +36,48 @@ run_switch(){
...
@@ -35,6 +36,48 @@ run_switch(){
return
$pid
return
$pid
}
}
run_switch_dumbbell
(){
echo
"Starting switch dumbbell"
SWITCH_EXE
=
/DS/endhost-networking/work/sim/hejing/simbricks/sims/net/switch/net_switch
args_0
=
""
args_1
=
""
iface
=
0
half
=
$((
$1
/
2
))
while
[
$iface
-lt
$half
]
do
args_0
=
"
$args_0
-s
$RUN_DIR
/eth.
$iface
"
#((iface+=2))
((
iface+
=
1
))
done
#iface=1
#num_inc=$(($1+1))
#while [ $iface -lt $num_inc ]
while
[
$iface
-lt
$1
]
do
args_1
=
"
$args_1
-s
$RUN_DIR
/eth.
$iface
"
#((iface+=2))
((
iface+
=
1
))
done
$SWITCH_EXE
-m
0
-S
500
-E
500
\
$args_0
-h
$RUN_DIR
/s0eth
>
$RUN_DIR
/log.switch &
pid
=
$!
ALL_PIDS
=
"
$ALL_PIDS
$pid
"
SWITCH_PIDS
=
"
$SWITCH_PIDS
$pid
"
sleep
1
$SWITCH_EXE
-m
0
-S
500
-E
500
\
$args_1
-s
$RUN_DIR
/s0eth
>
$RUN_DIR
/log.switch &
pid
=
$!
ALL_PIDS
=
"
$ALL_PIDS
$pid
"
SWITCH_PIDS
=
"
$SWITCH_PIDS
$pid
"
return
$pid
}
cleanup
()
{
cleanup
()
{
echo
"Cleaning up"
echo
"Cleaning up"
...
@@ -63,13 +106,18 @@ do
...
@@ -63,13 +106,18 @@ do
done
done
sleep
2
sleep
2
run_switch
$1
#run_switch $1
SWITCH_PID
=
$!
run_switch_dumbbell
$1
#SWITCH_PID=$!
for
p
in
$PKTGEN_PIDS
;
do
for
p
in
$PKTGEN_PIDS
;
do
wait
$p
wait
$p
done
done
echo
"kill switch"
echo
"Pktgen Done, kill switch"
kill
-9
$SWITCH_PID
#kill -9 $SWITCH_PID
for
p
in
$SWITCH_PIDS
;
do
kill
-9
$p
done
date
date
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment