This project is read-only.

Weird behaviour when using PacketCommunicator.Transmit()

Oct 15, 2013 at 8:49 PM

I am currently coding a network tool in F# that probe ip ranges for particular services by sending a syn packet while listening for the syn/ack response.

My first draft was using SendPacket() to send the builded packets in a loop until all targets has been probed with great results. A total of 65535 packets were sent and the syn/ack received in around 15 seconds.

I then realised i could get way better performances by buffering the packets ina queue and then transmitting that. After implementing this technique i was successfull in sending the packets way faster then i previously could but after a closer analysis i realised something was wrong as i was receiving way less syn/ack answers from my probing from the same targets as before!

Seeing this i tought maybe because i was using most of my uplink to send those 65535 packets i was out of bandwith to properly process the incoming replies. So what i did was split the packets into groups of 5 packets and pausing in between every transmit to burst lil groups of packet and let the network interface breath a bit but even using this technique i was receiving way less syn/ack packets then i did when using a SendPacket() loop.

So now i was htinking maybe the part of my code which is receiving the syn/ack packets was the culprit so i compared the number of receiving packets with my wireshark results and confirmed that wireshark received the same amount as my code.

I am currently out of ideas about what might be causing this weird behaviour. As anybody experienced something similar in the past? Also i didn't included any code as it wasn't available at this moment. If you guys want to see it let me know and ill add it to the thread.

Thanks all!
Nov 1, 2013 at 5:49 PM
Hi foleyaxel,

Indeed looking at the code might be helpful.
Sometimes setting the buffer size can be tricky, you might want to increase it.
Are you sure all packets are being sent? Maybe the network doesn't handle the bursts well, can you return to use SendPacket() and then just change it to use Transmit() for each packet?
Do you have different threads to send and receive the packets?