embedded
network_error
ai_generated
true
lwIP:ARP超时,IP 192.168.1.100的队列已满,数据包丢弃
lwIP: ARP timeout, queue full for IP 192.168.1.100, packet dropped
ID: embedded/lwip-arp-timeout-queue-full
88%修复率
86%置信度
1证据数
2024-04-22首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| lwIP v2.1.3 | active | — | — | — |
| STM32Cube_FW_F4 v1.28.0 | active | — | — | — |
| FreeRTOS v10.5.1 | active | — | — | — |
根因分析
远程主机的ARP解析处于挂起或失败状态,lwIP ARP队列(启用ARP_QUEUEING)已达到最大挂起数据包计数,导致新数据包被丢弃。
English
ARP resolution for a remote host is pending or failed, and the lwIP ARP queue (ARP_QUEUEING enabled) has reached its maximum pending packet count, causing new packets to be dropped.
官方文档
https://www.nongnu.org/lwip/2_1_x/group__lwip__opts__arp.html解决方案
-
在lwipopts.h中增加ARP队列大小:设置#define ARP_QUEUE_LEN 10(默认为3),允许每个未解析IP有更多挂起数据包。同时设置#define MEMP_NUM_ARP_QUEUE 10以分配内存。
-
实现手动ARP探测:使用etharp_request()从设备定期发送免费ARP,刷新邻居缓存并减少队列堆积。
无效尝试
常见但无效的做法:
-
Increase ARP table size (ARP_TABLE_SIZE) to 20
85% 失败
Larger table does not affect queue depth; queue full error comes from pending ARP requests, not table entries.
-
Disable ARP queueing (set ARP_QUEUEING to 0)
90% 失败
Disabling queueing drops all packets during ARP resolution, causing total connectivity loss for new connections.