0

Trying to establish a tcp connection between a client / server. Both machines are Macs and are on the same LAN. Server's app listens on port 12345. After receiving "SYN, ACK" from Server, I send "ACK" but then my client automatically sends a "FIN, ACK" followed by "RST, ACK". So the TCP Flow ends up being:

Client sends SYN. SVR sends SYN, ACK. Client sends ACK. Client sends FIN, ACK. Client sends RST, ACK. SVR sends ACK. SVR sends ACK. Client sends RST. Client sends RST.

From reading other posts with similar issues it sounds like this could be happening because I'm trying to manually create the handshake on the user level and the Unix kernel (operating at the system level) sees the "SYN, ACK" far before anything on the user level can respond and moves to close the connection, seeing it as open for no reason. A similar problem to what this Linux user experienced: Unwanted RST TCP packet with Scapy

Whereas iptables worked for the Linux user should I use something like pf in Mac OS X to block / drop the FIN and RST msgs? My client is running 10.9.5 and my server 10.10.3.

Here's a flow graph of the tcp communication Server is 10.0.100.5 and client is 10.0.100.4:

2
  • Not sure what you mean by "I'm trying to manually create the handshake on the user level". Are you constructing a raw packet with manually created IP/TCP header? Commented Jul 29, 2015 at 9:51
  • @ZabojCampula Yes that's exactly what I'm trying to do. The server-side software with which I'm interacting sends a "handshake\0" string with the the SYN-ACK and with my return ACK I need to send the same "handshake\0" string. I can use pf to block outgoing FIN and RST from my client, and then I can send the SYN-ACK with custom string without unwanted FIN and RST flags.
    – Flan
    Commented Jul 30, 2015 at 16:24

0

Browse other questions tagged or ask your own question.