aboutsummaryrefslogtreecommitdiff
path: root/netperf-2.4.4/doc/examples/sctp_stream_script
blob: ebd850bbf26e38546802a6b060e66ff811608478 (plain)
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
95
96
97
98
99
100
101
102
103
104
#!/bin/sh
#
# This is an example script for using netperf. Feel free to modify it 
# as necessary, but I would suggest that you copy this one first.
# 
# This version has been modified to take advantage of the confidence
# interval support in revision 2.0 of netperf. it has also been altered
# to make submitting its resutls to the netperf database easier
# raj 11/94
#
# usage: tcp_stream_script hostname [CPU]
#

if [ $# -gt 2 ]; then
  echo "try again, correctly -> sctp_stream_script hostname [CPU]"
  exit 1
fi

if [ $# -eq 0 ]; then
  echo "try again, correctly -> sctp_stream_script hostname [CPU]"
  exit 1
fi

# where the programs are
#NETHOME=/usr/local/netperf
#NETHOME="/opt/netperf"
NETHOME=.

# at what port will netserver be waiting? If you decide to run
# netserver at a differnet port than the default of 12865, then set
# the value of PORT apropriately
#PORT="-p some_other_portnum"
PORT=""

# The test length in seconds
TEST_TIME=60

# How accurate we want the estimate of performance: 
#      maximum and minimum test iterations (-i)
#      confidence level (99 or 95) and interval (percent)
STATS_STUFF="-i 10,2 -I 99,5"

# The socket sizes that we will be testing
SOCKET_SIZES="57344 32768 8192"

# The send sizes that we will be using
SEND_SIZES="4096 8192 32768"

# if there are two parms, parm one it the hostname and parm two will
# be a CPU indicator. actually, anything as a second parm will cause
# the CPU to be measured, but we will "advertise" it should be "CPU"

if [ $# -eq 2 ]; then
  REM_HOST=$1
  LOC_CPU="-c"
  REM_CPU="-C"
fi

if [ $# -eq 1 ]; then
  REM_HOST=$1
fi

# If we are measuring CPU utilization, then we can save beaucoup
# time by saving the results of the CPU calibration and passing
# them in during the real tests. So, we execute the new CPU "tests"
# of netperf and put the values into shell vars.
case $LOC_CPU in
\-c) LOC_RATE=`$NETHOME/netperf $PORT -t LOC_CPU`;;
*) LOC_RATE=""
esac

case $REM_CPU in
\-C) REM_RATE=`$NETHOME/netperf $PORT -t REM_CPU -H $REM_HOST`;;
*) REM_RATE=""
esac

# this will disable headers
NO_HDR="-P 0"

for SOCKET_SIZE in $SOCKET_SIZES
  do
  for SEND_SIZE in $SEND_SIZES
    do
    echo
    echo ------------------------------------
    echo
    # we echo the command line for cut and paste 
    echo $NETHOME/netperf $PORT -l $TEST_TIME -H $REM_HOST -t SCTP_STREAM\
         $LOC_CPU $LOC_RATE $REM_CPU $REM_RATE $STATS_STUFF --\
         -m $SEND_SIZE -s $SOCKET_SIZE -S $SOCKET_SIZE

    echo
    # since we have the confidence interval stuff, we do not
    # need to repeat a test multiple times from the shell
    $NETHOME/netperf $PORT -l $TEST_TIME -H $REM_HOST -t SCTP_STREAM\
    $LOC_CPU $LOC_RATE $REM_CPU $REM_RATE $STATS_STUFF --\
    -m $SEND_SIZE -s $SOCKET_SIZE -S $SOCKET_SIZE

    done
  done
echo If you wish to submit these results to the netperf database at
echo http://www.cup.hp.com/netperf/NetperfPage.html, please submit each
echo datapoint individually. Individual datapoints are separated by
echo lines of dashes.