TCP protocol Rst:rst Introduction, when to send RST packet

Source: Internet
Author: User

First, RST introduction

RST marks a reset, an exception to the closed connection.

1. Send the RST packet off the connection, do not have to wait for the buffer packets are sent out, directly discard the buffer in the packet, send rst.

2. The receiving end receives the RST packet and does not have to send an ACK packet to confirm it.


Second, when to send rst bag

1. Establish a connected Syn to reach a port, but there is no service on the port that is listening.

2. TCP receives a section on a connection that does not exist at all.

3. The request timed out. Set the Recv timeout by using the setsockopt so_rcvtimeo option. When a data timeout is received, the RST package is sent.


Third, try to manually send rst bag

1. Use shutdown, close closes socket, send is fin, not rst.

2. Use sleep before the socket closes. To run the program CTRL + C, will send fin, not rst.

3. Before the socket closes, perform return, exit (0), exit (1), and send fin, not rst.

None of the above methods can send RST packets. To send the RST packet, you need to spoof the packet to send it yourself.

Test code: http://blog.csdn.net/guowenyan001/article/details/11742621


Resources:

RST attack: http://baike.baidu.com/view/1044719.htm

The presence of RST in several connections: http://my.oschina.net/costaxu/blog/127394

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.