# TCP: Out-of-order packet received on connection 10.0.0.1:443 -> 192.168.1.50:54321, expected seq 12345, got 12390

- **ID:** `networking/tcp-out-of-order`
- **Domain:** networking
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 72%

## Root Cause

A TCP packet arrived with a sequence number that does not match the expected next sequence number, indicating packet reordering in the network, often due to multipath routing, load balancers, or router bufferbloat.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Linux kernel 6.5.0-14-generic | active | — | — |
| FreeBSD 13.2 | active | — | — |
| Windows 11 Pro 23H2 | active | — | — |
| nginx 1.24.0 | active | — | — |

## Workarounds

1. **Enable TCP reordering detection on the receiver: `sysctl -w net.ipv4.tcp_reordering=3` to allow up to 3 reordered packets before treating as loss** (85% success)
   ```
   Enable TCP reordering detection on the receiver: `sysctl -w net.ipv4.tcp_reordering=3` to allow up to 3 reordered packets before treating as loss
   ```
2. **Use `tcpdump` to identify the path causing reordering and pin the connection to a single path via routing policy: `ip route add 192.168.1.50/32 via 10.0.0.1 dev eth0`** (78% success)
   ```
   Use `tcpdump` to identify the path causing reordering and pin the connection to a single path via routing policy: `ip route add 192.168.1.50/32 via 10.0.0.1 dev eth0`
   ```

## Dead Ends

- **** — Large buffers can hide the symptom but exacerbate bufferbloat, leading to increased latency and packet drops. (65% fail)
- **** — SACK is designed to handle out-of-order packets efficiently; disabling it makes retransmission less efficient and can degrade performance. (75% fail)
- **** — The reordering is a network-level issue; restarting the app does not fix the underlying path and the problem will recur. (80% fail)
