lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] win32 porting contrib: double IP address


From: Joel Cunningham
Subject: Re: [lwip-users] win32 porting contrib: double IP address
Date: Wed, 08 Nov 2017 09:34:39 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0



On 11/08/2017 04:58 AM, Giuseppe Modugno wrote:
Hello lwip users, this is my first post. I hope this is the right mailing list for my question.

I started with lwip, so I downloaded both lwip and lwip-contrib. I was able to compile lwip test application for win32 (mingw compiler). When I launch test application on third adapter interface (in my computer it's a normal Ethernet interface integrated in the motherboard) with 0.0.0.0 ip address, lwip automatically requests and obtains a new IP address (192.168.1.156). Of course, I have a DHCP server running on the network.

The Ethernet interface is already configured in Windows to use DHCP and its "Windows IP address" is 192.168.1.102 (DHCP static assignment).

So I have an Ethernet interface with two IP and MAC addresses. It seems it works, except for one thing. I tested connectivity by running "ping 192.168.1.156" command from a shell on the same computer. No reply! The ARP table is ok (192.168.1.156 is associated to 01.02.03.04.05.06 MAC address). It seems no packets are detected from lwip.
Actually the LwIP winpcap adapter provides its own MAC address, so it's not going to collide with th card's actual address. Grep for LWIP_MAC_ADDR_BASE in lwip-contrib.  You can think of LwIP with winpcap as running a virtual network stack on top of the adapter. The Windows host and physically remote machines on the same local network just think it's another device.


The ping works well if I launch "ping 192.168.1.156" command from *another* computer on the same network.
You're most likely running into a checksum offload problem since you can't contact the LwIP stack from the Windows host, but you CAN from another machine.  The Window's TCP/IP stack is going to use checksum offloading for IPv4/UDP/TCP and during the transmit path, Winpcap will capture them before they go to hardware (where checksum is added).  Then they will fail checksum validation in LwIP and be discarded.

You can verify this easily by opening up wireshark and capturing on the interface.  Wireshark (also using winpcap) will capture the packets at the same point and you can verify the checksum is missing.

If this is the case, you can disable checksum offloading in Windows for TX.


Is there a solution to use my development computer to run lwip TCP/IP stack *and* to simulate an Internet node that wants to connect to it?

I think a solution is to use a virtual machine with a virtual network adapter, but this means to open VMWare Player or Virtual Box... I'd like to avoid.

Joel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]