[Winpcap-users] Circular buffer

Loris Degioanni 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.

pcap_stats()

> 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.

Loris

> 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 v1.4.2.2 (MingW32)
> 
> iQIVAwUBRJvgCHGK1KGABytRAQqKSQ/+MK0rcZQquIZdJPP8Vq4K11MUB3p27z7r
> AdAlH7rKFLJNGg4LZk56mpJiTytq94uwI5D+kKs6IaAgXXRFvxW57PYobn3Nqg3b
> H5Clww0rfGleQOMeYplYDITvkrmK1izloYLLghJp03KUX0l4CR5/4+I5TGxFyrgw
> 1KP46ctzk1c8Jf3gGQGBGbrSgP/8WfGvMLNEaEbxEBDIKdUi/dR2Agf8mHAkpcl8
> 79ROePkgLbbg6GKiCdhfbcp+vobz1DaGt4icM4Ejka3nCvJJQv+lRaAoWd9n7wDr
> ppBbgNy6IDk//Tx7fSd4fPBkBpLm7jxxlniPZNPRX4Z33tDFsi3N3KeVi1E/o07u
> gqLauotpMb0Ajwr7x530QLh7Foin2fM5msuSoUL6++8CipInr9qq7ZnRyvQkvVxD
> BKXYkddLCQ6zxAE7SMrfRPst/3uSlHO5DHgIS1Ou66VB3bFXuU9Jm//Q2GVbeJZH
> 5N2dHFAz8+TeMq5EVgaa7rDTwdB3svCCKN9p0p/efDb55bz0ViS8NUJxQH5zMate
> 3Ib/fgcSSA8C0pkiPUZ3yAquwsl1ZTl+sEZpemGPIdroTVRADwpe9dta/p1pgiTv
> k3O6uRsZmkXau2uSyW5QaEuX3Flb+L0BnMi8CV86+Iz9YliPUt1XgBqZQKslKaJs
> RrP0tJCbkB4=
> =Mbr5
> -----END PGP SIGNATURE-----
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users
> 


More information about the Winpcap-users mailing list