Visual C++ Network: Why do my machine send an RST packet in
reply to a SYN/ACK pac Q: Raw sockets - Why do my machine send
an RST packet in reply to a SYN/ACK packet? A: This is one of
the most frequently asked question by someone who is
experimenting with raw sockets and TCP/IP. It is known that the
'IP_HDRINCL' socket option allows you to include the IP header
along with the data. Since TCP encapsulates the IP header, we
can also build a TCP packet and send it over a network. But the
problem is, a TCP connection can never be established this way.
The scenario is as follows: A TCP connection is always made by a
three-way handshake. So, initially you send a 'SYN' packet to
the remote machine. If it is actively listening on the port, you
get a 'SYN/ACK' packet. So far so good. But before you can
respond, your machine sends an 'ACK/RST' packet and connection
attempt is ended. For the connection to be complete, instead of
the 'RST' packet, your machine should be sending an 'ACK' to the
remote machine. The differ