Re: Detecting host in the local network

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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 -


.



Relevant Pages

  • Re: Network Hardware
    ... LAN With Two Routers" and now wonder whether or not to send this message as ... I was also hoping to use the DLink Router ... have to go through the router to get to the internet on the other subnet. ...
    (microsoft.public.windowsxp.network_web)
  • Re: Detecting host in the local network
    ... reachable using a router ... reachable only using broadcast. ... the same subnet as the host where your program is running OR NOT. ... is decide if the target device is on the same subnet or not. ...
    (microsoft.public.windowsce.embedded)
  • Re: 2 NIC SBS2003R2 LAN/WAN Firewall Router Connection Failure
    ... and the LAN NIC are on the same subnet. ... My WAN NIC and LAN NIC are on separate subnets; ... That's why I asked about static routes, the router table and so on. ... Two Nics, a static IP address, ISA, router ...
    (microsoft.public.windows.server.sbs)
  • Re: How can I join a small cluster of PCs to the main LAN wirelessly
    ... Internet through a Zyxel Prestige wireless router. ... It is also on a 10.4.0.x subnet and the mask ... LAN to the bigger LAN with an access point or something like that? ...
    (alt.internet.wireless)
  • Re: 2 NIC SBS2003R2 LAN/WAN Firewall Router Connection Failure
    ... and the LAN NIC are on the same subnet. ... My WAN NIC and LAN NIC are on separate subnets; ... That's why I asked about static routes, the router table and so on. ... Two Nics, a static IP address, ISA, router ...
    (microsoft.public.windows.server.sbs)