Re: Detecting host in the local network
- From: "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com>
- Date: Thu, 12 Feb 2009 08:41:44 -0700
What do you mean by "connected to the same LAN"? Every device is either on
the same subnet as the host where your program is running OR NOT. There are
only two choices, no more, no less. All you should have to do, as far as I
can see, is decide if the target device is on the same subnet or not.
So, back to what you're actually trying to do...I obviously don't understand
what that is. You have, on each target device, an application which is
monitoring for some broadcast or multicast? And you have a router that is
configured to forward limited broadcasts from the subnet where your source
is located to the other subnets to which it is connected? So, from your
source machine, it seems that you can easily decide if your target machine
is located on the local subnet, in which case you do whatever it is that you
do, or is on some remote subnet, in which case you do something different.
I still don't see what the issue is.
Paul T.
<AndreasSander1@xxxxxxx> wrote in message
news:9dc176ad-575d-4547-a4a7-0caf726ef695@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The question is about devices that cannot be reached at the own IP
subnet (ipaddress/netmask definition) but are connected to the same
LAN. You can have multiple logical IP networks at the same physical
LAN. To send a frame to host at the other IP network you must send to
the limited broadcast address.
So when the target device is at the same LAN, you need the broadcast,
but you will send a unicast to any device behind the router. But for
this decision you need to detect, if the target is connected the
physical LAN.
Andreas
On Feb 11, 7:56 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
no instrument no spam DOT com> wrote:
I don't understand the question. You can ping things on the other side of
a
router, if they're willing to respond to the ping and the router allows
ARP
packets. You have a gateway set up for your network adapter. If the IP
address you specify for any sort of IP traffic is not on your local subnet
(mask you own IP with your subnet mask and mask the target IP with your
subnet mask; if the results are different, the address is not local, so
the
router will be contacted to send the packet to the subnet where the target
IP actually is located)., the router gets it for forwarding.
Paul T.
<AndreasSand...@xxxxxxx> wrote in message
news:6e0a1c7e-dd86-4c11-b02f-7fbc8455a5b7@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The ICMP protocol is based on IP. The other device is in a different
logical network. Shouldn't I get a "host unreachable" error when I
dont twiddle with the routing table?
Andreas
On 11 Feb., 18:27, "Paul G. Tobey [eMVP]" <p space tobey no spam AT no
instrument no spam DOT com> wrote:
You can certainly ping a given IP address or host name. The source for
PING
is in Platform Builder at
\WINCE500\PUBLIC\COMMON\OAK\DRIVERS\NETSAMP\PING.
There's also a library that just does ping, not general ARP. Look at
\WINCE500\PUBLIC\COMMON\OAK\INC\pinglib.h. I've never used the latter,
but
it looks like it should work.
Paul T.
<AndreasSand...@xxxxxxx> wrote in message
news:d81fab83-1b14-4d00-b861-d5ec0db0ccfe@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,
is it possible to detect, if a ethernet device is connected to the
local LAN?
I have a scenario where a Windows CE 5.0 device is connected to a LAN.
There are probably other devices connected to the same physical
network that use a different subnet. I have to decide if the other
device is in the LAN.
Can I access the ARP layer in any way?
The information is required to decided if I should use the limited
broadcast address to send a UDP frame to the other device or a unicast
address that the next gateway will route.
Andreas- Hide quoted text -
- Show quoted text -
.
- Follow-Ups:
- Re: Detecting host in the local network
- From: AndreasSander1
- Re: Detecting host in the local network
- References:
- Detecting host in the local network
- From: AndreasSander1
- Re: Detecting host in the local network
- From: Paul G. Tobey [eMVP]
- Re: Detecting host in the local network
- From: AndreasSander1
- Re: Detecting host in the local network
- From: Paul G. Tobey [eMVP]
- Re: Detecting host in the local network
- From: AndreasSander1
- Detecting host in the local network
- Prev by Date: Re: Need simplest sample Windows CE application ever coded
- Next by Date: Cannot start debug: "No process is on the other end of the pipe"
- Previous by thread: Re: Detecting host in the local network
- Next by thread: Re: Detecting host in the local network
- Index(es):
Relevant Pages
|