TCP server "Denial of Service Attack" SOLUTION

Source: Internet
Author: User

This is a complete solution, but it is a bit exaggerated, but it can indeed alleviate the vulnerability of TCP servers when they suffer a "Denial of Service attack.
When the server provides services in TCP mode, the client connects to the server over TCP. At this time, maliciousProgramYou can also use TCP to connect to our server. If malicious programs establish thousands of connections to our server cyclically and send malicious packets to the server on each connection, it will slowly cause the server to run out and crash!
To enhance the stability of the TCP server when it is under a "Denial of Service Attack", I adopt the following solution:

(1) Add the token field to the message header of the communication protocol, and it is the first field of the message header. When the server receives a piece of data, if the data does not start with a token, the corresponding TCP connection is closed. In this way, as long as a malicious program connects to the server to send data, the server can identify it.
If a malicious program only establishes thousands of connections with the server and does not send any data, the number of available TCP connections on the server is exhausted? This requires the second step.

(2) The server can be set. If no data is sent within the specified time (for example, 50 ms) after the client connects to the server, it indicates that the connection is illegal and closes immediately.

(3) Use the "out-of-band data" Storage mark to establish a connection. If a customer fails to connect to the database, or the out-of-band data is incorrect, the connection is closed.

(4) If a hacker breaks the communication protocol between the client and the server and writes a malicious client, then your server cannot identify which connection is legal or illegal, in this case, the only way out is to modify your protocol and use various methods (such as encryption) to make it more difficult to crack!

Please refer to the following link for more information. Thank you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.