TCP/UDP demo on Windows Simulator

Hi all,

I am trying to run the FreeRTOS_Plus_TCP_Minimal_Windows_Simulator example but have been unsuccessful. I have read and followed the instructions in link1 and link2 but still cannot get the demo running. I am afraid I am doing something wrong with the addresses or have a gap in my understanding.

To narrow done my situation, I have only mainCREATE_SIMPLE_UDP_CLIENT_SERVER_TASKS set to 1 in main.c, and trying to establish a UDP connection between the client task and a server. I built and run the demo but on the prompt I only see the detected interfaces and the addresses for IP, Subnet mask, Gateway, and DNS Server.

Nothing is printed after that. Additionally, I have set ipconfigUSE_DHCP to 0 and used hard coded values.

I would like some help on how to approach the solution to this problem and get the demo running. I have set a server running on a Linux machine (with netcat, listening for UDP connections) on the same network, is this approach correct for the demo?

Are you confident configNETWORK_INTERFACE_TO_USE is set to a wired network?

If you network has a DHCP server you could try with configUSE_DHCP, just to see if it obtains a and address from the DHCP server. That would show your were successfully on the network, even if you then wanted to turn DHCP off again.

Another thing to try is setting ipconfigREPLY_TO_INCOMING_PINGS to 1 and see if you are able to ping the machine from your Linux machine.

Finally, ensure to have Wireshark installed so you can see if there is any network traffic from the demo.

Thanks a lot for your reply. To answer the points mentioned:

  • I am selecting the interface labeled as Ethernet adapter Ethernet: when using ipconfig /all.

  • The network I am using does not have a DHCP server, even when I set configUSE_DHCP, the addresses used are the ones I have hard coded.

  • ipconfigREPLY_TO_INCOMING_PINGS is set, I tried pinging the IP that I assign to the FreeRTOS client but it is not reachable from my Linux machine.

  • Using Wireshark, I do not see traffic for the FreeRTOS client assigned IP.
    edit: I see ARP broadcast messages, announcing the IP of the FreeRTOS client IP.

Could I get some guidance on how to troubleshoot further?

If you are seeing the ARP output then it seems the network connection is ok. The ARP is probably in response to your application trying to make a socket connection. What is the address in the ARP message - by which I mean which computer has the address present in the ARP message?

Both sender and target IP addresses, in the ARP packet, are the IP I have given to the FreeRTOS client. I am looking now into why this is happening.

The ARP messages that you see, do they appear every 20 seconds? If so, you’re looking at the so-called gratuitous ARP messages.
You can lower this frequency by defining in your FreeRTOSIPConfig.h:

#define arpGRATUITOUS_ARP_PERIOD  ( pdMS_TO_TICKS( 60000U ) )

or longer.
Is your Linux running on a separate machine?

When I run the WinSim application on my laptop, I can not send pings to it. Also when I send ping from a virtual machine, I can not ping it. That has to do with the network interface which uses the PCAP interface.

1 Like

Thanks for your response, indeed, these are gratuitous ARP messages.

Is your Linux running on a separate machine?

Yes, I am trying to make the demo work by running a server on a separate machine, on the same network.

So, my best choice would be to use the Windows echo server as described here?