2

I need to test my network between two sites using iperf. I'd like to open parallel streams sending data on different (let's say 5 defined) ports, with random length from 10-1000, with random 1-2 seconds breaks between every 3 seconds transmission. Also packet rate should be 1000pps. I tried to write some shell scripts but they did not work. Thanks for help in advance!

#/bin/sh

while :
do
$time=$(($RANDOM%3+1)) #time when packets are sent (1-3s)
$pause=$(($RANDOM%2+1)) #time when we stop sending packets (1-2s)
$length=$(($RANDOM%991+10)) #length of packet (10-1000bytes)

iperf -c 10.0.0.1 -p 21 -l $length -t $time -n 1000 # I'm not sure if -n 1000 means 1000pps?

### (here goes another iperfs but with different ports) ###

sleep $pause
done

It would be better if every iperf would have different $time and $pause times, multithreading?

P.S. I try to replace cisco TGN (Traffic GeNerator) tool. I present the code that I try to substitute below (maybe will be helpful for someone):

Router#tgn

fastethernet 0/0
add tcp
rate 1000
L2-dest aaaa.bbbb.cccc
L3-src source_ip_address
L3-dest destination_ip_address
L4-dest 23
length random 16 to 1500
burst on
burst duration off 1000 to 2000
burst duration on 1000 to 3000
add fastethernet0/0 1
l4-dest 80
add fastethernet0/0 1
l4-dest 21
add fastethernet0/0 1
l4-dest 123
add fastethernet0/0 1
l4-dest 110
add fastethernet0/0 1
l4-dest 25
add fastethernet0/0 1
l4-dest 22
add fastethernet0/0 1
l4-dest 6000
kozooh
  • 121
  • 3

0 Answers0