Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Monitoring of network traffic

Can I create on Java monitoring program of network traffic? The program must control all network traffic which goes from computer program (including OS modules) to Network driver and back. If yes, How?

NOTE:

I want not only to monitor traffic also to control it. I want to implement such system on windows NT. It cannot be fulfilled o purely on Java. How can I perform it with the help of JNI?

Or maybe another variant. I am not acquaint with windows services, but still. I will write a program on C++ and register it as windows service. Then I call from my Java application this service (I don't know how to do this) and request network traffic. On the C++ program part all the traffic will be blocked if there is no Java program (or it doesn't request traffic); on the other way transmitted to this program. May be the java part can be implemented and work on an Java server (Glass Fish, JBoss). The C++ part in turn will transmit traffic to localhost.

What do you think about these ways?

like image 765
itun Avatar asked Nov 08 '11 00:11

itun


1 Answers

When "monitoring of network traffic" then pcap, I'd say.

Googling "pcap java" brought me that as first hit: jNetPcap.

Did not test it, but pcap is the standard solution for native C programs. Cannot tell if the Java wrapper is good, but at least its website looks nice. ;-)

like image 167
kay Avatar answered Sep 29 '22 22:09

kay