Simulate Network Users

We will be covering how to test internal network bandwidth.

Researching this topic, we discovered that there are numerous programs written to test the bandwidth of a network. Trying to use any of them is like trying to give yourself a haircut, it sounds great in theory, but people make fun of you for trying.

For this we will be using a Debian based operating system. Specifically Ubuntu 10.04 LTS. You could use a RedHat based system such as Fedora, or even Mac Os X (in theory), but those will not be covered in this tutorial.

If you are using one of those alternate systems, consult online forms for support. While substituting apt-get commands with yum or mac ports

Step 1: Update apt-get repository

<code>

        sudo apt-get update

</code>

wpid-vmwarefusion-2012-01-12-16-445.png

Step 2: Install iperf from the app repository

<code>

        sudo apt-get install iperf

</code>

wpid-1____vmwarefusion-2012-01-12-16-445.png

It should only take a few minutes depending on your internet speed.

At this point, iperf should now be installed, assuming you did not receive any errors.

From here you can run iperf from the command line by typing in

<code>

        iperf

</code>

Add on any arguments that you want.

We don’t really want to take the time to learn what all the arguments are since we can use a nice pretty gui. There are times when it is great to be elite and do everything from the keyboard. If that is the case, then you are done, otherwise we will install the fantastic gui tool to make a lot of these options much simpler.

For this part we will need to check out a version of the latest code from google code. To do that we will need to first have svn (subversion) installed. What subversion is; for those new to coding, is a way to keep track of versions of code. Frequently it is called ‘versioning’.

If you are curious research

git

github.com

svn

bitbucket.com

mercurial

beanstalk.com

googlecode.com

Step 3: Install svn

<code>

        sudo apt-get install subversion

</code>

wpid-2____vmwarefusion-2012-01-12-16-445.png

Step 4: Install Java runtime and Java development

This will get both the runtime (jdk) and development runtime (ire). If you don’t know what that means, don’t worry about it. Just run the following command.

<code>

        sudo add-apt-repository ppa:sun-java-community-team/sun-java6        

        sudo apt-get update

        sudo apt-get install sun-java6-jdk sun-java6-jre

</code>

wpid-3____vmwarefusion-2012-01-12-16-445.png

This is the longest part of the entire process. Java is a big download.

Select OK on any prompt’s that appear

wpid-4____vmwarefusion-2012-01-12-16-445.png

Step 5: Checkout iperf gui

Change into a suitable directory first. I chose to put it in my Downloads folder

<code>

        cd ~/Downloads

        svn co https://iperf.svn.sourceforge.net/svnroot/iperf/jperf/trunk

</code>

wpid-5____vmwarefusion-2012-01-12-16-445.png

You could also navigate to the website with a browser and download it manually, but doing a svn checkout is much quicker and easier.

http://code.google.com/p/xjperf/downloads

Step 6: Change permissions

Change into the newly created trunk directory

<code>

        cd trunk

</code>

Opening the README.txt file will tell us one last step that we need to take before we can compile and install the java gui.

Open the README.txt file by either opening it from the File Browser

wpid-6____vmwarefusion-2012-01-12-16-445.png

If you don’t want to use the gui, use the cat command to show the text right from the terminal. Otherwise skip to the next step.

<code>

        cat README.txt

</code>

wpid-7____vmwarefusion-2012-01-12-16-445.png

Step 7: Set jperf.sh permisions

Change into the directory where jperf.sh is located. Mine is in Downloads/trunk/release/iperf-generic

<code>

        cd ~/Downloads

        cd trunk

        cd release

        cd jperf-generic

</code>

(These commands are separated on purpose for those new to linux)

Doing a list of all items in directory should reveal a

bin, jperf.bat, jperf.sh and lib

files and folders

<code>

        ls

</code>

wpid-macjournal-2012-01-12-16-445.png

Change the permission as indicated in the README.txt

<code>

        sudo chmod u+x jperf.sh

</code>

wpid-8____vmwarefusion-2012-01-12-16-445.png

Step 8: Install ANT

We must now install ant

Change into the utilities directory. I did it by typing in these commands.

<code>

        cd ~/Downloads

        cd trunk

        cd utilies

</code>

Now install ant

<code>

        sudo apt-get install ant

</code>

Run ant

<code>

        sudo ant release

</code>

wpid-9____vmwarefusion-2012-01-12-16-445.png

If you get an error; build.xml does not exist, the reason is that you are not in the correct directory when you are running the ant command or you did not use subversion to download the file.

In either case, don’t worry about the error too much, as it appears that it can be skipped on certain machines with no ill effects.

        

wpid-1____macjournal-2012-01-12-16-445.png

Step 9: Run the configuration

Now we will run a script (thats what the .js is for) to prepare the system for installation. The ant procedure in the previous step created a new folder called jperf-2.0.1 inside the release folder

Change into the …trunk/release/iperf-2.0.2 directory and change the execute permission of the jperf.sh file

You will know that you changed the permission if the file is highlighted in green after the change.

before

wpid-littlesnapper-2012-01-12-16-44.png

<code>

        cd ~/Downloads

        cd trunk

        cd release

        cd jperf-2.0.2

        

        sudo chmod +x jperf.sh

</code>

after

wpid-1____littlesnapper-2012-01-12-16-44.png

Execute the program

<code>

        ./jperf.sh

</code>

Step 10: Compile and run the jperf.jar file

Whew, it may seem like this is a lot of work, but the results are well worth it. Now we are going to compile a java program then execute it.

Assuming you are still in the jperf-2.0.2 folder run this command

<code>

        javac jperf-2.0.2

</code>

Advertisements

About spuder
spuder is a "super computer" support engineer by day, and tinkerer / hobbyist by night.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: