No communication with FreeRTOS-Plus-TCP over the FreeRTOS Windows Port

I am trying to get the FreeRTOS-Plus-TCP working with the FreeRTOS Windows port. I have compiled and I am running the application on a Windows computer with the firewall disabled.

Trying the connectivity test suggested in the FreeRTOS demo webpage, I have tried to ping the ip address. I get “destination host unreachable”, whether I ping from a command prompt on the same computer or whether I ping from a different machine.

In Wireshark, I do not see this as an interface to select, so I selected the regular Ethernet adaptor. Even when I ping, I do not see any traffic with the destination which is the ip address of the demo.

I have tried configuring the demo both with DHCP and with a static IP. When configured for DHCP, it displays an ip address which makes sense in the context of the network to which it is connected.

Any ideas on what could be preventing this demo from working, in the context of the FreeRTOS Windows port?

Thank you.

The stack has a configuration option that enables replying to ping requests. Is that set to 1? On my cell phone at the moment, otherwise I would provide a link.

Thank you for the suggestion. I was not aware of that option.

ipconfigREPLY_TO_INCOMING_PINGS is set to 1

When the application runs, it will send logging to a command windows. Can you copy/paste that logging?

This is what I mean:

The following network interfaces are available:

Interface 1 - rpcap://\Device\NPF_{D7F6B490-...}
              (Network adapter 'WAN Miniport (Network Monitor)' on local host)

Interface 2 - rpcap://\Device\NPF_{3654436B-..}
              (Network adapter 'WAN Miniport (IPv6)' on local host)
...

Interface 6 - rpcap://\Device\NPF_{21A5AEFB-..}
              (Network adapter 'Realtek PCIe GBE Family Controller' on local host)

In my case, I have to use the Realtek adapter, and so I define the following in FreeRTOSCOnfig.h:

#define configNETWORK_INTERFACE_TO_USE         6

I just managed to ping the virtual IP address from a command prompt:

H:\uTorrent\AllFolk\metart\txt>ping 192.168.2.127

Pinging 192.168.2.127 with 32 bytes of data:
Reply from 192.168.2.127: bytes=32 time=11ms TTL=64
Reply from 192.168.2.127: bytes=32 time=26ms TTL=64
Reply from 192.168.2.127: bytes=32 time=113ms TTL=64
Reply from 192.168.2.127: bytes=32 time=88ms TTL=64

The responses are very slow because of the PCAP interface. The project only serves as a demonstration of how to use FreeRTOS and +TCP.

Thank you.

Here is the screen output of the demo program (this example is using DHCP. I have tried with a static ip as well):

The following network interfaces are available:

Interface 1 - rpcap://\Device\NPF_{BF71043C-C211-44E7-9917-2087D7414173}
(Network adapter ‘WAN Miniport (Network Monitor)’ on local host)

Interface 2 - rpcap://\Device\NPF_{4DB694B3-ECED-411F-A83F-364816C13F73}
(Network adapter ‘WAN Miniport (IPv6)’ on local host)

Interface 3 - rpcap://\Device\NPF_{3CB64AE1-D855-4749-8765-77C6B61092D6}
(Network adapter ‘WAN Miniport (IP)’ on local host)

Interface 4 - rpcap://\Device\NPF_{1C58D63F-B494-4C7C-A833-0928336ABFE8}
(Network adapter ‘Intel(R) Ethernet Connection I217-LM’ on local host)

Interface 5 - rpcap://\Device\NPF_Loopback
(Network adapter ‘Adapter for loopback traffic capture’ on local host)

Interface 6 - rpcap://\Device\NPF_{C8AD5527-1069-4D88-9EE6-7A906E947907}
(Network adapter ‘TAP-Windows Adapter V9’ on local host)

The interface that will be opened is set by “configNETWORK_INTERFACE_TO_USE”, which
should be defined in FreeRTOSConfig.h
Attempting to open interface number 4.
Successfully opened interface number 4.
0 789 [IP-task] vDHCPProcess: offer 192.168.0.102
vDHCPProcess: offer 192.168.0.102
1 829 [IP-task]

IP Address: 192.168.0.102
Subnet Mask: 255.255.255.0
2 829 [IP-task] Gateway Address: 192.168.0.1
DNS Server Address: 192.168.0.1

This from the command prompt:

Pinging 192.168.0.102 with 32 bytes of data:
Request timed out.
Request timed out.
Reply from 192.168.0.101: Destination host unreachable.
Reply from 192.168.0.101: Destination host unreachable.

Ping statistics for 192.168.0.102:
Packets: Sent = 4, Received = 2, Lost = 2 (50% loss),

C:\Users\User>ping 192.168.0.102

Pinging 192.168.0.102 with 32 bytes of data:
Reply from 192.168.0.101: Destination host unreachable.
Reply from 192.168.0.101: Destination host unreachable.
Reply from 192.168.0.101: Destination host unreachable.
Reply from 192.168.0.101: Destination host unreachable.

Ping statistics for 192.168.0.102:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Here are the results using a static IP:

The following network interfaces are available:

Interface 1 - rpcap://\Device\NPF_{BF71043C-C211-44E7-9917-2087D7414173}
(Network adapter ‘WAN Miniport (Network Monitor)’ on local host)

Interface 2 - rpcap://\Device\NPF_{4DB694B3-ECED-411F-A83F-364816C13F73}
(Network adapter ‘WAN Miniport (IPv6)’ on local host)

Interface 3 - rpcap://\Device\NPF_{3CB64AE1-D855-4749-8765-77C6B61092D6}
(Network adapter ‘WAN Miniport (IP)’ on local host)

Interface 4 - rpcap://\Device\NPF_{1C58D63F-B494-4C7C-A833-0928336ABFE8}
(Network adapter ‘Intel(R) Ethernet Connection I217-LM’ on local host)

Interface 5 - rpcap://\Device\NPF_Loopback
(Network adapter ‘Adapter for loopback traffic capture’ on local host)

Interface 6 - rpcap://\Device\NPF_{C8AD5527-1069-4D88-9EE6-7A906E947907}
(Network adapter ‘TAP-Windows Adapter V9’ on local host)

The interface that will be opened is set by “configNETWORK_INTERFACE_TO_USE”, which
should be defined in FreeRTOSConfig.h
Attempting to open interface number 4.
Successfully opened interface number 4.
0 9 [IP-task]

IP Address: 192.168.0.103
Subnet Mask: 255.255.255.0
1 9 [IP-task] Gateway Address: 192.168.0.1
DNS Server Address: 192.168.0.1

And from the console:

C:\Users\User>ping 192.168.0.103

Pinging 192.168.0.103 with 32 bytes of data:
Request timed out.
Request timed out.
Reply from 192.168.0.101: Destination host unreachable.
Reply from 192.168.0.101: Destination host unreachable.

Ping statistics for 192.168.0.103:
Packets: Sent = 4, Received = 2, Lost = 2 (50% loss),

C:\Users\User>ping 192.168.0.103

Pinging 192.168.0.103 with 32 bytes of data:
Reply from 192.168.0.101: Destination host unreachable.
Reply from 192.168.0.101: Destination host unreachable.
Reply from 192.168.0.101: Destination host unreachable.
Reply from 192.168.0.101: Destination host unreachable.

Ping statistics for 192.168.0.103:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

C:\Users\User>ping 192.168.0.103

Pinging 192.168.0.103 with 32 bytes of data:
Reply from 192.168.0.101: Destination host unreachable.
Reply from 192.168.0.101: Destination host unreachable.
Reply from 192.168.0.101: Destination host unreachable.
Reply from 192.168.0.101: Destination host unreachable.

Ping statistics for 192.168.0.103:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

I would also choose the “Intel(R) Ethernet Connection”.

There seems to be a bit of communication:

0 789 [IP-task] vDHCPProcess: offer 192.168.0.102

and also I see a valid set of parameters:

IP Address: 192.168.0.102
Subnet Mask: 255.255.255.0
Gateway Address: 192.168.0.1
DNS Server Address: 192.168.0.1

Could you try looking with a “network sniffer” like WireShark or tcpdump?
I think that you will see traffic for DHCP and also there will be ARP packets.
If you want you can attach a zipped PCAP file to your post and I will look at it.
Possibly someone has to grant you permission to attach files, we will see.

PS I commented this line in Logging_WinSim.c:

    xLength = snprintf( cPrintString, dlMAX_PRINT_STRING_LENGTH, ...
    /* Remove the following line: */
    //xAfterLineBreak = pdFALSE;

because it kills the logging.

Yes, there is definitely some communication since the demo can get an ip address via DHCP.

I discovered today that, at some point during my experimenting yesterday, I left the demo running in the background when running another copy; I don’t know exactly at what point during my testing this happened. However, I now made sure that I only had the one current (DHCP) copy running, and I looked in Wireshark. I see the ARP and DHCP communication, but, when pinging, I don’t see the demo (currently it is ip address 192.168.0.100) responding. I have attached the Wireshark log.

Wireshark capture.zip (14.8 KB)

Thank you for the PCAP.

I also see UDP messages:

Server received (not zero copy): Message number 0
Server received (not zero copy): Message number 1
Server received (not zero copy): Message number 2
Server received (not zero copy): Message number 3
...

And indeed there is ARP: 192.168.0.102 is looking for 192.168.0.100, possibly because of the ping command.

In packet 940 I see an ICMP packet, from x.x.x.102 to x.x.x.100:

    Protocol: ICMP (1)
    Header Checksum: 0x0000 incorrect, should be 0x50c2
    (may be caused by "IP checksum offload"?)
    [Header checksum status: Bad]
    [Calculated Checksum: 0x50c2]
    Source Address: 192.168.0.102
    Destination Address: 192.168.0.100

I assume that is indeed caused by the fact that IP checksums are offloaded.
To be sure you can check the properties of your network card as show here:

One more question : from what location did you download the WinSim project? I will run it myself and see if it works for me.

Thank you. I did this and I still could not ping.
I see above a suggestion to choose the other Ethernet adaptor. I had previously used that one. The one I am currently using is separate from the company network and its policies, which I thought might have been interfering; this is a router with just this computer connected to it.

I did at one point connect a laptop to the router as well, and try to ping from it, but that was before the change you suggested. I do not have that computer available today.

I got to the project from here.

@Batya Are you able to ping your machine or the simulator from another machine on the same network?

Perhaps your ethernet switch does not have “hairpin” mode enabled, is limiting each port to a single MAC address, or there is some kind of firewall filtering out packets.

Which version of windows/ winpcap / npcap are you using?

Also check if you have any other pcap or tun/tap drivers in use, since they may conflict.