A TCP Fragmentation attack — more precisely called a TCP segmentation attack — is a network evasion or resource-exhaustion technique that manipulates how a TCP byte stream is split into segments, deliberately crafting abnormally small segments or unusual boundary placement to slip malicious payloads past inspection devices or to exhaust the resources a target spends reassembling and tracking the TCP stream.
TL;DR: TCP normally splits an application’s data into segments sized according to the negotiated Maximum Segment Size (MSS), independent of anything happening at the IP layer. Attackers abuse this by sending deliberately tiny segments that split a single meaningful unit — an HTTP header, a WAF-inspected pattern, an exploit signature — across multiple segments, so that a firewall, IDS, or WAF inspecting segments individually never sees the complete pattern in one place. A related resource-exhaustion variant sends large volumes of out-of-order or incomplete segments to pressure the target’s TCP reassembly buffers. Mitigation requires MSS clamping, full-stream reassembly at inspection points before pattern matching, and connection-level anomaly detection rather than per-packet inspection.
Last updated: 2026-08-27
TCP segmentation evasion is a well-documented category of IDS/IPS bypass technique, formally analyzed in Ptacek and Newsham’s 1998 paper “Insertion, Evasion, and Denial of Service: Eluding Network Intrusion Detection,” which remains a foundational reference for understanding why stream-aware, stateful inspection is necessary at security chokepoints. Unlike the crash-oriented IP fragmentation bugs of the same era, TCP segmentation attacks have never depended on kernel bugs — they exploit a structural gap between how individual packets look and how the full data stream they carry actually reads, which is a permanent property of the protocol rather than a patchable defect.
TCP Segmentation vs. IP Fragmentation — Why These Are Different Attacks
Before going further, it’s essential to separate this topic from IP Fragmentation attacks, since both involve “splitting data into pieces” and are frequently conflated.
| Aspect | TCP Fragmentation (Segmentation) | IP Fragmentation |
|---|---|---|
| OSI layer | Transport (Layer 4) | Network (Layer 3) |
| What gets split | The application’s TCP byte stream, into segments | A single IP datagram, into fragments |
| Who decides the split | The sending TCP stack, based on negotiated MSS | Any router or host along the path, based on link MTU |
| Governing header field(s) | TCP sequence number, MSS option (negotiated at handshake) | IP fragment offset, More Fragments flag, Identification field |
| Reassembly happens in | The receiving TCP stack, using sequence numbers | The receiving IP stack, using fragment offset and Identification |
| Relationship between the two | A single TCP segment may itself later be fragmented at the IP layer if it exceeds path MTU — the two mechanisms can stack | Independent of TCP; also applies to UDP and ICMP, which have no segmentation concept at all |
| Typical exploit goal | Evade pattern-matching inspection by splitting signatures across segment boundaries; exhaust stream reassembly buffers | Evade stateless packet filters via offset tricks; crash reassembly code; exhaust IP-level reassembly memory |
The clearest way to keep these separate: IP fragmentation is something that happens to a single packet when it’s too big for a link. TCP segmentation is something that happens to an entire data stream before any individual packet is even built, governed entirely by the transport layer’s own logic. A TCP connection can experience segmentation-based evasion attempts with zero IP fragmentation ever occurring, and vice versa.
How TCP Segmentation Works Normally
TCP does not send an application’s data as one unbroken transmission. It divides the byte stream into segments no larger than the Maximum Segment Size (MSS), a value negotiated during the three-way handshake via the MSS option, and typically derived from the path’s MTU minus IP and TCP header overhead (commonly MSS = 1460 bytes for a standard 1500-byte Ethernet MTU).
TCP segment structure (relevant fields):
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Source Port | Destination Port |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Sequence Number |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Acknowledgment Number |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Data | |U|A|P|R|S|F| || Offset|Reserved|R|C|S|S|Y|I| Window |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+...Options: ... MSS=1460 (negotiated only in SYN/SYN-ACK) ...
MSS/MTU interaction: Ethernet MTU: 1500 bytes IP header: -20 bytes TCP header: -20 bytes ───────────────────────────── Resulting MSS: 1460 bytes (max TCP payload per segment)Application writes 4,380 bytes to a TCP socket:
Segment 1: seq=0, len=1460 (bytes 0-1459)Segment 2: seq=1460, len=1460 (bytes 1460-2919)Segment 3: seq=2920, len=1460 (bytes 2920-4379)
Receiving TCP stack reassembles using sequence numbers, not IP fragmentoffsets — it buffers out-of-order segments and delivers a contiguousbyte stream to the application once gaps are filled.The sender’s TCP stack is free to choose segment sizes smaller than the negotiated MSS at any time — there is nothing in RFC 793 that requires every segment to be MSS-sized. This flexibility, essential for legitimate use cases like interactive protocols sending small keystroke-sized segments, is exactly what segmentation-based attacks exploit.
How TCP Fragmentation (Segmentation) Attacks Work
1. Tiny segment evasion. The attacker deliberately sends TCP segments far smaller than the negotiated MSS — sometimes as small as a single byte — splitting an HTTP request, an exploit payload, or any pattern a security device is looking for across multiple segments.
Normal single-segment HTTP request line:Segment: "GET /admin/config.php HTTP/1.1\r\n"
Tiny-segment evasion of the same request:Segment 1: "GE"Segment 2: "T /adm"Segment 3: "in/config"Segment 4: ".php HTTP/1.1\r\n"
A packet-by-packet pattern match for "/admin/config.php" fails againsteach individual segment. Only a device that reassembles the full TCPstream before matching will detect the pattern.This is the core technique behind many historical IDS/WAF evasion methods: any inspection device that applies signature matching per-packet rather than per-reassembled-stream can be evaded by choosing segment boundaries that split the signature across two or more packets.
2. Segment boundary manipulation with overlapping retransmissions. Beyond simply using tiny segments, an attacker can send an initial segment, then retransmit an overlapping segment at the same or nearby sequence number with different data. If the inspection device and the final destination reassemble overlapping segments differently (some prefer the first-seen data, others prefer the most recent), the attacker can make the inspection device “see” different content than what the destination application ultimately processes — a stream-level analog of the overlapping-fragment ambiguity described in IP fragmentation attacks, but exploiting TCP sequence numbers instead of IP fragment offsets.
Segment A: seq=100, len=20, data="SAFE_LOOKING_CONTENT"Segment B: seq=105, len=20, data="ALOAD_MALICIOUS_PAY_" (overlaps A at seq 105-119)
Inspection device policy: "first arrival wins" → sees Segment A's contentDestination OS policy: "last arrival wins" → application processes a blended stream using Segment B's overlapping bytes
Result: inspected content and delivered content diverge3. TCP stream reassembly exhaustion. Rather than evasion, this variant targets availability directly. The attacker opens many TCP connections (or uses existing ones) and sends large volumes of segments out of order or with deliberate gaps, forcing the target’s TCP stack — or an inline inspection device performing full-stream reassembly — to buffer growing amounts of out-of-order data per connection while waiting for the missing segments to arrive (which they never do, or arrive very slowly). This consumes memory proportional to the number of connections and the size of each connection’s out-of-order buffer.
Bot opens TCP connection, completes handshake normallyBot sends segment at seq=50000 (skipping seq=0-49999 entirely)Target/inspection device: buffers this out-of-order segment, waiting for the missing earlier bytesBot repeats across thousands of connections, never sending the gap-filling data
Result: reassembly/reorder buffer memory grows across many connections, each held open and consuming resources until connection or reassembly timeouts triggerThis overlaps conceptually with low-and-slow attacks in that it relies on holding state open cheaply, but the specific resource under pressure — the reorder buffer for out-of-order segment data — is distinct from Slowloris-style incomplete-header attacks.
TCP Fragmentation Attack Variants Compared
| Variant | Mechanism | Primary Goal | Primary Target Resource |
|---|---|---|---|
| Tiny segment evasion | Segments far smaller than MSS split a signature/pattern across packet boundaries | Evade per-packet inspection (WAF, IDS, DPI) | Inspection accuracy, not availability |
| Overlapping segment ambiguity | Retransmitted segments overlap in sequence space with differing data | Cause inspection device and destination to see different content | Inspection accuracy, not availability |
| Stream reassembly exhaustion | Out-of-order/incomplete segments held pending missing data across many connections | Exhaust reorder buffer memory and connection state | Memory, connection table |
Detection Signals and Telemetry
# Capture only small-payload TCP segments (a common tiny-segment evasion signature)tcpdump -i eth0 'tcp and (ip[2:2] - ((ip[0]&0xf)*4) - ((tcp[12]&0xf0)>>2)) < 32' -c 200# Matches packets where the TCP payload length is under 32 bytes
# Per-connection TCP stack counters (Linux)nstat -az | grep -iE "tcp.*(ofoqueue|reass|prune)"# TCPOFOQueue: segments currently held in the out-of-order queue
# Live socket-level view of connections with abnormal send/receive queue buildupss -tin
# Check current negotiated MSS on active connectionsss -tin | grep -i mss
# nftables counter matching unusually small TCP payload segmentsnft add rule inet filter input tcp flags != syn,rst,fin tcp payload-size lt 32 counter| Indicator | Normal | Under TCP Segmentation Attack | Tool |
|---|---|---|---|
| Segments with payload far below negotiated MSS | Occasional (interactive protocols, small application writes) | Sustained, high-frequency pattern of implausibly small segments | tcpdump, packet capture |
TCPOFOQueue (out-of-order queue depth) | Low, transient | Sustained growth across many connections | nstat -az |
| Retransmissions with overlapping sequence ranges and differing payloads | Rare/absent | Present — indicates crafted overlap attempt | Packet capture / IDS |
| Connections with large send/receive queue buildup and no progress | Rare | Elevated count via ss -tin | ss, connection tracking |
| WAF/IDS signature misses correlated with fragmented request patterns | N/A | Detected payload only visible after full-stream reassembly in forensic replay | Full-stream capture and offline reassembly |
Mitigation Techniques
| Technique | How It Works | Effectiveness |
|---|---|---|
| MSS clamping at the network edge | Forces a maximum segment size for all connections passing through, reducing the range of exploitable tiny-segment behavior at the network boundary | Medium — limits some evasion patterns but doesn’t eliminate below-MSS segment abuse |
| Full-stream reassembly before pattern inspection | WAF/IDS/IPS reconstructs the complete TCP byte stream before applying signature or rule matching, rather than inspecting packet-by-packet | High — directly closes the tiny-segment and overlap evasion gap |
| Consistent overlap-resolution policy | Inspection device and protected host apply the same “first wins” or “last wins” policy for overlapping segment data, eliminating divergence | High against overlap-ambiguity evasion specifically |
| Reorder/reassembly buffer limits per connection | Cap the amount of out-of-order data buffered per connection before forcing a reset or drop | Medium-high against reassembly exhaustion |
| Connection-level anomaly detection | Flag connections with abnormally high ratios of tiny segments, retransmissions, or persistent out-of-order state relative to legitimate traffic baselines | Medium-high — catches both evasion and exhaustion patterns |
| Idle/incomplete-stream timeouts | Reset connections that hold incomplete or gapped data beyond a reasonable threshold | Medium — bounds exposure window for exhaustion variant |
| Upstream/edge inline inspection with stream normalization | Provider-side infrastructure normalizes and reassembles streams before they reach origin-side inspection or application logic | High for both evasion and exhaustion variants at scale |
Common Mistakes
| Mistake | Impact | Correct Solution |
|---|---|---|
| WAF or IDS inspects each TCP segment/packet independently | Signatures split across segment boundaries evade detection entirely | Require full-stream (TCP-stream-aware) reassembly before rule matching |
| Assuming MSS clamping alone prevents tiny-segment evasion | Clamping sets a maximum, but senders can still choose to send segments far smaller than the clamped MSS | Combine MSS clamping with stream reassembly and anomaly detection, not as a standalone fix |
| Using inconsistent overlap-resolution logic between inspection device and destination host | Attacker can make the two systems process different content from the same segment sequence | Standardize overlap handling policy across all inspection points and confirm it matches destination OS behavior |
| Confusing TCP segmentation issues with IP fragmentation issues during investigation | Wrong mitigation layer gets tuned (e.g., adjusting ipfrag_high_thresh when the real issue is segment-level evasion) | Confirm with packet capture which layer the anomalous behavior occurs at before selecting a fix |
| No monitoring of out-of-order queue depth per connection | Reassembly exhaustion attacks progress unnoticed until memory pressure causes broader service impact | Track TCPOFOQueue and per-connection buffer growth as a standing operational metric |
| Treating tiny segments as inherently malicious and blocking them outright | Breaks legitimate interactive or latency-sensitive protocols that intentionally send small segments (e.g., SSH keystrokes, some real-time protocols) | Use rate and pattern-based anomaly thresholds rather than blanket small-segment blocking |
How to Implement on Azion
Azion’s distributed network can help reduce exposure to TCP segmentation-based evasion and reassembly-exhaustion attacks, depending on the products enabled and how they are configured:
- DDoS Protection provides always-on detection and mitigation for connection-level and protocol anomalies, including abnormal segmentation patterns, at the network edge.
- Network Shield can apply connection-level rules to identify anomalous TCP segment patterns before they reach application infrastructure.
- Firewall enables custom rules for connection-based filtering relevant to segmentation-based traffic anomalies.
- WAF inspects reassembled HTTP requests rather than individual TCP segments, which can help reduce exposure to segment-boundary evasion attempts against application-layer rules, depending on configuration.
- WAAP combines network- and application-layer controls for scenarios where segmentation-based evasion is paired with application-layer attack attempts.
Because Azion terminates TCP connections at the edge, requests are reassembled into complete streams as part of normal connection handling before being forwarded to your origin, which can help reduce the exposure of origin-side inspection to raw, attacker-controlled segment sequences — though the specific behavior depends on your configured products.
Related Resources
- What Is a DDoS Attack?
- DDoS Attack Types
- What Is DDoS Protection and Mitigation?
- What Is an IP Fragmentation Attack?
- Low and Slow Attacks
- Azion DDoS Protection
- Azion WAF
Frequently Asked Questions
What is a TCP fragmentation attack? A TCP fragmentation attack, more accurately called a TCP segmentation attack, manipulates how a TCP byte stream is divided into segments — usually by sending abnormally tiny segments or overlapping retransmissions — to evade inspection devices that analyze packets individually rather than as a reassembled stream, or to exhaust reassembly resources on the target.
Is TCP fragmentation the same as IP fragmentation? No, and this is the most common point of confusion. IP fragmentation splits a single IP datagram at the network layer when it exceeds a link’s MTU, governed by the fragment offset and More Fragments flag. TCP fragmentation (segmentation) splits the application’s data stream at the transport layer into segments based on the negotiated Maximum Segment Size, entirely independent of what happens later at the IP layer.
Why do attackers send unusually small TCP segments? Sending tiny segments — sometimes just a few bytes each — splits meaningful patterns like HTTP request paths or exploit signatures across multiple packets. Security devices that inspect each packet’s payload individually, without reassembling the full TCP stream first, can fail to detect the complete pattern, letting malicious content pass undetected.
What is MSS and how does it relate to this attack? The Maximum Segment Size (MSS) is negotiated during the TCP handshake and represents the largest amount of data a segment should carry, typically derived from the path MTU. Attackers aren’t bound by the MSS as a minimum — nothing prevents sending segments far smaller than MSS — and that flexibility is exactly what tiny-segment evasion techniques exploit.
Can MSS clamping alone stop TCP segmentation attacks? No. MSS clamping sets an upper bound on segment size at the network edge, but it does not prevent a sender from choosing to transmit segments much smaller than that bound. MSS clamping should be combined with full-stream reassembly at inspection points and connection-level anomaly detection for effective coverage.
How does TCP stream reassembly exhaustion cause denial of service? An attacker sends segments out of order or with deliberate gaps across many connections, forcing the target (or an inline inspection device) to buffer growing amounts of out-of-order data while waiting for missing segments that never arrive. Across enough connections, this consumes memory and connection-table resources similarly to how other state-exhaustion attacks work, but the specific resource is the TCP reorder/reassembly buffer.
What’s the difference between overlapping TCP segments and overlapping IP fragments? Overlapping TCP segments exploit ambiguity in how a receiver resolves conflicting data at the same sequence number within a byte stream, potentially causing an inspection device and the destination application to process different content. Overlapping IP fragments exploit ambiguity in fragment offset and length at the network layer, historically causing crashes and, today, primarily used for stateless-filter evasion — the two exploit different header fields and different reassembly logic entirely.
How do WAFs defend against TCP segmentation evasion? Effective WAFs reconstruct the complete HTTP request from the reassembled TCP stream before applying signature or rule matching, rather than inspecting individual packets or segments. This ensures that a pattern split across multiple tiny segments is still detected once the full stream is available for inspection.
Is TCP segmentation evasion still relevant given widespread TLS encryption? Yes, though the target shifts. With TLS, payload-level pattern matching happens after decryption at a TLS-terminating device, so segmentation evasion against that inspection point still matters if the device doesn’t fully reassemble the decrypted stream before analysis. Segmentation-based reassembly-exhaustion attacks also remain fully relevant regardless of encryption, since they target connection and buffer state rather than payload content.
How can I detect TCP segmentation attacks on my network?
Look for a sustained pattern of TCP segments with payload sizes far below the connection’s negotiated MSS, elevated out-of-order queue depth (TCPOFOQueue via nstat -az), and retransmissions with overlapping sequence ranges carrying different data. Correlating these signals with connection-level anomaly baselines, rather than relying on any single packet’s content, gives the most reliable detection.
Sources
- IETF. “Transmission Control Protocol.” RFC 793. 1981.
- IETF. “TCP Extensions for High Performance.” RFC 7323. 2014.
- Ptacek, Thomas H., and Timothy N. Newsham. “Insertion, Evasion, and Denial of Service: Eluding Network Intrusion Detection.” Secure Networks, Inc. 1998.
- IETF. “Security Considerations for IP Fragment Filtering.” RFC 1858. 1995.
- CISA. “Understanding and Responding to Distributed Denial-of-Service Attacks.”
- NIST. “Guide to Intrusion Detection and Prevention Systems.” SP 800-94.