embedded network_error ai_generated true

lwIP: ARP timeout, queue full for IP 192.168.1.100, packet dropped

ID: embedded/lwip-arp-timeout-queue-full

Also available as: JSON · Markdown · 中文
88%Fix Rate
86%Confidence
1Evidence
2024-04-22First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
lwIP v2.1.3 active
STM32Cube_FW_F4 v1.28.0 active
FreeRTOS v10.5.1 active

Root Cause

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.

generic

中文

远程主机的ARP解析处于挂起或失败状态,lwIP ARP队列(启用ARP_QUEUEING)已达到最大挂起数据包计数,导致新数据包被丢弃。

Official Documentation

https://www.nongnu.org/lwip/2_1_x/group__lwip__opts__arp.html

Workarounds

  1. 90% success Increase ARP queue size in lwipopts.h: set #define ARP_QUEUE_LEN 10 (default 3) to allow more pending packets per unresolved IP. Also set #define MEMP_NUM_ARP_QUEUE 10 to allocate memory.
    Increase ARP queue size in lwipopts.h: set #define ARP_QUEUE_LEN 10 (default 3) to allow more pending packets per unresolved IP. Also set #define MEMP_NUM_ARP_QUEUE 10 to allocate memory.
  2. 85% success Implement manual ARP probe: periodically send gratuitous ARP from the device using etharp_request() to refresh neighbor cache and reduce queue buildup.
    Implement manual ARP probe: periodically send gratuitous ARP from the device using etharp_request() to refresh neighbor cache and reduce queue buildup.

中文步骤

  1. 在lwipopts.h中增加ARP队列大小:设置#define ARP_QUEUE_LEN 10(默认为3),允许每个未解析IP有更多挂起数据包。同时设置#define MEMP_NUM_ARP_QUEUE 10以分配内存。
  2. 实现手动ARP探测:使用etharp_request()从设备定期发送免费ARP,刷新邻居缓存并减少队列堆积。

Dead Ends

Common approaches that don't work:

  1. Increase ARP table size (ARP_TABLE_SIZE) to 20 85% fail

    Larger table does not affect queue depth; queue full error comes from pending ARP requests, not table entries.

  2. Disable ARP queueing (set ARP_QUEUEING to 0) 90% fail

    Disabling queueing drops all packets during ARP resolution, causing total connectivity loss for new connections.