-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopo.sh
65 lines (54 loc) · 1.56 KB
/
topo.sh
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
#!/bin/bash
mod=$1
net=$2
bw_array=()
second_link=()
burst=()
b=1
d=1
while IFS=, read -r col1
do
bw_array[$b]=$col1
#second_link[$b]=$col1
#burst[$d]=$col2
#echo "I got:$col1|$col3"
b=$((b + 1))
d=$((d + 1))
done < 'Band_data/Band_data/5g/'$net.csv
#------------------------------------------------------------------------------------#
#this role variable, first enable the TC then it delete the rule going in Else, but when It delete, it again enable new rule
role=1
runtime="5 minute"
endtime=$(date -ud "$runtime" +%s)
t=1
j=0
while [[ $(date -u +%s) -le $endtime ]]
do
tc qdisc add dev s2-eth1 root handle 1: htb default 1
# create class 1:1 and limit rate to 6Mbit
sudo tc class add dev s2-eth1 parent 1: classid 1:1 htb rate "${bw_array[t]}"kbit ceil "${bw_array[t]}"kbit
#tc qdisc show dev $1
echo ${bw_array[t]}
#echo ${second_link[t]}
t=$((t + 1))
sleep 4
tc qdisc del dev s2-eth1 root
num=$(ps -ef| grep godash| wc -l)
echo "Num ---- ";
echo $num;
if [ $num -eq 4 ]; then
sleep 1
sudo chmod 777 -R /home/raza/Downloads/goDASH/godash/data/
echo "Streaming done..."
echo "Stop pcap capturing..."
echo "Stop server...."
#
sudo pkill -9 tcpdump
sudo pkill -9 caddy
sudo pkill -9 hypercorn
#cd /home/dash/testbed/D-ITG-2.8.1-r1023/bin/ && ./ITGDec receiver.log
#pkill ITGRecv
#b=$((b + 1))
break
fi
done