# IP分片重组超时：数据包被丢弃（分片超时）

- **ID:** `networking/ip-fragment-timeout-reassembly-failed`
- **领域:** networking
- **类别:** network_error
- **错误码:** `ETIMEDOUT`
- **验证级别:** ai_generated
- **修复率:** 75%

## 根因

一个IP分片数据包未能在系统超时时间（通常30-60秒）内完成重组，导致所有已接收的分片被丢弃，通常由高丢包率或PMTU不匹配引起。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Linux kernel 5.15 | active | — | — |
| Linux kernel 6.1 | active | — | — |
| FreeBSD 13.2 | active | — | — |

## 解决方案

1. ```
   Reduce the MTU on the interface to avoid fragmentation entirely: `ip link set dev eth0 mtu 1400`
   ```
2. ```
   Enable PMTU discovery and set the DF (Don't Fragment) flag on UDP sockets: `sysctl -w net.ipv4.ip_no_pmtu_disc=0` and ensure firewalls do not block ICMP 'Fragmentation Needed' messages.
   ```
3. ```
   Increase the reassembly queue size to handle bursts: `sysctl -w net.ipv4.ipfrag_max_dist=64` and `sysctl -w net.ipv4.ipfrag_high_thresh=8388608`
   ```

## 无效尝试

- **** — This only delays the inevitable; if the underlying packet loss is not fixed, fragments will still be dropped after the longer timeout, and it may cause memory exhaustion from pending fragments. (60% 失败率)
- **** — This breaks legitimate fragmented traffic like large UDP datagrams or certain VPN protocols, leading to connectivity loss for those applications. (80% 失败率)
- **** — Rebooting resets state temporarily but does not address the root cause of packet loss (e.g., a faulty link or MTU mismatch), so the error returns quickly. (90% 失败率)
