Reverse or inverse ARP from windows/linux - no way (!?!?)

I tried today to figure out a simple way to give users of our new netmca (

formatting link
) to locate its IP address once it gets one via dhcp when there is no internet at the moment (when there is the device posts its IP to our domain and customers can see it using a browser).

Turned out there is nothing like an easy way to do that!

There are some utilities which can be used to ping the entire subnet; then list the arp cache, locate the known MAC address and see its IP. But these are far from something one would want to ask customers to deal with, long lists, necessity to search etc. , heck, it will generate more calls to me than if I do it for them every time.

In an attempt to solve it I spent 10 minutes adding RARP reply to our device Ethernet related stuff - so it would reply to an ARP inquiry #3 by sending its IP address (it only has one); and then spent perhaps 3 hours googling, moogling, you name it, searching for some piece of code to do that at the wintel side. Even rebooted the wintel laptop to ubuntu to try it out from there (thought arp -r or something would just work), oh no. No way. Spent perhaps half an hour of moogling for linux rarp, same thing.

How on Earth is that possible?! I can understand how many things are retarded as one would expect them to be on a x86 based thing, but this is too simple even for the x86 world.

Any ideas? I have not faced the issue in real life yet (users tend to have internet) but this is bound to happen and I am looking for some solution.

Dimiter

------------------------------------------------------ Dimiter Popoff Transgalactic Instruments

formatting link

------------------------------------------------------

formatting link

Reply to
Didi
Loading thread data ...

There are, actually, a lot of ways.

In the Windows world, NMB provides a naming service that maps local host names to IP addresses. If the computers are set up with NetBIOS over TCP/IP and you know the host name, you can get the IP address easily. On Windows, 'gethostbyname' will use the local browse table.

Apple's Bonjour protocol also does this. You can make your service a zeroconf advertised service. This technology uses multicast DNS.

You can also use your own multicast or broadcast based location service. A server running your software listens on a UDP broadcast/ multicast port for service discovery requests. A client can then send a service request and wait for the server to reply. I don't recommend doing periodic service availability broadcasts for your custom protocol unless there's a real need.

Another solution is dynamic DNS. Most operating systems support the ability to register their dynamically-assigned IP addresses in a dDNS server. Most platforms provide servers with dDNS capability as well.

And, of course, you can just punt on this. Simply state "You need the IP address of the server to access it. Either configure it statically or arrange for it put it someplace you can get it." (This is what pretty much every server already does.)

There are also all kinds of tricks you can do. For example, you can run a local proxy and use a fixed IP address and port (say

127.1.2.3:8000 or something like that). The proxy binds to that IP and port and forward requests to the server's current IP addresses, determining it using any of the above methods.

Is the client running special client software? Or do you need the IP address to enter into a browser or something like that?

DS

Reply to
David Schwartz

Well yes but many of the customers have no clue beyond basic browser usage. They will have network support etc. and call them but I want to prevent the initial frustration they will face when they don't know how to connect to the device.

It comes with a fixed fallback IP address which they can subsequently change (I ship it with 192.168.100.last MAC address byte - not sure why for any part of it, did not give it a long thought) - but they have to set a static IP address on the windows system in most cases to be able to access that. In fact they do and some have reported success, but others would not even dare to try it out.

That's too complex... If they can do that they will likely be able to figure out the IP address the device has, loop ping/ do arp -a or look into the router tables and see what IP it gave to this MAC etc.

Pretty much the latter, although usually it is not a browser but an RFB (VNC) client. If only there were a command line in the MSDOS window like arp -r which would then do inverse ARP and list the result I guess I would be fine but...

Dimiter

------------------------------------------------------ Dimiter Popoff Transgalactic Instruments

formatting link

------------------------------------------------------

formatting link

Original message:

formatting link

Reply to
Didi

In comp.protocols.tcp-ip Didi wrote: (snip)

It seems unlikely that RARP will be useful. RARP is from the days before BOOTP, from which DHCP was derived. RARP was, at least, used for diskless Sun systems to find their IP address.

The Sun boot ROM would use RARP to find its IP address, then tftp to load the rest of the boot code. The first thing the second level boot code does is RARP to find its address. Then IP based bootparamd to find the rest of the data it needed to boot, such as the address of its NFS server, and name of the root file system.

These days, everyone just used DHCP to get an IP address, either dynamically or statically assigned.

-- glen

Reply to
glen herrmannsfeldt

Here's an idea:

formatting link

That will solve the dynamic (DHCP assigned) IP address to a DNS entry that the world can resolve.

--
Paul Hovnanian     mailto:Paul@Hovnanian.com
------------------------------------------------------------------
 Click to see the full signature
Reply to
Paul Hovnanian P.E.

You want to sell a physical device that 'just works'. You want it to connect to a LAN, get its IP by DHCP, and then you want the user to have some easy way to access the device's built in web server without having to install or run any special software.

Is that an accurate description of the scenario?

DS

Reply to
David Schwartz

Well, you could just install a copy of NMAP on the user's computer. :-)

More seriously, the usual technique is to supply a small program that gets the list of interfaces from the OS, and then does a scan from there.

On Windows, the GetAdaptersInfo() function will quickly get you a list of all the attached subnets. Then just do something simple to detect your device - if you can have it respond to a UDP port query, for example, just scan all those IP addresses for that port (QOTD/UDP is great for that - just have the quote be "I'm a Widget9000, serial #1234"*). A smidge more work would be to do it with broadcasts, which should work for anyone on a typical Ethernet network, although can have some quirks on less standard connections.

You *could* do that with TCP, but the lengthy timeouts will make that rather more painful. With UDP, you can just have a bound/listening socket, and pump the queries out (you should probably throttle that to no more than a few hundred per second, just to be a nice guy).

A similar approach is possible on *nix. On either system you could also get the same information from shelling out to ipconfig or ifconfig, as appropriate, and then parsing the output.

If your device supports SNMP, you can use that, although your query program then gets to process ASN.1, which is always a joy.

In any case, you could wrap that in an HTML page or two (all of which would be stored on the user=92s machine). Use Javascript to actually run your scanner program (prompt the user to respond =93OK=94 to the security message), and have the result be a list of links to candidate devices.

*Just don=92t use that exact string =96 there=92s at least one device in th= e world that already uses that exact string (well, almost =96 the above =939000=94 and =931234=94 have been changed to protect the excessively lite= ral- minded). I wrote the spec for a client, they passed it on to their offshore development team, a year later I=92m looking at the code, and I notice that string embedded in the code =96 sure enough, that=92s what the device sends=85 Where=92s that rolling-eyes-smiley when you need it?
Reply to
robertwessel2

Yes. And this works fine if the customer has internet, but I know I won't be lucky all the time...(so far so good, though :-) ).

Dimiter

------------------------------------------------------ Dimiter Popoff Transgalactic Instruments

formatting link

------------------------------------------------------

formatting link

Reply to
Didi

In comp.protocols.tcp-ip Didi wrote: (snip)

Internet or not, most have DHCP, but not all. Many will want any such devices statically addressed.

If the device has non-volatile memory (usually flash) then it can store its IP address. DHCP came when diskless machines had no non-volatile memory other than factory configured ROMs. (One with the ethernet MAC address in them, another with the boot code.

If not, then you can require DHCP. Many DHCP servers allow one to configure static assignments based on ethernet MAC address.

If the DHCP server has a log file, then it is easy to find the recently assigned address. Otherwise, a ping to the broadcast address for the subnet will find some, but not all, devices. (They will get ARP entries if they reply to the ping.)

If the device has an LCD or other display, then you can have a way to find the IP address through the display, and configure any stored addresses.

-- glen

Reply to
glen herrmannsfeldt

Well yes, but the default state as I ship it is with dhcp on (attempted) and if it times out fallback to a (re)programmable fixed IP address. Once they gain VNC access to the device they can switch dhcp off etc. from a menu and set a static address, I have no issues with that case.

I know, but this was quite some time ago :-). Now this device ships with a HDD inside, has an EEPROM, runs a fullblown DPS and "only" needs tcp/ip access to have a monitor, keyboard and mouse. In fact I also offer it without a HDD - the whole DPS + application software fits in a 2M ROM (most of it being a ROM "disk"), flash actually. To repost the link to the device page,

formatting link
.

I recently had such an encounter. Wanted to be able to remotely access the device behind a router and asked the network people on that site to forward the port of interest. They said it would take a static IP to do that; I reconsidered and made the device initiate the connection to my support VNC client which now I run in passive (listening) mode. Just made the device attempt it every 20 seconds or so - the user being able to turn that on/off.

Well if it had such a display it could just display its IP address :-). But it has not and technically there is no need for one. Just a tiny windows utility which will send a RARP inquiry to a MAC address and list the result would do in an internet-less environment; a browser is enough already if there is internet.

Dimiter

------------------------------------------------------ Dimiter Popoff Transgalactic Instruments

formatting link

------------------------------------------------------

formatting link

Original message:

formatting link

Reply to
Didi

Op Thu, 25 Mar 2010 22:54:42 +0100 schreef Didi :

Sending a UDP echo (port 7) to a broadcast address and subsequently receiving information about all of the connected netmca's, is not easy? A Java applet could do it.

--
Gemaakt met Opera's revolutionaire e-mailprogramma:  
http://www.opera.com/mail/
 Click to see the full signature
Reply to
Boudewijn Dijkstra

OK, to be clear:

- device uses DHCP to acquire an IP from server (somewhere);

- user uses this IP to access web server within device; BUT

- device has no way of conveying that IP to the user.

Presumably, user's aren't smart enough to configure DHCP server to assign a *known* address to the device?

BOOTPd is not available on the server (same issue)?

Can your device register a name with a DynDNS service?

Assuming you are dealing with Windows users, can you broadcast a name that folks could access? E.g., DimiterXXXX where XXXX is related to the device's MAC in some obvious way?

(i.e., folks browse the network and then connect to the "obvious" host that shows up)

Or, is my initial assumption incorrect? :<

Reply to
D Yuniskis

That is what I was going to suggest. Just regularly send your aquired address via a UDP broadcast packet (say once a second), the bandwidth that would use is very low.

There is another way, you can actually send arbitrary data in a DHCP_REQUEST packet. This could contain info about which device type is attempting to gain an address, and the server could log which addresses have been assigned to those types. No need for MAC lookups and the like.

Mark

Reply to
markp

=A0A =A0

Well "easy" implies no necessity to program the alien system (windows). But I may look into the java option, I may have to do it this way.

But I can see mass programming has gone higher level than practical. Clearly it is a hard thing to do for utility programmers, otherwise there would be some ARP variety tools out there.

Dimiter

Reply to
Didi

Yes, although usually a VNC server is accessed rather than a webserver. But there is a small webserver as well, part of the functionality is accessible via http. And yes, if there is no internet the device cannot access its (configurable) home domain to post its IP address there for user visibility and it has no other means to do that at the moment.

It is not about them being smart enough, many of them just won't be bothered, have never dealt with that sort of thing etc.

I could do some of these, sure. Have not implemented any dyndns so far, just the normal DNS thing I needed for the stack, but it can't be a lot. May be some way out. Although if it is not widely deployed I will still be facing the same issue on many locations.

Well that's what I tried today at a customer and it worked. Without having a name for my netMCA; their network guy had installed there an "Angry IP scanner" (or similar name) which pinged the subnet in a loop and listed 6-7 responders; those with names were obvious (carried the names of people around the lab) and the two without the names were also obvious, one was the gateway and the other was the netmca. Even if not obvious if there are just a few hosts they can find out which is which by trial and error :-).

So may be I don't have such a huge issue after all, I'll see how it works out over time before rushing into it. That's the strategy for now, at least, before someone screams over the phone "can't see the netmca"...

Dimiter

------------------------------------------------------ Dimiter Popoff Transgalactic Instruments

formatting link

------------------------------------------------------

formatting link

Reply to
Didi

In comp.protocols.tcp-ip Didi wrote: (snip)

Yesterday, not long after reading this, I was reading about a device that offers RARP, ARP, BOOTP, and DHCP as ways of assigning it an IP address.

Looking at the list, I didn't see how they would do it with ARP, but...

(This was suggested for Windows 98.)

arp -s (desired IP address) (device MAC address) ping (desired IP address)

The device is designed such that when no IP address is assigned that it looks for such ICMP packets. They could only arrive from hosts configured with such static ARP entries. Once an address is assigned (this way, or any other) the device ignores such.

That avoids the problem of no RARP, BOOTP, or DHCP on W98.

-- glen

Reply to
glen herrmannsfeldt

t

Please don't do that. Instead, listen on a UDP broadcast port for a UDP broadcast query. You can reply to that query either broadcast or unicast (just to the querier).

DS

Reply to
David Schwartz

Of course, had a bit of a mind freeze there. That's a much more sensible way of doing it. You still have the question of how often to update the info because the DHCP server could potentially re-allocate addresses, but with your enquiry approach an update could be done on demand when needed.

Mark.

Reply to
markp

Isn't that what he's referring to in the parentheses? He's trying to find a way to do it when there's no DNS server to update.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
 Click to see the full signature
Reply to
Barry Margolin

I think I got to the bottom of it - why this is impossible under windows, that is. I had posted the same question in a local (Bulgarian) forum, and today a guy replied and posted this pointer:

formatting link

Turns out this is just not doable under windows without defeating the system somehow... hence no such utility. He says he needed the same thing and wrote himself a GNU/Linux utility so apparently it is doable there; but I have not located such a utility in my half hours search (nor do I need it particularly, most if not all customers run windows and if someone is running linux chances are he will figure something out without my assistance. Here is the topic in the forum (Bulgarian/Cyrillic, most of you will see just funny characters :-) ):

formatting link

Dimiter

------------------------------------------------------ Dimiter Popoff Transgalactic Instruments

formatting link

------------------------------------------------------

formatting link

Reply to
Didi

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.