[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

Sending UDP data, but......

DanS

3/27/2012 3:09:00 PM

Hello all.

I'm seemingly lost, and looking for direction.

I'd like to do some really low-level UDP stuff.

Actually, this is *exactly* what I'm trying to do.

http://iksdee.net/cc/mikrotik-neighbor...

....but, this is written for QT libraries (and assumingly
Linux), and I was hoping to be able to accomplish this same
task in a Windows programming language, beit some form of VB,
or VC++, or PowerBasic, or whatever I can get it done with.
Ideally, it would be great to wrap this functionality up in a
portable DLL to be used and reused.

While I'm not looking for someone to transpose this for me, I
am hoping someone can suggest a language/environment that will
allow me to do this.

Thanks in advance,

DanS

34 Answers

DanS

3/27/2012 3:46:00 PM

0

It serves me right for asking for help w/o even tryingf this
stuff out myself.

It appears as though I *MAY* easily be able to figure this out
taking each step one at a time and liberal use of Wireshark.



Sorry I bothered the group.







DanS <t.h.i.s.n.t.h.a.t@r.o.a.d.r.u.n.n.e.r.c.o.m> wrote in
news:XnsA0237170CD57Ethisnthatroadrunnern@216.196.97.131:

> Hello all.
>
> I'm seemingly lost, and looking for direction.
>
> I'd like to do some really low-level UDP stuff.
>
> Actually, this is *exactly* what I'm trying to do.
>
> http://iksdee.net/cc/mikrotik-neighbor...
>
> ...but, this is written for QT libraries (and assumingly
> Linux), and I was hoping to be able to accomplish this same
> task in a Windows programming language, beit some form of
> VB, or VC++, or PowerBasic, or whatever I can get it done
> with. Ideally, it would be great to wrap this functionality
> up in a portable DLL to be used and reused.
>
> While I'm not looking for someone to transpose this for me,
> I am hoping someone can suggest a language/environment that
> will allow me to do this.
>
> Thanks in advance,
>
> DanS
>
>

Karl E. Peterson

3/27/2012 11:12:00 PM

0

After serious thinking DanS wrote :
> Sorry I bothered the group.

Nothing clarifies the mind like asking publicly how to do something.
It forces you to think it through enough to formulate the question,
which is often all it takes. <g>

--
..NET: It's About Trust!
http://vfre...


Henning

3/28/2012 12:15:00 AM

0


"Karl E. Peterson" <karl@exmvps.org> skrev i meddelandet
news:jkthfj$8f6$1@dont-email.me...
> After serious thinking DanS wrote :
>> Sorry I bothered the group.
>
> Nothing clarifies the mind like asking publicly how to do something. It
> forces you to think it through enough to formulate the question, which is
> often all it takes. <g>
>
> --
> .NET: It's About Trust!
> http://vfre...
>
>

Been there, done that... ;)
By the way, CSocketMaster is a really good replacement for Winsock.

/Henning


Schmidt

3/28/2012 1:40:00 AM

0

Am 28.03.2012 02:14, schrieb Henning:
> "Karl E. Peterson"<karl@exmvps.org> skrev i meddelandet
> news:jkthfj$8f6$1@dont-email.me...
>> After serious thinking DanS wrote :
>>> Sorry I bothered the group.
>>
>> Nothing clarifies the mind like asking publicly how to do something. It
>> forces you to think it through enough to formulate the question, which is
>> often all it takes.<g>
>
>
> Been there, done that... ;)
> By the way, CSocketMaster is a really good replacement for Winsock.

Although from what I've read regarding at the website
Dan has linked, this seems simple enough to do even
with "normal Winsock.ocx".

Looks like broadcasting a "zero-long" (or 4 empty bytes in
a ByteArray) on the broadcast-IP - which is usually in
the form of ---.---.---.255 using the normal send-command
on the windock-control (in UDP-mode) would be enough
to trigger a response from the devices - which then
comes in over the normal Event... and all the offets
in the incoming bytes-arrays are already described on
the linked page - seems like one could even copy
the Bytes (if the incoming datagram is large enough)
directly over into a properly designed UDT, in one go.

Olaf

DanS

3/28/2012 4:45:00 PM

0

Schmidt <sss@online.de> wrote in
news:jktq4r$fkj$1@dont-email.me:

> Am 28.03.2012 02:14, schrieb Henning:
>> "Karl E. Peterson"<karl@exmvps.org> skrev i meddelandet
>> news:jkthfj$8f6$1@dont-email.me...
>>> After serious thinking DanS wrote :
>>>> Sorry I bothered the group.
>>>
>>> Nothing clarifies the mind like asking publicly how to do
>>> something. It forces you to think it through enough to
>>> formulate the question, which is often all it takes.<g>
>>
>>
>> Been there, done that... ;)
>> By the way, CSocketMaster is a really good replacement for
>> Winsock.
>
> Although from what I've read regarding at the website
> Dan has linked, this seems simple enough to do even
> with "normal Winsock.ocx".
>
> Looks like broadcasting a "zero-long" (or 4 empty bytes in
> a ByteArray) on the broadcast-IP - which is usually in
> the form of ---.---.---.255 using the normal send-command
> on the windock-control (in UDP-mode) would be enough
> to trigger a response from the devices - which then
> comes in over the normal Event... and all the offets
> in the incoming bytes-arrays are already described on
> the linked page - seems like one could even copy
> the Bytes (if the incoming datagram is large enough)
> directly over into a properly designed UDT, in one go.

Oh Olaf, if only it were as easy as that page makes it seem.

My post of "nevermind" happened after re-reading that page,
again, and it looking like this would be fairly easy.

But...there's always a but......

.......while banging off a 4 byte byte array of 0 value, to IP
addy 255.255.255.255 using the Winsock control on port 5678,
is super-simple, and DOES elicit a response, that response is
NOT a UDP IP Packet response. It's an ethernet II frame, that
I can not seem to figure on how to receive.

Wireshark shows me the 4 byte UDP packet I send out, then,
there *is* a UDP response, but it does NOT contain the info
I'm looking for. Mainly, I'm looking for the IP address of the
device that responded.

The 4 byte UDP packet I'm sending.......
http://dl.dropbox.com/u/2694585/1-4Byte0...

The initial UDP response that *doesn't* have the info as
structured in the link I posted.
http://dl.dropbox.com/u/2694585/2-UDPRe...

And then the 'real' response packet that *does* contain the
desired info, but NOT UDP.
http://dl.dropbox.com/u/2694585/3-Eth...

You can see I have the devices IP address highlighted to show
where it is in the structure of the CDP response packet. That
4 byte sequence doens't happen anywhere in the initial UDP
response data, only in the header field as the source IP.

Any and all searching I've done indicates that there's no way
for me to receive this ethernet non-IP data packet, at least
in Windows using VB, with out using some functionality from
WinPCap, either directly, or through a couple activeX wrappers
I've found. Both however, requiring WinPCap to be installed.

Now, I am in posession of two separate utilities that are both
Windows programs, and both are nothing more than standalone
exe files that aren't installed. Both include this discovery
function. I'm sure they're not written in VB, so there must be
some capabilites that can be accessed natively under Windows
to be able to do this w/o having to install WinPCap or another
driver (or something else).

Regards,

DanS








James Tyler

3/28/2012 5:06:00 PM

0

TCP socket will let you know who respond


DanS

3/28/2012 5:12:00 PM

0

"Phil Hunt" <aaa@aaa.com> wrote in news:jkvgdj$l9l$1
@speranza.aioe.org:

> TCP socket will let you know who respond

TCP socket ?

James Tyler

3/28/2012 5:22:00 PM

0

I thought you are working with Winsock, it has UDP or TCP type of socket.



"DanS" <t.h.i.s.n.t.h.a.t@r.o.a.d.r.u.n.n.e.r.c.o.m> wrote in message
news:XnsA02486453855Athisnthatroadrunnern@216.196.97.131...
> "Phil Hunt" <aaa@aaa.com> wrote in news:jkvgdj$l9l$1
> @speranza.aioe.org:
>
>> TCP socket will let you know who respond
>
> TCP socket ?
>


unknown

3/28/2012 5:27:00 PM

0

"DanS" <t.h.i.s.n.t.h.a.t@r.o.a.d.r.u.n.n.e.r.c.o.m> wrote in message
news:XnsA02481B925A5Athisnthatroadrunnern@216.196.97.131...
> Mainly, I'm looking for the IP address of the
> device that responded.

Isn't this shown as the source IP for the UDP packet that you received,
which you can get by RemoteHostIP property?


James Tyler

3/28/2012 5:39:00 PM

0

UDP is by definition connection-less. It is like making an announcemnt over
a PA system; you don't know or care who is listening.


"Farnsworth" <nospam@nospam.com> wrote in message
news:jkvhkl$ocq$1@speranza.aioe.org...
> "DanS" <t.h.i.s.n.t.h.a.t@r.o.a.d.r.u.n.n.e.r.c.o.m> wrote in message
> news:XnsA02481B925A5Athisnthatroadrunnern@216.196.97.131...
>> Mainly, I'm looking for the IP address of the
>> device that responded.
>
> Isn't this shown as the source IP for the UDP packet that you received,
> which you can get by RemoteHostIP property?
>
>