Monitoring of network traffic

2019-02-21 18:05发布

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 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's 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 implement and work on Java server (Glass Fish, JBoss). The C++ part in turn will transmit traffic to localhost.

What do you think about these ways?

1条回答
smile是对你的礼貌
2楼-- · 2019-02-21 18:25

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. ;-)

查看更多
登录 后发表回答