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
3422e5ec
Commit
3422e5ec
authored
Sep 15, 2021
by
Hejing Li
Committed by
Antoine Kaufmann
Jan 17, 2022
Browse files
add switch chain
parent
47dbf238
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
4 deletions
+90
-4
experiments/pyexps/pktgen.sh
experiments/pyexps/pktgen.sh
+74
-4
experiments/pyexps/run_pktgen.sh
experiments/pyexps/run_pktgen.sh
+16
-0
No files found.
experiments/pyexps/pktgen.sh
View file @
3422e5ec
...
...
@@ -36,7 +36,7 @@ run_switch(){
return
$pid
}
# - number of hosts
run_switch_dumbbell
(){
echo
"Starting switch dumbbell"
SWITCH_EXE
=
/DS/endhost-networking/work/sim/hejing/simbricks/sims/net/switch/net_switch
...
...
@@ -78,6 +78,72 @@ run_switch_dumbbell(){
return
$pid
}
# - number of hosts
# - number of middle switch
run_switch_chain
(){
echo
"Starting switch chain"
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
nswitch
=
0
nums_dec
=
$((
$2
-
1
))
while
[
$nswitch
-lt
$2
]
do
pswitch
=
$((
$nswitch
-
1
))
#the first
if
[
$nswitch
-eq
0
]
then
$SWITCH_EXE
-m
0
-S
500
-E
500
\
$args_0
-h
$RUN_DIR
/s0eth
>
$RUN_DIR
/switch_
${
nswitch
}
.log &
pid
=
$!
ALL_PIDS
=
"
$ALL_PIDS
$pid
"
SWITCH_PIDS
=
"
$SWITCH_PIDS
$pid
"
sleep
1
#the last
elif
[
$nswitch
-eq
$nums_dec
]
then
$SWITCH_EXE
-m
0
-S
500
-E
500
\
$args_1
-s
$RUN_DIR
/s
${
pswitch
}
eth
>
$RUN_DIR
/switch_
${
nswitch
}
.log &
pid
=
$!
ALL_PIDS
=
"
$ALL_PIDS
$pid
"
SWITCH_PIDS
=
"
$SWITCH_PIDS
$pid
"
else
$SWITCH_EXE
-m
0
-S
500
-E
500
\
-s
$RUN_DIR
/s
${
pswitch
}
eth
-h
$RUN_DIR
/s
${
nswitch
}
eth
>
$RUN_DIR
/switch_
${
nswitch
}
.log &
pid
=
$!
ALL_PIDS
=
"
$ALL_PIDS
$pid
"
SWITCH_PIDS
=
"
$SWITCH_PIDS
$pid
"
sleep
1
fi
((
nswitch++
))
done
return
}
cleanup
()
{
echo
"Cleaning up"
...
...
@@ -95,7 +161,9 @@ sighandler(){
}
trap
"sighandler"
SIGINT
date
echo
-n
"start: "
date
+%s
rm
-rf
$RUN_DIR
mkdir
-p
$RUN_DIR
r
=
0
...
...
@@ -107,7 +175,8 @@ done
sleep
2
#run_switch $1
run_switch_dumbbell
$1
#run_switch_dumbbell $1
run_switch_chain
$1
$2
#SWITCH_PID=$!
for
p
in
$PKTGEN_PIDS
;
do
...
...
@@ -120,4 +189,5 @@ echo "Pktgen Done, kill switch"
for
p
in
$SWITCH_PIDS
;
do
kill
-9
$p
done
date
\ No newline at end of file
echo
-n
"end: "
date
+%s
\ No newline at end of file
experiments/pyexps/run_pktgen.sh
0 → 100755
View file @
3422e5ec
#! /bin/bash
set
-x
RUN
=
5
itr
=
0
while
[
$itr
-lt
$RUN
]
do
nswitch
=
2
while
[
$nswitch
-lt
6
]
do
bash
-x
pyexps/pktgen.sh 2
$nswitch
&> out/pktgen/chain/s
${
nswitch
}
-h2-
${
itr
}
.out
((
nswitch++
))
done
((
itr++
))
done
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