Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

UDP Broadcast From a Dual NIC Computer

188 views
Skip to first unread message

Bruce Vander Werf

unread,
Mar 18, 2000, 3:00:00 AM3/18/00
to
I have a "client" application running on an NT computer. This "client"
queries the network for "server" applications, which are also running
on NT computers. To query the network, I am using a UDP broadcast
(255.255.255.255), to which the "servers" respond back to the
"client".

This works great when the "client" is running on a single NIC machine.
When running on a dual NIC machine, this broadcast generates a Winsock
10065 (no route to host) on all the "server" machines.
I am theorizing that the "server" machines are trying to respond back
to the other NIC on the "client", which is on a a completely different
LAN, and as such is unreachable.

Can anyone shed any light on what is going on here? How can I avoid
this?

Bruce Vander Werf
bru...@hotmail.com


Francois PIETTE

unread,
Mar 19, 2000, 3:00:00 AM3/19/00
to
> This works great when the "client" is running on a single NIC machine.
> When running on a dual NIC machine, this broadcast generates a Winsock
> 10065 (no route to host) on all the "server" machines.

Maybe you bind local port for your socket to the wrong nic ?

--
francoi...@swing.be
The author for the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.rtfm.be/fpiette/indexuk.htm

Bruce Vander Werf <bru...@hotmail.com> a écrit dans le message :
38d3ec4e...@forums.inprise.com...

Bruce Vander Werf

unread,
Mar 19, 2000, 3:00:00 AM3/19/00
to
On Sun, 19 Mar 2000 14:35:23 +0100, "Francois PIETTE"
<francoi...@swing.be> wrote:

>> This works great when the "client" is running on a single NIC machine.
>> When running on a dual NIC machine, this broadcast generates a Winsock
>> 10065 (no route to host) on all the "server" machines.
>
>Maybe you bind local port for your socket to the wrong nic ?

Well, I am calling bind on the receiving computer, which is a single
NIC computer. The UDP broadcast is being sent from the dual NIC
computer. I am not calling bind on that computer, just sendto. The "No
route to host" error appears on the receiving computer when I send the
broadcast.

Bruce Vander Werf
bru...@hotmail.com

Stephane Grobety

unread,
Mar 20, 2000, 3:00:00 AM3/20/00
to
>Well, I am calling bind on the receiving computer, which is a single
>NIC computer.

It doesn't change anything: In order to put a socket in "listen" mode, you
have to bind it to an IP first. You could use 0.0.0.0 as address (Bind to
all the IPs of the local host) or a specific IP.


>The UDP broadcast is being sent from the dual NIC
>computer. I am not calling bind on that computer, just sendto. The "No
>route to host" error appears on the receiving computer when I send the
>broadcast.

How have you setup the dual-NIC computer ? Does it use the "Route IP
packet" option ?

I think that your problem is not that your server isn't receiving the
broadcast but rather that it tries to send it's answer through the wrong
interface, hence to the wrong network segment.

Anyway, try to explicitely bind your socket to the proper interface instead
of binding it to all interfaces.

Good luck,
Stephane


Bruce Vander Werf

unread,
Mar 20, 2000, 3:00:00 AM3/20/00
to

I'm not quite sure you are understanding the scenario:

Computer A is sending the UDP broadcast (sendto 255.255.255.255).
Computer A has the 2 NICs.

Computer B,C, and D have one NIC, and are listening for the broadcast
(have called bind).

Computer A sends the broadcast, which immediately generates a winsock
10065 error (No route to host) on computers B,C,D.

On 20 Mar 2000 06:35:09 -0800, gro...@fulgan.com (Stephane Grobety)
wrote:

Bruce Vander Werf
bru...@hotmail.com

Stephane Grobety

unread,
Mar 21, 2000, 3:00:00 AM3/21/00
to
On 20 Mar 2000, bru...@hotmail.com (Bruce Vander Werf) wrote in
<38d683dc...@forums.inprise.com>:

>
>I'm not quite sure you are understanding the scenario:
>
>Computer A is sending the UDP broadcast (sendto 255.255.255.255).
>Computer A has the 2 NICs.
>
>Computer B,C, and D have one NIC, and are listening for the broadcast
>(have called bind).
>
>Computer A sends the broadcast, which immediately generates a winsock
>10065 error (No route to host) on computers B,C,D.

There is something more to it than what you said: the B,C and D computer
will need to try to respond to that request in order to produce that error.

How is the multihomed machine configured and what are the B, and D client
supposed to respond to the broadcast ?

Try using a packet sniffer (use the network monitor that comes with NT if
you don't have one) to examine the dialog between the various machines and
see if the multi-homed one isn't broadcasting with an invalid return
address.

Good luck,
Stephane

Bruce Vander Werf

unread,
Mar 21, 2000, 3:00:00 AM3/21/00
to

On 21 Mar 2000 01:52:19 -0800, gro...@fulgan.com (Stephane Grobety)
wrote:

>Try using a packet sniffer (use the network monitor that comes with NT if
>you don't have one) to examine the dialog between the various machines and
>see if the multi-homed one isn't broadcasting with an invalid return
>address.

It is, that is my whole point. The Source IP of the broadcast packet
is the address of the other NIC. There is no route from the receiving
computer to that NIC, hence the error.

My question is what can be done about this? Do I bind the sending
computer to a specific NIC? Are their configuration parameters that
can be set in NT?

Thanks for your reply.

Bruce Vander Werf
bru...@hotmail.com

Stephane Grobety

unread,
Mar 21, 2000, 3:00:00 AM3/21/00
to
>It is, that is my whole point. The Source IP of the broadcast packet
>is the address of the other NIC. There is no route from the receiving
>computer to that NIC, hence the error.


Then you have an invalid configuration on your dual-NIC server in your
TCP/IP configuration...

For your information, that is called a "spoofed" packet: on that got a
reply address that is different from the machine that sent it.

This kind of error cannot happend in an UDP broadcast (or your TCP/IP stack
has a realy serious bug), you need to have a host-to-host packet for that
to happend.


>My question is what can be done about this? Do I bind the sending
>computer to a specific NIC?

This will solve the effect, yes, but not the cause. Check the multi-home
machine configuration and check your client program.

>Are their configuration parameters that
>can be set in NT?

It depends on how your server is configured.

Good luck,
Stephane

0 new messages