Welcome on website. I hope you will enjoy this free java API.
1. What is ?
First of all you should ask to yourself what is ?
The answer is quite simple !!
is a small java API to listen and send Ethernet, TCP and IP packets over network on Windows OS.
2. Download and install
To install , please follow this steps :
1- Download here,
2- Download WINPCAP from http://www.winpcap.org/install/default.htm and select default option and path. When I wrote this page, WINPCAP was version 3.1.
3- Unzip jiffer.zip file where you want but keep default folder hierarchy,
4- You should have following folders :
Example contains one sample program to learn how to use
Javadoc contains the java documentation for API
Lib contains the jiffer.jar
Native contains java native code and a dll to use WINPCAP API (for informations about WINPCAP please read ‘How does work’ section).
Org contains the API source code.
Go at ‘Run sample’ section to run the small application to test that your installation is successful.
3. Is cross-platform as Java ?
As you know one of the big advantages of Java is its portability. It means that you can develop on Windows and run your code on Unix.
At present is not cross platform. The reason is simple, is a really young project and lot of works is yet to do. To be clear it would be ambitious to say that present release is a beta. So, do I plan to make other release of on other platforms in the future ? The answer is probably YES, it will depend on success and help I could get from other people.
So at present only work on Windows platform.
4. How does work ?
The best way to understand , is to use it. And because is a really small API, no more than 10 classes, you could learn it in few hours. However, because I made , I am at present the best person to give you some help to start and understand philosophy.
a) Native API.
As you know now, Java basically does not offer API to listen or send Ethernet packet over network. STOP… I did not say that it was not possible to send network packet with Java. The java.net package offer several classes to open socket… However you can not build from scratch your network packet. For example it is not possible to change your MAC address. With you can do that. Andy you can totally build your packet.
To do that, needs other native methods. Native methods are the platform dependent part of Java. Under Java API, the low level calls are made by specific API oftenly developed in C or C++. This part of Java is not cross platform. To send and listen packet, the first job was to develop a low level API in C. And because I am lazy boy, I have use a beautiful existing API, which is WINPCAP.
WINPCAP is a free windows C API to make some network operations.
I’d rather make my own low level API, which is a future project, however at present I use WINPCAP, this is why you will need to download it to use (you can find more details in ‘Download and install ’ section). My job was only to make Java native method to call WINPCAP methods, encapsulate WINPCAP methods and simplify interface.
b) Java native API
Java native API is the part which is between a java application, and platform specific API. It allows you to convert from native type to java types. For example you can use a C structure from native application and build a java class using the C structure data and send this java class to your java application. The java native API is a small dll which is download by JVM when you start your java application. The source code of this DLL is also provided when you download . If you are a little experienced developer, you could make change in dll source code and build it with the GNU makefile. If so you will need to download Cygwin and GNU C compiler.
c) Java API
At least the most interesting part is the Java API. It is the API you will use to build your java application upon .
To have more details please read javadoc. To summarize API is divided into two main parts. The first part ‘org.aroche.network’ contains classes to communicate with your network interface (mostly network card), send and listen for network message. The second part ‘org.aroche.network.packet’ contains classes to manipulate network packet (build packet, get packet informations…).
5. Run sample.
Before developing with please run the sample to be sure that everything is correctly set up on your machine.
1- Open a dos command window
2- Go under JIFFER_HOME/example
3- Enter runjava in command prompt and press enter.
4- You should see a list of network adapter depending on your machine, like the following :
5- Choose the network adaptor you want to use.
6- Then choose between sending or listening packet (here choose Listen).
7- Following display should appear :
Promiscuous is a mode that ask to your network adaptor to listen to all incoming message event those that are not for you.
For other filter mode please refer to network website or books.
8- Then you should see network packet display to your screen that come from your local network. If you do not see anything open a browser and connect to internet for example.
Now have fun with …