5 if [[ $# -ne 2 ]]; then
7 Usage: `basename $0` [target] [number]
9 This is simple traffic generator script for stress tests.
10 It based on the traceroute: ftp://ftp.ee.lbl.gov/traceroute.tar.gz
11 (FreeBSD and Debian Linux ships with this version).
13 Script will send number*$Q UDP packets
14 and, of course, receive number*$Q ICMP replys.
16 Note: for stress test you must turn off ICMP rate limit on target machine:
17 Linux: sysctl -w net/ipv4/icmp_ratelimit=0
18 FreeBSD: sysctl -w net.inet.icmp.icmplim=0
19 Solaris: /usr/sbin/ndd -set /dev/ip ip_icmp_err_interval 0
29 while [[ $((C--)) -gt 0 ]]; do
30 traceroute -n -q $Q $H &>/dev/null
34 p=$(($c*10/($l*10+1)))
35 echo -ne "$l sec. $p pkts/s \r"