TCP Handshake Problem for Windows

I am trying to create a TCP connection from the embedded controller to a Windows Vista server. I am writing the server side of a Windows application.

When the controller tries to connect, it may take many attempts to establish a connection. I used Wireshark to debug the problem, and it seems that the Windows TCP stack does not match the correct acknowledgment protocol.

Reset Wireshark:

"No","Time","Source","Destination","Protocol","Info"

Try1:

"39","9.025322","10.0.0.252","10.0.0.92","TCP","49153 > xinuexpansion4 [SYN] Seq=0 Win=127 Len=0"
"40","9.025377","10.0.0.92","10.0.0.252","TCP","xinuexpansion4 > 49153 [ACK] Seq=1 Ack=1 Win=2048 Len=0"
"47","10.031750","10.0.0.252","10.0.0.92","TCP","49153 > xinuexpansion4 [RST] Seq=0 Win=127 Len=0"

Try 2:

"55","12.193941","10.0.0.252","10.0.0.92","TCP","49154 > xinuexpansion4 [SYN] Seq=0 Win=127 Len=0"
"56","12.194045","10.0.0.92","10.0.0.252","TCP","xinuexpansion4 > 49154 [ACK] Seq=1 Ack=1 Win=2048 Len=0"
"57","13.200431","10.0.0.252","10.0.0.92","TCP","49154 > xinuexpansion4 [RST] Seq=0 Win=127 Len=0"

Try 3:

"67","18.529871","10.0.0.252","10.0.0.92","TCP","49156 > xinuexpansion4 [SYN] Seq=0 Win=127 Len=0"
"68","18.529957","10.0.0.92","10.0.0.252","TCP","xinuexpansion4 > 49156 [SYN, ACK] Seq=0 Ack=1 Win=8192 Len=0 MSS=1460"
"69","18.536318","10.0.0.252","10.0.0.92","TCP","49156 > xinuexpansion4 [ACK] Seq=1 Ack=1 Win=127 Len=0"

10.0.0.252 is the controller initiating the connection, 10.0.0.92 is a Windows PC.

As I understand it, the correct sequence is SYN, SYN + ACK, SYN. What I get most of the time is SYN, ACK, RST (i.e. Windows responds with ACK, not SYN + ACK). In the dump above, it shows 3 connection attempts, the third one works.

-, , "" Windows, ?

- 2

+3
3

pcap, , , :

(1) Windows "" SYN-, , 1, 2, 3 SYN-. , TCP- ( IP-, , dest IP, dest-) 4-, , , - .

(2) Windows SYN- TCP, SYN- TCP. , , , , , , - .

, tshark, wirehark. :

tshark -n -V -x -r Embeded-4-attempts.pcap > Embeded-4-attempts.txt

, , 1 , , 1 , , Windows Vista, , , , SYN 1 , 2 , 3 .. Windows Vista , , .

. , , , , Vista RST- ? , , , , . ACK , , SYN-ACK, . , . TCP , , , TCP , , , Windows.

, . TCP-, , .

+3

, . RST reset . , reset? , reset? , reset ( )? , , Windows, RST?

0

Have you tried connecting to your Vista server from a client running a full OS, such as Windows or Linux, using telnet? On Linux, at least you can specify the TCP port number for connecting to the command line and see if it can connect to your Vista server or not.

One way to check: is there any kind of firewall running on the Vista server that prevents the connection from appearing?

0
source

Source: https://habr.com/ru/post/1771717/


All Articles