TCP Handshake fails - client misses SYN+ACK

cchtea wrote on Wednesday, June 26, 2019:

I just successfully configured +tcp on a stm32f303 device using IAR IDE. I’m using a +TCP Multi stack for my 2 ethernet interface. UDP connections works fine both receive and send on both 2 interface and endpoint. So i believe there’s no more problem on the network interface layer.

But when I started testing TCP connections, the handshake fails. I have a test tcp port on 10000 and I used Putty and Packet Sender to test the tcp connections. I tried a telnet demo on port 23 that Hein sent me, but yielded the same results. I attached related files.

Seems like the client somehow doesn’t get the SYN+ACK packet. I have no idea if this is a client side or server side problem. I need some help :frowning:

FreeRTOS Kernel V10.2.1
FreeRTOS+TCP Multi (2019_may_9) (got this version from Hein)

edit: I’ll try making the stack initiate the connection. Previously, i was just initiating the connection from my PC.

Thanks,
Cedric

heinbali01 wrote on Friday, June 28, 2019:

Cedric, Indeed it looks like the SYN+ACK is not understood.

The packets look OK to me.

Have you also tried it with the normal IPv4 library?

Your PCAP file shows checksum errors. In most cases this is a false alarm, it is caused by the so-called checksum offloading.

Just to be sure, can you deactivate all CRC offloading? It’s a property of the driver and they are normally called:

  • IPv4 Checksum Offload
  • UDP checksum Offload (IPv4)
  • UDP checksum Offload (IPv6)
  • TCP checksum Offload (IPv4)
  • TCP checksum Offload (IPv6)

As a network developer I have them switched off all the time.

Also I will forward you the latest version of +TCP /multi by email.

heinbali01 wrote on Thursday, July 04, 2019:

Follow-up: Cedric found that his adapter does not set the checksums as it should: neither the IP-checksum, nor the protocol checksum was correct.

After setting:

    #define ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUM	0
    #define ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM	0

the TCP connections were OK.

Adapters ( EMAC’s ) are much more efficient in calculating checksums than the CPU.