From: Barry Margolin on
In article <4BAC2BE3.FAC92EF2(a)Hovnanian.com>,
"Paul Hovnanian P.E." <Paul(a)Hovnanian.com> wrote:

> Didi wrote:
> >
> > I tried today to figure out a simple way to give users of our
> > new netmca ( http://tgi-sci.com/tgi/nmcatb.htm ) 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).
> >
> >
> Here's an idea: http://en.wikipedia.org/wiki/Dynamic_DNS
>
> That will solve the dynamic (DHCP assigned) IP address to a DNS entry
> that the world can resolve.

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(a)alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
From: RockyG on
>On Mar 26, 11:25=A0am, "markp" <map.nos...(a)f2s.com> wrote:
>
>> 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
tha=
>t
>> would use is very low.
>
>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
>
Why not use NBNS? (I think RFC 1001 and 1002)
Essentially you give your device a name such as NETMCA123456 where 123456
are the last 6 digits of the mac address, then listen for a broadcast to
UDP port 137. If the query is for NETMCA123456 then it responds with its IP
address.
This only really works on local subnets.
It is supported natively under windows, so VNC from a windows machine
should work fine.
The way it seems to work is that if windows thinks it is a local address
(not sure how that is determined, maybe no '.'s ) then it broadcasts up to
3 NBNS query packets. The netMAC will respond - job done!
On a simple network you don't need to worry about all the server stuff.

To play around, start up Wireshark monitoring UDP port 137 and try to
connect to another machine on the same subnet using its name. Wireshark
should then capture the NBNS sequence.

---------------------------------------
Posted through http://www.EmbeddedRelated.com
From: Didi on
On Mar 27, 12:35 pm, "RockyG" <RobertGush(a)n_o_s_p_a_m.gmail.com>
wrote:
> >On Mar 26, 11:25=A0am, "markp" <map.nos...(a)f2s.com> wrote:
>
> >> 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
> tha=
> >t
> >> would use is very low.
>
> >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
>
> Why not use NBNS? (I think RFC 1001 and 1002)
> Essentially you give your device a name such as NETMCA123456 where 123456
> are the last 6 digits of the mac address, then listen for a broadcast to
> UDP port 137. If the query is for NETMCA123456 then it responds with its IP
> address.
> This only really works on local subnets.
> It is supported natively under windows, so VNC from a windows machine
> should work fine.
> The way it seems to work is that if windows thinks it is a local address
> (not sure how that is determined, maybe no '.'s ) then it broadcasts up to
> 3 NBNS query packets. The netMAC will respond - job done!
> On a simple network you don't need to worry about all the server stuff.
>
> To play around, start up Wireshark monitoring UDP port 137 and try to
> connect to another machine on the same subnet using its name. Wireshark
> should then capture the NBNS sequence.    
>
> ---------------------------------------        
> Posted throughhttp://www.EmbeddedRelated.com

Thanks! This may well be it, I'll investigate.

Dimiter

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

http://www.tgi-sci.com
------------------------------------------------------
http://www.flickr.com/photos/didi_tgi/sets/72157600228621276/
From: Didi on
On Mar 26, 12:54 am, Didi <d...(a)tgi-sci.com> wrote:
> I tried today to figure out a simple way to give users of our
> new netmca (http://tgi-sci.com/tgi/nmcatb.htm) 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.

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:

http://en.wikipedia.org/wiki/Raw_socket

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 :-) ):
http://mcu-bg.com/mcu_site/viewtopic.php?t=7680

Dimiter

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

http://www.tgi-sci.com
------------------------------------------------------
http://www.flickr.com/photos/didi_tgi/sets/72157600228621276/








>
> 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
>
> http://www.tgi-sci.com
> ------------------------------------------------------http://www.flickr.com/photos/didi_tgi/sets/72157600228621276/

From: markp on

> 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:

> http://en.wikipedia.org/wiki/Raw_socket

Raw sockets is the ability to bypass the encapsulation of the lower level
OS. All you need to do is send a legitimate UDP broadcast 'enquire' packet
and receive uni-cast replies, I can't see why you would want to create your
own raw packets and why you can't just use the OS to encapsulate your data
normally (?)

Mark.