Fastest way to analyse packets

No replies
Joined: 06/06/2016

I have a question and i hope to find an answer here

I work on a school project to analyse packets and extract some info (ip source, ip destination, port source, port destination...)

i supposed to get max performance (the fastest way to get this info), I know that when a packet is found (by loop methode) it calculate it's state and return a PcapPacket Object containing references on where the packet is in the native memory and its headers

My question is what is the most efficient way :

1 - in the handler, decode the packet and extract the info and send it
2 - in the handler, make a copy of the packet, send it to another thread which will extract the useful info from it
3 - (if this option is possible) in the handler, make a copy of the packet but without calculating its states, then in a different thread, calculate the states and check headers and extract info

i hope i made myself clear and thank you in advance