tcpdump丢包问题

The kernel has a buffer for packets to be delivered to tcpdump. If tcpdump doesn't respond quickly enough, the kernel will overwrite old packets with new ones.
使用tcpdump抓包时,内核分配缓冲区存放向tcpdump传送的数据包,如果tcpdump处理的不够快,新到达的包会覆盖缓冲区中较早的包,即出现dropped丢包的情况。
解决方法:

1. 增大系统缓冲区大小 bpfbufsize


2. 避免tcpdump进行dns解析,使用tcpdump -n参数。尽量减少tcpdump的工作量,其他的参数如-nn等可参考。

Dropped packets
At the end of its run, TCPdump will inform you if any packets were dropped in the kernel. If this becomes a problem, it's likely that your host can't keep up with the network traffic and decode it at the same time. Try using TCPdump's -w option to bypass the decoding and write the raw packets to a file, then come back later and decode the file with the -r switch. You can also try using -s to reduce the capture snapshot size.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值