Linux 节点中的数据包丢失

Linux 节点中的数据包丢失

我已经运行过了dropwatch,得到的结果如下:

dropwatch> start
Enabling monitoring...
Kernel monitoring activated.
Issue Ctrl-C to stop monitoring
39 drops at tcp_rcv_state_process+1b6 (0xffffffff815eeda6)
36 drops at sk_stream_kill_queues+50 (0xffffffff81583970)
3 drops at skb_release_data+10e (0xffffffff8157bf3e)
2 drops at tcp_v4_do_rcv+80 (0xffffffff815f8f70)
2 drops at tcp_v4_rcv+87 (0xffffffff815fa087)
30 drops at tcp_rcv_state_process+1b6 (0xffffffff815eeda6)
31 drops at sk_stream_kill_queues+50 (0xffffffff81583970)
20 drops at unix_dgram_sendmsg+4f8 (0xffffffff81646a38)
5 drops at tcp_v4_rcv+87 (0xffffffff815fa087)
2 drops at tcp_v4_do_rcv+80 (0xffffffff815f8f70)
19 drops at tcp_rcv_state_process+1b6 (0xffffffff815eeda6)
23 drops at sk_stream_kill_queues+50 (0xffffffff81583970)
2 drops at tcp_v4_rcv+87 (0xffffffff815fa087)
2 drops at skb_release_data+10e (0xffffffff8157bf3e)
11 drops at unix_dgram_sendmsg+4f8 (0xffffffff81646a38)
57 drops at tcp_rcv_state_process+1b6 (0xffffffff815eeda6)
49 drops at sk_stream_kill_queues+50 (0xffffffff81583970)
5 drops at skb_release_data+10e (0xffffffff8157bf3e)
5 drops at tcp_v4_rcv+87 (0xffffffff815fa087)
1 drops at skb_queue_purge+18 (0xffffffff8157c0a8)
4 drops at tcp_rcv_state_process+1b6 (0xffffffff815eeda6)
4 drops at sk_stream_kill_queues+50 (0xffffffff81583970)
3 drops at tcp_v4_do_rcv+80 (0xffffffff815f8f70)
3 drops at tcp_v4_rcv+87 (0xffffffff815fa087)
10 drops at skb_release_data+10e (0xffffffff8157bf3e)
38 drops at unix_dgram_sendmsg+4f8 (0xffffffff81646a38)
29 drops at sk_stream_kill_queues+50 (0xffffffff81583970)
28 drops at tcp_rcv_state_process+1b6 (0xffffffff815eeda6)
1 drops at tcp_v6_rcv+87 (0xffffffff81677ff7)
2 drops at tcp_v4_rcv+87 (0xffffffff815fa087)
1 drops at tcp_v4_do_rcv+80 (0xffffffff815f8f70)
1 drops at skb_release_data+10e (0xffffffff8157bf3e)
17 drops at tcp_rcv_state_process+1b6 (0xffffffff815eeda6)
14 drops at sk_stream_kill_queues+50 (0xffffffff81583970)
1 drops at skb_release_data+10e (0xffffffff8157bf3e)
1 drops at tcp_v4_rcv+87 (0xffffffff815fa087)
5 drops at tcp_rcv_state_process+1b6 (0xffffffff815eeda6)
10 drops at skb_release_data+10e (0xffffffff8157bf3e)
2 drops at unix_dgram_sendmsg+4f8 (0xffffffff81646a38)
4 drops at sk_stream_kill_queues+50 (0xffffffff81583970)
20 drops at tcp_rcv_state_process+1b6 (0xffffffff815eeda6)
22 drops at sk_stream_kill_queues+50 (0xffffffff81583970)
2 drops at skb_release_data+10e (0xffffffff8157bf3e)
48 drops at tcp_rcv_state_process+1b6 (0xffffffff815eeda6)
53 drops at sk_stream_kill_queues+50 (0xffffffff81583970)

从现在起,我就陷入了困境。我检查了Linux 内核中的tcp_rcv_state_process这些sk_stream_kill_queues函数,但我不知道它们是由什么控制的。我之所以关注这个问题,是因为在我的节点中,一些应用程序以预期的方式超时了。

有什么建议我该如何继续吗?

答案1

为了继续,您需要安装内核调试模块和“elfutils”包。在 Centos 7 上:

#debuginfo-install kernel
#yum install elfutils

之后,您可以找到内核中的源代码位置,该位置与 dropwatch 中的地址相对应。例如,您有“57 个 drop at tcp_rcv_state_process+1b6 (0xffffffff815eeda6)”

#eu-addr2line -f -k 0xffffffff815eeda6
tcp_rcv_state_process
net/ipv4/tcp_input.c:5834

在这种情况下,如果是 SYN 数据包,它将丢弃来自 tcp 数据包的数据。

相关内容