I want to capture packets from a crowded network and classify it by user request. I use java and jpcap for capturing packets. now I'm using array threads for each req packet. it's realy slow and there is many conflicts among threads. what's the best data structure for this purpose?
after that, I'm saving packets (req/response) into a file, that is very slow for such a heavy work. what should I do for saving my datas?
thank you
I'll need some example code to help you with the first part, because your question is a little vague. what's the best data structure for this purpose?
could be anything depending on what exactly you need that structure for.
The JpcapWriter
is pretty fast. I need to capture roughly 330mb of raw packet data from a 2 minutes of capture, and I haven't had a problem with being able to write it to disk while continuing to capture.