This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TM4C1294NCPDT: lwIP problem with tcp socket on different subnets tiva

Part Number: TM4C1294NCPDT

Tool/software: Code Composer Studio

Hi,

I have an application on tm4c1294 running a tcp server. For both static IP configuration and DHCP it works completely fine on the same subnet. When the client tries to establish socket connection from different subnet it fails. There is no frame with ACK flag in the response to SYN flag. I see that it fails to do the handshake (I use wire shark). I have doubled check the subnet and gateway settings, also if I use DHCP from what I have read in documentation of LWIP library gateway and subnet should be assigned with dynamic IP.

The ICMP frames of ping command reach correctly on both LAN and in the case of different subnets. It suggests that gateway settings should be correct... Is there any smart way to investigate that? Checking if any firewall on  my way blocks?

Thank you.

  • Hi Lukasz,
    I tend to think that this is not a LwIP problem. But if you are in doubt I will suggest you seek support from the LwIP forum. The DHCP client request involves sending broadcasting address to the LAN. If the DHCP server is in the same subnet it will lease the IP address to the client. I think for the DHCP to work across different subnets, you will need to have some type of DHCP relay agents. The DHCP client broadcasts on the local network and the relay agent receives the broadcast and transmits it to one or more DHCP servers using unicast. I'm not a network expert so please also consult with your IT department.
  • Hi Charles,

    Of course I don't claim it is Lwip problem. I seek an advice and expertise to debug the problem.
    You have made a good point. But if I have other devices with DHCP assigned IP they work without additional treatment, once packet arrives to correct subnet router based on broadcasting knows the IPs and MACs of devices in the subnet.


    Lukasz
  • Hi Lukasz,

    EMAC0 supports multiple 802.1Q VLANs when configured, otherwise a (router) is required to make IP connections across different subnets or VLANS. Windows 2008 server and other Microsoft products act as a router when properly configured.

    Cisco routers support IP helper for DCHP clients to connect across VLANS to a DHCP server on a specific VLAN. One can enable multiple VLANS to a NIC if 802.1Q protocol is enabled.
  • Hi,

    Thank you a lot. I will check the data sheet for proper EMAC configuration. Any hints?

    In case of inter VLAN communication or between different subnets of LAN router has to be involved. When server and client are in different LANs I can ping to my server but similarly no acknowledgement of synchronization and it fails. This case with both hosts connected to different gateway points is actually my biggest problem. I wasn’t clear enough.

    Can this be relatated to EMAC configuration? Or more router block?

    Thanks again for discussion.
  • Lukasz Huchel said:
    . When server and client are in different LANs I can ping to my server but similarly no acknowledgement of synchronization and it fails.

    Assuming both network addresses are the same, e.g. (192.168.x.x) ?  That ICMP ping echo response is a broadcast yet if the subnet masks are different that might cause LWIP ARP router issues. As you are aware broadcast typically stop at the router, layer 3. Cisco's EIGRP routing encapsulates IP, seem to recall layer 3 broadcasts are captured via IP encapsulation or at least the endpoint VLANS would return ICMP broadcasts over 802.1Q.

  • Hi BP101,
    Thank you for helping out the post!
  • Hi Charles,

    I actually had hands on years ago setting up a network for Intel 802.1Q trunking on all sever NICS. Was managed by a Cisco Catalyst 6503 gigabit switch, 12 VLANS.
  • Hi,

    I can use ICMP (ping ,trace route) in case of both devices at the same subnet or at completely different network addresses (server in 18.62.x.x, client in 18.111.x.x) . I get the ping response and I can trace the particular hops using trace route command.

    Here is the moment which I cannot explain to myself. When my devices are in one LAN (have the same subnet, same gateway addresses) my application works ok and telnet command allows me to open the port that server is listening at. Now when I try to use my application from different network addresses (server in 18.62.x.x, client in 18.111.x.x) it fails (telnet also fails to open the port where the server is listening to). However, all commands of ICMP protocol can still reach correctly.

    My server is listening for tcp connection at a chosen port from any ip address.

    Can I narrow down potential reasons? Or contact network administrator to make sure my device is correctly registered and can talk to remote locations in different network addresses.

    Thanks a lot for the discussion.
  • Lukasz Huchel said:
    Or contact network administrator to make sure my device is correctly registered and can talk to remote locations in different network addresses.

    That is a must as the system router security may be filtering or even blocking certain ports crossing VLANs.

    One way to find out is try to telnet to the port, if telnet drops connection immediately from the IP destination address you typed in, the port/s is/are likely closed.

  • Hi BP101, Charles,

    Thank you a lot for the discussion. I have benefited from that. The final solution was registering my device. Network administrator created appropriate rule on my default gateway. I can access desired server from a different subnet or gateway. 

    Thanks again.