Network traffic monitoring

Is it possible to create a program for monitoring network traffic in Java? The program must monitor all network traffic that goes from the computer program (including OS modules) to the network driver and vice versa. If so, how?

NOTE:

I want to not only monitor traffic, but also control it. I want to implement such a system on Windows NT. This cannot be done solely in Java. How can I accomplish this using JNI?

Or maybe another option. I am not familiar with Windows Services, but still. I will write a C ++ program and register it as a Windows service. Then I call this service from my Java application (I don’t know how to do this) and request network traffic. In the C ++ program part, all traffic will be blocked if there is no Java program (or it does not request traffic); it is transferred to this program in a different way. Maybe the Java part can be implemented and run on a Java server (Glass Fish, JBoss). Part of C ++ will in turn forward traffic to localhost.

What do you think of these methods?

+8
source share
1 answer

If "monitoring network traffic", then pcap , I would say.

Googling "pcap java" : jNetPcap.

, pcap C. , Java, - .; -)

+11

All Articles