Tcpdump Packet loss Problem Solving method

Source: Internet
Author: User
Tags pack

Reprint: http://blog.csdn.net/galaxy_fxstar/article/details/5290498


Recently with tcpdump grab bag, found that there are a large number of drops ("packets dropped by kernel"),

As follows:

Tcpdump-i eth0 DST Port 1234 and udp-s 2048-x-tt >a.pack

Packets Captured
3043 Packets received by filter
2706 packets dropped by kernel

Packet Drop Reason:

After Google and analysis, the cause of this drop is due to the libcap caught packet, tcpdump upper layer did not timely remove, resulting in libcap buffer overflow, thus covering the unhandled package, shown here as dropped by kernel, note, The kernel here is not said to be abandoned by the Linux kernel, but by the tcpdump kernel, that is, Libcap abandoned, the upper supervisor heard

The 1234-Port server can obtain the data normally.

Workaround:

According to the above analysis, we can reduce the packet loss rate by improving the processing efficiency of the upper layer of tcpdump, the following steps can be selected according to the need, each step will reduce a certain loss rate

1. Minimize the crawl filter range, that is, by specifying the network card, port, packet flow, packet size to reduce the number of packets

2. Add-n parameter, prohibit reverse domain name resolution

Tcpdump-i eth0 DST Port 1234 and udp-s 2048-n-x-tt >a.pack

In most cases, this will solve the problem.

Reduces packet loss by improving the processing efficiency of the tcpdump upper layer

3. Output a packet to a cap file

Tcpdump-i eth0 DST Port 1234 and udp-s 2048-n-x-tt-w a.cap

With this step, basically all of the Web servers are ready to take care of.

4. Modify the So_revbuf parameter with Sysctl to increase the libcap buffer length

This step is the trick, because the design of the kernel parameter modification, try not to use, to use the No, then there is no way to ^_^

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.