When we use tcpdump, we see like the following at the end - is there any way to write only the packets captured to a file using the -w option (in this case save only 1310)? I want to do my analysis on the captured packets. I am using this command
asked 14 May '17, 10:39 armodes edited 14 May '17, 13:13 grahamb ♦ |
One Answer:
That looks like your machine is simply too slow to write all packets to disk, or even get all of them from the network card into memory. You need a much much much faster capture machine :-) answered 14 May '17, 11:27 Jasper ♦♦ |
OK, in that case i will change a machine.
Note also that, in that example, tcpdump ''isn't'' writing packets to disk; the
-w
flag isn't being used, and the standard output isn't being redirected to a file. (Presumably it ''did'' print all 1310 packets before printing the captured/received/dropped message.)Furthermore, tcpdump is dissecting the packets (because it's being run without
-w
), and that takes additional CPU time - and you're not running it with-n
, so it's also trying to look up the source and destination IP addresses for the packets and report them as domain names, which can slow things down further.