tcpdump mailing list archives

tcpdump stdout buffering to prevent packet loss


From: "Chris [ChrisMc]" <chrismc911 () hotmail com>
Date: Mon, 17 Apr 2006 12:39:00 +0000

Hi,

I am forwarding tcpdump output to stdout using "-w -". My own program uses the tcpdump output, transforms it, and writes it to a file or stdout.

All in all, the command line looks like:
tcpdump -w - | myprog

Additionally I am using "-s 0" because I need the whole packet from tcpdump. To prevent tcpdump from caching the data and copying to stdout in bursts I am using the "-U" option.

The problem is, that on high data rates, my program is too slow to process the traffic fast enough. So the data is not fetched from stdin and tcpdump drops packets as it can not copy them to stdout.

Is there an option to tell tcpdump to use a big buffer, like some thousand packets. I need some method to buffer the data such, that my program has time to process packets if the line rate does increase for some seconds.

I was hoping that there was maybe some option in tcpdump that would allow me this. Otherwise I would have to write my own stdin buffering.

Thanks a lot,
Chris

_________________________________________________________________
Haben Spinnen Ohren? Finden Sie es heraus – mit dem MSN Suche Superquiz via http://www.msn-superquiz.de Jetzt mitmachen und gewinnen!

-
This is the tcpdump-workers list.
Visit https://lists.sandelman.ca/ to unsubscribe.


Current thread: