Re: Detecting host in the local network
- From: Andre.Schulz2@xxxxxx
- Date: Thu, 19 Feb 2009 21:12:21 -0800 (PST)
while the first two scenaris r handled by the standard IP routing, the
third isnt. So other guys told you this is not real. But u find that
with any multi homed industrial device. U need a GUI to change the IP
to communicate with unicast. W/o GUI you need other means. Thats the
task of your UDP protocol?
U told the device should anser w/ uni-/broadcast. Make the decision at
the requestor. Send a broadcast request that has a "reply broadcast"
encoded and send the unicast request that has a "reply unicast"
encoded. If u'r device receives only the broadcast it has the decision
in the request w/o any need to detect. In scene a) u will get both
request, u need to identify the duplo request and discard the second.
Andy
On 17 Feb., 16:30, AndreasSand...@xxxxxxx wrote:
What do you mean by "connected to the same LAN"?
I mean that they are connected to the same hub, switch or cable,
depends on topology. The are able to send ethernet frames without
using any router.
So I can find three choices:
a) in the same subnet
b) reachable using a router
c) connected to the same physical network (hub, switch,...) and
reachable only using broadcast.
So, back to what you're actually trying to do.
I have an application on each device, that listen on a UDP socket. It
listens for a packet and should answer. But it cannot distinguish
between a received broadcast and a received unicast, the recvfrom
returns only the sender's address. To answer the packet, it must
decide, if it needs to send a unicast (case a and b) or a broadcast
(case c).
As "superclass" wrote, you need to detect this cases to respond or
wont be able to send the answer.
Andreas
On Feb 12, 4:41 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
no instrument no spam DOT com> wrote:
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.
<AndreasSand...@xxxxxxx> wrote in message
news:9dc176ad-575d-4547-a4a7-0caf726ef695@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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 -- Hide quoted text -
- Show quoted text -- Zitierten Text ausblenden -
- Zitierten Text anzeigen -
.
- 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
- 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: Telnet server Windows CE 6
- Next by Date: Bluetooth via UART is not working
- Previous by thread: Re: Detecting host in the local network
- Next by thread: Re: Detecting host in the local network
- Index(es):
Relevant Pages
|