> Source: [sk66576](https://support.checkpoint.com/results/sk/sk66576)

# sk66576 - Traffic is dropped by IPS protection "TCP Segment Limit Enforcement" due to attack "TCP segment out of maximum allowed sequence"

| Property | Value |
|----------|-------|
| Solution ID | sk66576 |
| Date Created | 2012-01-21 |
| Last Modified | 2026-07-16 |
| Technical Level | General |
| Products | Security Gateway |
| Versions | R81.20, R81.10 (EOS), R81 (EOS) |
| OS | Gaia |

## Solution

**Note** : Scenario # 1 applies to R80.20SP and R80.30SP, as well. Scenario # 2 does not apply R80.20SP and R80.30SP.

Introduction
------------

This article describes different scenarios when traffic is dropped by IPS protection: "***TCP Segment Limit Enforcement*** " due to attack "***TCP segment out of maximum allowed sequence*** ".  
Each Scenario has additional details (mostly received from debugs), additional error messages, and its own cause and solution.

The following logs appear in SmartView Tracker (if this IPS protection is configured to log its actions):

* When IPS protection "*TCP Segment Limit Enforcement* " is set to "*Prevent*" action:

  ```
  Type: Log
  Action: Prevent
  Protocol: tcp
  Protection Type: Engine Settings
  Protection Name: TCP Segment Limit Enforcement
  Attack: Streaming Engine: TCP Segment Limit Enforcement
  Attack Information: TCP segment out of maximum allowed sequence. Packet dropped.
  Product: IPS Software Blade
  ```

* When IPS protection "*TCP Segment Limit Enforcement* " is set to "*Detect*" action:

  ```
  Type: Log
  Action: Detect
  Protocol: tcp
  Protection Type: Engine Settings
  Protection Name: TCP Segment Limit Enforcement
  Attack: Streaming Engine: TCP Segment Limit Enforcement
  Attack Information: TCP segment out of maximum allowed sequence. Warning! Inspection stopped.
  Product: IPS Software Blade
  ```

Background
----------

|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Threat Description         | For every TCP segment that passes through the Security Gateway, the Security Gateway retains a copy of the segment until it receives an acknowledgment that the segment was received. This buffered data occupies space in the Security Gateway's memory.       |
| IPS Protection Description | This IPS protection enforces a limit on the number and size of buffered segments per connection. When a connection reaches one of these limits, the Security Gateway will not accept new segments for this connection until buffered segments are acknowledged. |
| Warning                    | Setting this IPS protection to "*Detect* " action will enable matching connections to ***bypass*** all IPS protections.                                                                                                                                         |

**Table of Contents:**

* Scenario 1 - Legitimate drops
* Scenario 2 - R77.30 with enabled SecureXL and traffic passes through Medium Path
* Related documents
* Related solutions

Show the Entire Article

Scenario 1 - Legitimate drops {#Scenario 1}
-------------------------------------------

**Symptoms:**

* Traffic is dropped by IPS protection "*TCP Segment Limit Enforcement* " due to attack "*TCP segment out of maximum allowed sequence*".

* Kernel debug ('`fw ctl debug -m fw + drop`') shows:  
  *;fw_log_drop: Packet proto=6 ... dropped by fwpslglue_chain Reason: PSL Drop: TCP segment out of maximum allowed sequence. Packet dropped.;*

Show / Hide solution  

**Cause:**
> In TCP, it is not necessary to acknowledge every TCP segment that was received. A a TCP window size is negotiated. This means that after XX bytes, a TCP-ACK segment is sent that acknowledges the last received ordered sequence.
>
> This minimizes the amount of data that needs to be sent back to the sender to maintain data stream integrity.
>
> *Example*: If the TCP window size is 4000 bytes, after 4000 bytes a TCP-ACK must be sent back for the last sequence.
> ***The larger the size of TCP window, the more the server can delay the TCP-ACK reply.*** **Note:** Not all stacks handle ACK the same way. Some stacks will send an ACK packet after two packets, but some stack implementations use a dynamic decision, based on the window size. That is why we the server must send ACK by the end of the window size.
>
> If an attacker tries to overload the server with TCP packets, the window size limit will be reached on the Security Gateway, after which it will start to drop the TCP packets.
>
> The attacker can try to overcome this by sending small TCP packets. This will cause the sequence to advance in small increments, but each saved packet will also contain headers and additional data (other than the payload), causing the memory consumption to increase without reaching the TCP window size.
>
> In order to protect against the TCP segment attack, the Security Gateway implements a protection called "*TCP Segment Limit Enforcement*". If a connection exceeds a fixed number of packets in the connection buffer, then the packet will be dropped.

**Solution:**
> Increase the value of kernel parameter ***psl_max_stream_segments***, which controls the maximal buffer size used by PSL (Passive Streaming Library) - i.e., maximal number of packets that belong to a single TCP connection in the PSL packet queue - packets that were not acknowledged and future packets.
>
> **Important Note:** Changing the value of this kernel parameter should be done with great caution and should be closely coordinated with [Check Point Support](http://www.checkpoint.com/support-services/contact-support/index.html).
>
> Action plan:
>
> 1. Get the current value of the kernel parameter *psl_max_stream_segments*:
>
>    ***\[Expert@HostName:0\]# fw ctl get int psl_max_stream_segments***
> 2. Permanently double the current value of the kernel parameter *psl_max_stream_segments*:
>
>    Follow [sk26202 - Changing the kernel global parameters for Check Point Security Gateway](http://supportcontent.checkpoint.com/solutions?id=sk26202).
>    > For Gaia / SecurePlatform OS:
>    > 1. Create the *$FWDIR/boot/modules/fwkern.conf* file (if it does not already exit):
>    >
>    >    ***\[Expert@HostName\]# touch $FWDIR/boot/modules/fwkern.conf***
>    > 2. Edit the *$FWDIR/boot/modules/fwkern.conf* file in Vi editor:
>    >
>    >    ***\[Expert@HostName\]# vi $FWDIR/boot/modules/fwkern.conf***
>    > 3. Add the following line (spaces are not allowed):
>    >
>    >    ***psl_max_stream_segments=*VALUE**
>    >
>    >    Explanations:
>    >    > * The *default* value of this kernel parameter is:  
>    >    >   ( \[PSL max window size\] + \[additional merging error for TCP window size\] ) / \[average TCP packet size\] =  
>    >    >   ( \[ 8\*1024\*1024 bytes \] + \[ 1500 bytes (one packet of normal size) \] ) / 512 = 16386 segments
>    >    >
>    >    > * The impact of increasing the value of this kernel parameter:
>    >    >
>    >    >   * Amount of memory consumed by the PSL buffering (i.e., amount of memory consumed by Check Point kernel) will increase
>    >    >   * The size of buffered segments will decrease
>    >    > * In some cases, even after increasing the buffer size to the maximum, the issue is not resolved (most of the times, it is a mail server on port 25). In such cases, you should create an exception for the problematic server in this IPS protection.
>    >
>    > 4. Save the changes and exit from Vi editor.
>    >
>    > 5. Check the contents of the *$FWDIR/boot/modules/fwkern.conf* file:
>    >
>    >    ***\[Expert@HostName\]# cat $FWDIR/boot/modules/fwkern.conf***
>    > 6. Reboot the Security Gateway.
>    >
>    > 7. Verify that the new value was set:
>    >
>    >    ***\[Expert@HostName\]# fw ctl get int psl_max_stream_segments***
> 3. Check if the traffic is still dropped by this IPS protection.

Scenario 2 - R77.30 with enabled SecureXL and traffic passes through Medium Path {#Scenario 2}
----------------------------------------------------------------------------------------------

**Symptoms:**

* Traffic is dropped by IPS protection "*TCP Segment Limit Enforcement* " due to attack "*TCP segment out of maximum allowed sequence*".

* Kernel debug ('`fw ctl debug -m fw + drop`') shows:  
  *;fw_log_drop: Packet proto=6 ... dropped by fwpslglue_chain Reason: PSL Drop: TCP segment out of maximum allowed sequence. Packet dropped.;*

* R77.30 Security Gateway with enabled SecureXL.

* Affected traffic must pass through Medium Path (PXL) - e.g., Anti-Bot / Anti-Virus / HTTPS Inspection / Proxy mode / Mobile Access / VoIP / Web Portals.

* Kernel debug ('`fw ctl debug -m fw + tcpstr`') shows:

  ```
  ;psl_check_window: received old packet inside stripping window, seq ... ack=... fus=... strip_window ...;
  ;psl_handle_packet_exception: event 14 occured ...
  ;psl_handle_packet_exception: enfmod returned enforce; 
  ;psl_handle_packet_exception: status is DROP; 
  ;psl_handle_status_and_action: stat=2; 
  ;psl_handle_packet_exception: packet action is DROP; 
  ```

**Issue ID:**

* 01892651

Show / Hide solution  

**Cause:**
> Maximal TCP sequence for Client-to-Server connections is set to Maximal TCP sequence of Server-to-Client connections. As a result, Server-to-Client packets are dropped.

**Solution:**
> This problem was fixed. The fix is included in:
>
> * [Check Point R80.10](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk111841)
> * [Jumbo Hotfix Accumulator for R77.30](http://supportcontent.checkpoint.com/solutions?id=sk106162) - since *Take_99*
>
> For **other R77.30 installations** , Check Point Support can supply a **Hotfix** . [Contact Check Point Support](http://www.checkpoint.com/services/contact/index.html) to get a Hotfix for this issue.  
> A Support Engineer will make sure the Hotfix is compatible with your environment before providing the Hotfix.  
> For faster resolution and verification, please collect [CPinfo files](http://supportcontent.checkpoint.com/solutions?id=sk92739) from the Security Management Server and Security Gateways involved in the case.

Related solutions {#Related solutions}
--------------------------------------

* [sk26202 - Changing the kernel global parameters for Check Point Security Gateway](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk26202)
* [sk36733 - Check Point FireWall Streaming Buffer](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk36733)

---

# Agent Instructions

This content is from the Check Point Support Center (https://support.checkpoint.com), the official knowledge base for Check Point cybersecurity products.

## Navigating This Knowledge Base

- **Complete index**: [llms.txt](https://support.checkpoint.com/llms.txt)
- **All SK articles**: [SecureKnowledge Sitemap](https://support.checkpoint.com/sitemaps/secureknowledge-sitemap-index.xml)
- **SK article URL pattern**: `https://support.checkpoint.com/results/sk/{skId}`
- **Markdown responses**: AI bot User-Agents automatically receive `text/markdown` content
