Discussion:
Creating a CAO with Multiple Network Interfaces / Subnets
(too old to reply)
Andy
2009-02-26 16:06:57 UTC
Permalink
I have an application (C#, but I don't think that matters) using the
in which I'm using Activator.CreateInstance (Type, Object[], Object[])
to create a Client Activated Object. It works perfectly when the
client and server are both on machines with only one network interface
enabled and on the same subnet, but I'm working on an upgrade which
will require the client to have two active NICs, and be able to fetch
the remote object from a server on either NIC (or both). I thought
since the third argument to CreateInstance is the URL of the remote
object server, it would be able to determine the appropriate network
interface to use, but the method call throws a
TargetInvocationException after a significant delay (a network error
timeout). I'm running a packet sniffer called EtherPeek, and I can
see that no network traffic is going out on either NIC when the remote
object request is made, so it looks like the framework is just plain
confused, and can't determine which NIC on which to send the request.
(I would expect to at least see the request go out over the network,
and then have a timeout occur when no response was fired back.)

The server publishes the object using SOAP on an HttpChannel,
"useIpAddress" is set to false, and the "machineName" is set to the
Server's IP address. (I had found many suggestions about doing this
to create a CAO through a router to a different subnet - a slightly
different situation than what's going on here.) I can connect to both
networks with no problems, so networking is properly configured. I can
even use my web browser to see the URI, so it is properly published on
the Server.

The opposite setup (one server publishing a remote object on multiple
NICs) is easy and works fine, but I can't get this setup to work at
all. Has anyone ever seen a situation like this before, and if so,
figured out how to convince .NET to send the request out the right
interface?

Thanks much,
Andy
Jono
2009-03-07 00:25:03 UTC
Permalink
Post by Andy
I have an application (C#, but I don't think that matters) using the
in which I'm using Activator.CreateInstance (Type, Object[], Object[])
to create a Client Activated Object. It works perfectly when the
client and server are both on machines with only one network interface
enabled and on the same subnet, but I'm working on an upgrade which
will require the client to have two active NICs, and be able to fetch
the remote object from a server on either NIC (or both).  I thought
since the third argument to CreateInstance is the URL of the remote
object server, it would be able to determine the appropriate network
interface to use, but the method call throws a
TargetInvocationException after a significant delay (a network error
timeout).  I'm running a packet sniffer called EtherPeek, and I can
see that no network traffic is going out on either NIC when the remote
object request is made, so it looks like the framework is just plain
confused, and can't determine which NIC on which to send the request.
(I would expect to at least see the request go out over the network,
and then have a timeout occur when no response was fired back.)
The server publishes the object using SOAP on an HttpChannel,
"useIpAddress" is set to false, and the "machineName" is set to the
Server's IP address.  (I had found many suggestions about doing this
to create a CAO through a router to a different subnet - a slightly
different situation than what's going on here.)  I can connect to both
networks with no problems, so networking is properly configured. I can
even use my web browser to see the URI, so it is properly published on
the Server.
The opposite setup (one server publishing a remote object on multiple
NICs) is easy and works fine, but I can't get this setup to work at
all. Has anyone ever seen a situation like this before, and if so,
figured out how to convince .NET to send the request out the right
interface?
Thanks much,
Andy
Hi Andy,
I think I may have just solved a similar problem. From what I've seen,
getting a Socket to connect via a specific ethernet adapter is pretty
much beyond the scope of the classes in the .NET framework. It's down
to the operating system and the routing table to resolve which segment
of the network the server resides on, and hence which adapter to use.
It's easy to add new routes in both Windows and Linux, although I'm
not sure of how easy it is to do this across a large number of
clients. Hope this helps,
Jonathan

http://chroniclesofnojo.blogspot.com/2009/03/goodput-part-2.html

Loading...