• Recent blogs

    possible SYN flooding on port 443. Sending cookies.

    possible SYN flooding on port 443. Sending cookies.

    SYN cookies are a method by which TCP connections can continue to be established when the system's SYN backlog for a given socket fills up. SYN cookies allow connections to continue establishing at times when a socket may face a temporary SYN flood. A SYN cookie is created by crafting a special SYN+ACK where the Sequence Number is a function of the time, the Maximum Segment Size, and the client and server's IP address and port numbers.So if a socket's listen queue is full, and more SYNs arrive for that socket,then we either send SYN cookies. If SYN cookies are disabled then we drop the incoming traffic. In our case SYN cookies are enabled, but maximum connections is set 128 only. If we increase this value we will have an Impact on Memory. But if you have have RAM Free on Server , you need not to worry.

    What could have Caused this issue:

    1. Recently we have added backends and Services.
    2. if Some Services configured larger TTL, So they are in the SYN backlog until that time of Inactivity.
    3. As Session parameters are there to maintain a static request between Session id and Backend server, it depends on the backend servers response time as well that how soon the SYN Listen Socket fills up.

    1. we need to Increase the maximum amount of connections allowed to sit in the socket's listen() backlog.
    2. We need to increase sysctl net.core.somaxconn value to 2048 for accommodating more syn cookies fallback.
    3.  I would recommend not to have TTL more than 900 Seconds, But it can be argued upon.
    4.  If Some Services are running on single Backend and they are more prone to parking the requests.

    Implementation Steps:

    1. Current value on example.com. 
    2. [root@example.com ~]# sysctl net.core.somaxconn
    3. net.core.somaxconn = 128
    4. We should match if the corresponding syn backlog have the same value. Current value on example.com
    5. root@example.com ~]# sysctl net.ipv4.tcp_max_syn_backlog
    6. net.ipv4.tcp_max_syn_backlog = 2048
    7. Edit /etc/sysctl.conf and add net.core.somaxconn=2048

    No comments