[Winpcap-users] Circular buffer
loris.degioanni at gmail.com
Fri Jun 23 15:46:48 GMT 2006
Ioan Popescu wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
> I have a couple of questions concerning the circular buffer:
> 1. Is there an API call to determine whether any packets were dropped?
> Whether it's because the buffer overflowed or some other reason. Ethereal
> seems to be able to do this. I'm testing using "raw" packets, so Ethereal
> can't simply look at a counter in the packet and tell whether any were dropped.
> 2. According to the documentation, the circular buffer should overwrite the
> older packets with the latest "wire" packets while at the same time serving
> the oldest available packets to the application. Is my understanding correct?
The driver overwrites a packet only after it's been "consumed" by the
application. If the application is stuck, the driver starts dropping
packets when it reaches the tail of the buffer.
> 3. I have noticed something peculiar related to kernel memory size and CPU
> usage. As I increase the kernel (and user) buffer, the % CPU usage of my
> test application goes up. I'm testing this using Task Manager. The test
> application stays the same, it uses a command line argument to set the
> memory size. It also works on the same set of data. What reason's might
> there be for such behavior?
How big is the buffer that you set?
The driver allocates this buffer from the nonpaged memory pool, and
setting it to a very big size could impact on the OS performance. Other
than that, the only reason why changing the size of the buffers could
slow your application down is caching issues.
> My test is this: "Raw" packets are being sent from a sending station as fast
> as possible (benchmark tests). My test application simply checks the
> packet's source MAC and a "counter" to manually check for dropped/missed
> packets. I've disabled TCP/IP on the network adapter and this is an isolated
> network, so there shouldn't be any other traffic to interfere.
> Receiving System:
> WinPCap 4.0 alpha 1 (same problem with 3.1)
> WinXP Home SP2
> Celeron D - 2.8GHz
> 512MB PC2700 DDR
> 100Base-TX network
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v188.8.131.52 (MingW32)
> -----END PGP SIGNATURE-----
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
More information about the Winpcap-users