This project is no longer being actively developed.
About
JNetSim is a program that allows you to test java applications that use TCP sockets to see how they perform under poor network conditions. You can adjust the following settings:
- How long it takes to connect.
- Rate for connection failure.
- Output delay for basic write.
- Input delay for basic read.
- How long a connection lasts before it fails.
- How long a server socket can accept connections before it fails.
- If a server socket can bind again after it fails.
JNetSim was developed to help test the International Collaborative Environment and ensure the interface was responsive under terrible network conditions.
Downloads
Installing
Download the appropriate archive from the JNetSim website. Extract the archive where you want to have JNetSim installed. After you have extracted the files, open profile.ini and set the properties you want to use to test and run your application. Notes:
- If you use one of the ClassLoader.getSystem*() methods JNetSim will not be able to run your application because it is not on the system classpath.
- If you have to use Socket.setSocketImplFactory() or ServerSocket.setSocketFactory() methods you will not be able to use JNetSim for your application.
- To run JNetSim you will need to place jnetsim.jar in the bootclasspath because one of the classes has to be in the java.net package. This is because PlainSocketImpl is not a public class. See the section on Running below.
Running
Running JNetSim requires a Java Runtime Environment 1.3 or higher which is available from http://java.sun.com. To run, java must be in your path and type the following command:
java -Xbootclasspath/a:jnetsim.jar jnetsim.JNetSim
This will use the settings in profile.ini to run your application and apply the delays and errors. The INI file should be located in the working directory.
Building
If you want to build JNetSim download and extract one of the source archives. In order to build JNetSim you will need a Java Software Development Kit 1.3 or higher which is available from http://java.sun.com. You will also need Ant 1.4 which is available from http://ant.apache.org.
To build you must have ant setup and in your path. When this is done, you can build by simply typing ant in the directory where build.xml is located.