I am trying to implement TCP handshaking but receive RST instead of ACK:
No. Time Source Destination Protocol Length Info
62 24.622012890 192.168.0.147 192.168.0.41 TCP 76 51486 → 8888 [SYN] Seq=1240744644 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=2095798637 TSecr=0 WS=128
Frame 62: 76 bytes on wire (608 bits), 76 bytes captured (608 bits) on interface 0
Linux cooked capture
Internet Protocol Version 4, Src: 192.168.0.147, Dst: 192.168.0.41
Transmission Control Protocol, Src Port: 51486, Dst Port: 8888, Seq: 1240744644, Len: 0
No. Time Source Destination Protocol Length Info
63 24.627320274 192.168.0.41 192.168.0.147 TCP 62 8888 → 51486 [SYN, ACK] Seq=4039242319 Ack=0 Win=64240 Len=0
Frame 63: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface 0
Linux cooked capture
Internet Protocol Version 4, Src: 192.168.0.41, Dst: 192.168.0.147
Transmission Control Protocol, Src Port: 8888, Dst Port: 51486, Seq: 4039242319, Ack: 0, Len: 0
VSS-Monitoring ethernet trailer, Source Port: 0
No. Time Source Destination Protocol Length Info
64 24.627364199 192.168.0.147 192.168.0.41 TCP 56 51486 → 8888 [RST] Seq=0 Win=0 Len=0
Frame 64: 56 bytes on wire (448 bits), 56 bytes captured (448 bits) on interface 0
Linux cooked capture
Internet Protocol Version 4, Src: 192.168.0.147, Dst: 192.168.0.41
Transmission Control Protocol, Src Port: 51486, Dst Port: 8888, Seq: 0, Len: 0
I am setting up the enc28j60 ethernet controller as a server, and have script to serve as the client. I try to send a SYN,ACK packet from the enc28j60 (an ethernet controller) with my own TCP/IP stack in response to the SYN from the client, but I always receive RST instead of ACK.
The checksum in my SYN,ACK is correct according to Wireshark. I have set up ARP.
What are some reasons why a client would send a RST?
Best Answer
There are various reasons a RST is sent. We have no idea for the particular reason you are getting a RST, and what your host implementation of TCP is doing is off-topic here.
RFC 793, Transmission Control Protocol is the definition of TCP, and you should really be familiar with everything in it if you are trying to do what you describe. It has a general explanation, but there are many other things that you should understand: