Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Jun 23, 2017 10:38 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Automatically finding a LAN device's IP address
PostPosted: Sat Jan 26, 2013 11:06 am 
Offline

Joined: Tue Jan 16, 2007 3:45 pm
Posts: 17
I have a device on the LAN that gets its IP address using DHCP. I am trying to automatically discover its address.


My solution:

My RB app polls the LAN by stepping through all of the possible IP addresses and then calls a TCP socket connect. With each TCP socket connect it sends out a command to the device waiting for a response.

When my RB app receives the correct response the polling stops.


Results:

The process works perfectly on a Mac.

The process will not work on a PC.


Problem:

I can get it to work on a PC if I only limit the polling to a sequence of ten TCP connect calls. After ten TCP connect calls the PC ignores the remaining calls.

Restarting the RB app allows the ten TCP connect calls again.

I suspect that the PC has some kind of a TCP stack that is overflowing and locking up.


Top
 Profile  
Reply with quote  
 Post subject: Re: Automatically finding a LAN device's IP address
PostPosted: Sat Jan 26, 2013 11:10 am 
Offline
User avatar

Joined: Mon Feb 05, 2007 5:21 pm
Posts: 600
Location: New York, NY
Or some kind of anti-malware software that is preventing that kind of a scan. The device doesn't broadcast itself through Bonjour (ZeroConf)?

_________________
Kem Tekinay
MacTechnologies Consulting
http://www.mactechnologies.com/

Need to develop, test, and refine regular expressions? Try RegExRX.


Top
 Profile  
Reply with quote  
 Post subject: Re: Automatically finding a LAN device's IP address
PostPosted: Sat Jan 26, 2013 1:18 pm 
Offline

Joined: Tue Jan 16, 2007 3:45 pm
Posts: 17
ktekinay wrote:
The device doesn't broadcast itself through Bonjour (ZeroConf)?


No, it's a homemade WIFI device.


Top
 Profile  
Reply with quote  
 Post subject: Re: Automatically finding a LAN device's IP address
PostPosted: Sat Jan 26, 2013 1:38 pm 
Offline
User avatar

Joined: Sun Oct 28, 2012 4:54 am
Posts: 264
Location: Herts, UK
What OS version do you have on the PC and do you have the following registry key

HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Services \Tcpip \Parameters]
EnableConnectionRateLimiting

_________________
Real Studio 2012 R2
SysInfo
BackTrack Linux/BackBox Linux/Debian Lenny/Windows 7/Windows 8/OpenWRT/OpenBSD
& Yes it's me in the Avatar


Top
 Profile  
Reply with quote  
 Post subject: Re: Automatically finding a LAN device's IP address
PostPosted: Sat Jan 26, 2013 5:09 pm 
Offline

Joined: Tue Jan 16, 2007 3:45 pm
Posts: 17
I am running Windows XP and it does not have that registry key.


Top
 Profile  
Reply with quote  
 Post subject: Re: Automatically finding a LAN device's IP address
PostPosted: Sat Jan 26, 2013 5:19 pm 
Offline
User avatar

Joined: Mon Feb 05, 2007 5:21 pm
Posts: 600
Location: New York, NY
Are you reusing the same object on each call, or creating a new one? (I'd recommend the latter.)

Have you tried introducing a delay after the 10th call on the PC?

_________________
Kem Tekinay
MacTechnologies Consulting
http://www.mactechnologies.com/

Need to develop, test, and refine regular expressions? Try RegExRX.


Top
 Profile  
Reply with quote  
 Post subject: Re: Automatically finding a LAN device's IP address
PostPosted: Sun Jan 27, 2013 8:10 am 
Offline
User avatar

Joined: Sun Oct 28, 2012 4:54 am
Posts: 264
Location: Herts, UK
Windows XP imposes a limit of 10 simultaneous incomplete outbound TCP connection attempts so it's all going to be about timing in your application. You can patch tcp to increase the limit and see if that helps

http://www.lvllord.de/?lang=en&url=tools

_________________
Real Studio 2012 R2
SysInfo
BackTrack Linux/BackBox Linux/Debian Lenny/Windows 7/Windows 8/OpenWRT/OpenBSD
& Yes it's me in the Avatar


Top
 Profile  
Reply with quote  
 Post subject: Re: Automatically finding a LAN device's IP address
PostPosted: Sun Jan 27, 2013 10:57 am 
Offline

Joined: Tue Jan 16, 2007 3:45 pm
Posts: 17
p0wn3d wrote:
Windows XP imposes a limit of 10 simultaneous incomplete outbound TCP connection attempts so it's all going to be about timing in your application. You can patch tcp to increase the limit and see if that helps


Many thanks.

I googled "event ID 4226" and read that this event is triggered because of a built-in Windows "security" feature (really a kludge) to keep malicious software from spamming.

The limit is only for incomplete connection attempts (exactly what my RB app is doing). Windows has no limit on completed IP connections.

It makes no sense to me for Windows to have a limit on incomplete connection attempts within a LAN sharing the same subnet.


Top
 Profile  
Reply with quote  
 Post subject: Re: Automatically finding a LAN device's IP address
PostPosted: Sun Jan 27, 2013 3:22 pm 
Offline
User avatar

Joined: Sun Oct 28, 2012 4:54 am
Posts: 264
Location: Herts, UK
Quote:
really a kludge


I agree we developed an application that did a mass poll (TCP connect) to remote CCTV camera's and had the same issue.

But that's Microsoft for yer....

:wink:

_________________
Real Studio 2012 R2
SysInfo
BackTrack Linux/BackBox Linux/Debian Lenny/Windows 7/Windows 8/OpenWRT/OpenBSD
& Yes it's me in the Avatar


Top
 Profile  
Reply with quote  
 Post subject: Re: Automatically finding a LAN device's IP address
PostPosted: Wed Jan 30, 2013 4:37 pm 
Offline
User avatar

Joined: Sat Nov 11, 2006 2:43 pm
Posts: 1221
Location: This poster has left the forums
Maybe a little unorthodox, but how about using a shell prompt and doing the following.

First ping the broadcast address on your subnet
ping 10.12.12.255
then do a
arp -a

based on the returned MAC address you should see your device.

_________________
%Invalidforumsignatureexception% user signature not found


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group