Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add way to specify snapshot length and buffer size when using pcap #4680

Open
saiarcot895 opened this issue Mar 1, 2025 · 1 comment
Open

Comments

@saiarcot895
Copy link

When using pcap and a ring buffer for receiving packets, it can be useful to specify the snapshot length and the buffer size when receiving packets. For example, if you know that you'll only want to be processing small packets, then it could be worth setting the snapshot length to be a small value. This has a benefit on systems where libpcap uses TPACKET_V2, where the number of packets that can fit in the ring buffer depends on the size of the ring buffer and the snapshot length; smaller snapshot lengths means more packets can fit there.

Similarly, if you know you might want to handle large packets, then having an option to increase the buffer size could be beneficial.

@saiarcot895
Copy link
Author

To add to that, if my read of TPACKET_V3 is correct, then setting the snapshot length might also be useful there, but I'm not 100% certain that this is true (setting the buffer size explicitly would be true regardless because of memory consumption).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant