Page 1 of 1

IP range vs Port Numbers (weird)

Posted: Mon Oct 29, 2018 11:07 am
by lslarry86
Does anyone reading this know about IP range dependencies on TCP socket behavior? It seems like the kind of thing that shouldn't happen.

I'm working with MOD54417 (dual ethernet). NB IDE is 2.8.2. My customer wants to connect as a TCP client to eth1, on port 10033. They use two address ranges, 192.192.192.xxx and 192.168.198.xxx. Their client runs on Linux but uses some NetBios services, which I have enabled by a call to NetbiosEnableNameService("NAME", false); calling with true or false does not change the behavior.

The problem is that the setup works at 192.192.192.xxx and fails at the other address range, all else equal! Failure usually involves a failure to connect. Sometimes we get a TCP connection but cannot transfer data. These address ranges all fail:
192.1.192.xxx
192.192.1.xxx
10.0.1.xxx
10.10.10.xxx

The behavior is tied to the customer's software. The embedded web page always works. All my sockets are started with INADDR_ANY. Command line telnet usually works, but sometimes I get a "fake" connection that will not transfer data. I am using swap cables to both eth0 and eth1. eth0 is plugged into my laptop ethernet port. eth1 is plugged into a USB-thernet adapter. This same pattern occurs on 2 different PCs at the customer site over HP network switches.

Here is Wireshark showing the failure at 10.10.10.xxx
Image

And the success at 192.192.192.xxx
Image

Re: IP range vs Port Numbers (weird)

Posted: Mon Oct 29, 2018 12:18 pm
by lslarry86
Followup: it turns out that my customer's code, written for Winsock, is the source of the problem.

Code: Select all

			hostInfo = gethostbyaddr((char *)&addr,4,AF_INET); // NULL at 168!
			if ( hostInfo==NULL)
				return(42);
hostinfo is always NULL - UNLESS the whole system is set up for 192.192.192.xxx! Then it works.

So it's not a Netburner question anymore, but I still wonder if anyone has seen anything like this.

Thanks!