How many cases does the TCP RST segment send on a peer-to-peer connection?

I know that if the process fails, the existing TCP socket will be deleted by sending an RST packet (segment) to another peer, and the corresponding fd socket on the other peer will receive an RST packet.

Are there any other cases posted by RST packet? For example, if a process call close () on socket fd, but with unread data left on that socket, would it also send an RST (segment) packet on that fd socket to another peer?

+3


source to share


1 answer


Citation TCP / IP Manual

Generally speaking, a reset is generated whenever something happens which is "unexpected" TCP software. Some of the more common specific cases in which a reset is generated include:

  • Receiving any TCP segment from any device with which the device is currently not connected when receiving a segment (except SYN requesting a new connection.)

  • Receipt of a message with an invalid or incorrect sequence number, or Acknowledgment field indicating that the message may have belonged to a previous connection or otherwise be false.

  • Receive a SYN message on a port where there is no listening process for connections.



If you observe strange behavior RST

, you may become a victim of TCP reset Attack

About your last question, I think what is RST

sent when you close a socket with unread data in the socket buffer, because it won't break any TCP rule (packets were delivered correctly, it's just a process that didn't elaborate on this). Will be sent instead FIN

.

+2


source







All Articles