Giter Club home page Giter Club logo

Comments (9)

DraAngel avatar DraAngel commented on August 24, 2024

npcap version:1.79
npcap-sdk version:1.13

from npcap.

guyharris avatar guyharris commented on August 24, 2024

How many dropped packets does pcap_stats() report in ps_drop?

from npcap.

DraAngel avatar DraAngel commented on August 24, 2024

Should I write fetch ps_drop in the timeout branch

from npcap.

guyharris avatar guyharris commented on August 24, 2024

Should I write fetch ps_drop in the timeout branch

Since your capture loop seems not to ever exit, the right place to try it might be to, every N packets, for some value of N, call pcap_stats() and, if ps_drop is non-zero, print its current value as a count of dropped packets.

from npcap.

DraAngel avatar DraAngel commented on August 24, 2024

Well. I tried to get ps_drop every 15678 packets, and the results seemed a little hard to understand. The code looks like this:

	srcIndex = uh->index;
	if (srcIndex % 15678 == 0)
	{
		int size;
		pcap_stat* stat = pcap_stats_ex(adhandle, &size);
		printf("drop num: %d\n", stat->ps_drop);
	}

from npcap.

DraAngel avatar DraAngel commented on August 24, 2024

The results show that most of the packets are lost.
111

from npcap.

DraAngel avatar DraAngel commented on August 24, 2024

I set the buffer size and the packet buffer timeout, and now I can fetch all the packets!
Thank you for your help, Sir.

from npcap.

DraAngel avatar DraAngel commented on August 24, 2024

Another question, if I want to use Npcap to reliably transfer 1 gigabit data to another device in the LAN in the shortest possible time, is there any good advice?

from npcap.

DraAngel avatar DraAngel commented on August 24, 2024

Now, I set the buffer size to 2*1024*1024*1024 (which seems to be the maximum for an int), the packet buffer timeout to 1000, and the ps_drop to end up being 0. As I scale up the number of packets to 2M, ps_drop starts to become nonzero during reads. However, the number of packets monitored by Wireshark was as expected. Am I setting my parameters wrong or missing some configuration items?

from npcap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.