Performance Problems
Brought to you by:
chrismorgan
Hi Chris,
I am trying to use packet.net to make a 1GB fullspeed transmission between two computers.
When i use sendpacket, I only get a throughput of ~20%
If I use precalculated queues, throughput goes up to 80% but I loose packets randomly.
I am at a loos where the problem is coming from. My machine is a Hexacore AMD, WIN7-64, 4GB Ram.
In my receive procedure I do nothing except increase a counter.
I have experimented with queue sizes etc. but it is always unreliable.
My question is:
Any help would be greatly appreciated. Tanks in advance.
Rüdiger
Anonymous
Hello.
I presume that you are using winpcap's send queues? I'm not sure that you are guaranteed to be able to both send and capture each packet. Also there is a special flag in WinPcap to drop locally transmitted packets, if you get any packets I presume that that isn't enabled.
Are you using SharpPcap to send packets or generating them with packet.net and sending them via pinvoke calls or another library?
WinPcap and other packet capture tools are not designed for capturing all packets. In addition packet capturing is happening at application level. The OS doesn't always ensure that all packets are passed to the capture device. I'd be surprised if you could achieve 100% transmission and capture percentages but really you can't tell if you don't try. I'd really like to know how you made out though because that kind of information is very valuable to other users. I know I've been able to achieve high capture rates, 3MB/s with minimal packet loss. Please let me know how you make out.
There is an example of background packet processing in the SharpPcap codeproject tutorial (also linked to via the sharppcap project wiki page). The idea is to queue packets in memory and process them in chunks in a separate thread to avoid blocking the capture thread in any way. This helps significantly if traffic is bursty.
Chris
Hello.
It may be that the precalculated queues are just what you'd expect to get. What are you using to capture the packets? SharpPcap?
Chris