-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstartclient_loop_tco
executable file
·75 lines (72 loc) · 1.75 KB
/
startclient_loop_tco
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
#!/bin/bash
PAT=/home/stefano/workspace/ccnx071base-cp-raw
SERVER=192.168.1.20
PORT=9699
NID=ccn:/example/mb1
NID_CCNX=ccn:/example
TIME=20
while [ $# -gt 0 ]; do
if [ "$1" = "-s" ]; then
if [ $# -lt 2 ]; then
usage
fi
SERVER=$2
shift 2
elif [ "$1" = "-nx" ]; then
if [ $# -lt 2 ]; then
usage
fi
NID_CCNX=$2
shift 2
elif [ "$1" = "-p" ]; then
if [ $# -lt 2 ]; then
usage
fi
PORT=$2
shift 2
elif [ "$1" = "-n" ]; then
if [ $# -lt 2 ]; then
usage
fi
NID=$2
shift 2
elif [ "$1" = "-t" ]; then
if [ $# -lt 2 ]; then
usage
fi
TIME=$2
shift 2
else
break
fi
done
i="0"
while [ "$i" -lt "15" ]; do
if [ "$(pidof ccnd)" ];then
echo "Kill old CCND pid: $(pidof ccnd)"
sudo kill $(pidof ccnd)
fi
if [ "$(pidof iperf)" ];then
#echo "Kill old CCND pid: $(pidof ccnd)"
sudo kill $(pidof iperf)
fi
sudo $PAT/csrc/ccnd/ccnd 1 1 0 0 0 > /dev/null 2>&1 &
echo "sleep 10"
sleep 10
echo "New CCND pid: $(pidof ccnd)"
$PAT/csrc/libexec/ccndc add $NID_CCNX udp $SERVER $PORT && $PAT/csrc/libexec/ccndc add ccnx:/ udp $SERVER
# $PAT/csrc/cmd/ccncatchunks2 -p 20 -s $NID &
iperf -s > /dev/null 2>&1 &
sudo tcpdump -tt -q -i eth0 -n tcp dst port 5001 > cattura$i 2>&1 &
# date +"Start time: %s.%N" &
# $PAT/csrc/cmd/ccncatchunks2 -p 20 -s $NID &
./go_iperf $TIME > /dev/null 2>&1
# sleep 1 &
date +"Start time: %s.%N" &
$PAT/csrc/cmd/ccncatchunks2 -d -p 20 -s $NID &
sleep $TIME
echo "@@@@ risveglio @@@@"
sudo kill $(pidof iperf)
sudo kill $(pidof tcpdump)
i=$[$i+1]
done