Re: Bind to specify sending NIC on multi-homed computer
- From: "Eugene Gershnik" <gershnik@xxxxxxxxxxx>
- Date: Wed, 14 Sep 2005 22:46:57 -0700
Koji Ishii wrote:
> Thank you for the reply. I think I have better understanding in this
> area now.
>
>>> * When dev really wants to send packets from a NIC -- in my case, I
>>> want to seach an UPnP device connected to non-default NIC -- it's
>>> really hard to achieve.
>>
>> Yes and no. Technically this is not hard. You just need to change the
>> routing table.
>
> I have done that. But it's harder than you think.
I've done it too and it isn't any harder than any programmatic manipulation
of OS-wide shared resource.
> It's global, so you
> have
> to lock.
You cannot. There is no lock mechanism for routing table so the best you can
do is to subscribe to notification (NotifyRouteChange) and restore your
settings. Also keep in mind that playing with routing tables may interfere
with some VPN connections.
> In my case, the destination is the same multicast address
> (239.255.255.250) so building routing table must be serialized. I can
> serialize within my application, but I just have to pray other apps
> don't do the same thing at the same time.
See above.
> Also, the routing table is
> reset whenever network configuration is changed.
You might want to consider adding a static route.
[...]
> I think OS
> needs to support ability to specify outgoing NIC per socket.
Here we agree.
>> However, I do understand the shortcomings of this. The
>> problem is that Windows lumps two distinct thigs together. One is a
>> "general purpose network card" which is just any kind of adapter
>> that can be used to connect to the network. Another is "special
>> smart [possibly virtual] card-like device" used by a single
>> application for its own purposes. The general purpose cards really
>> should be managed by an admin *not* application and Windows does it
>> right.
>
> I don't agree with this. Take a look at Outlook. You can choose NIC.
> There are cases where *user*, not sys-admin, wants to specify which
> NIC to use per application or per their task.
You misunderstood my using the term "admin". I use it to refer to a generic
concept of "user with enough privileges". It could be an enterprise
sys-admin, but it also can be a local admin or power user.
> You may remember, when
> Internet was not this popular, corp net was not connected to
> Internet. Poeple then connect their PC to corp by Ethernet, and then
> dialup to ISP for their Internet mail. Users clealy understands which
> NIC is connected to where and want to assign their tasks to each.
Small minority of users actually. Most people still thinks the computer case
is called "hard drive" and have no idea what network card is. MS creating of
the "connection" concept was probably invented to deal with this situation.
> If what you say is true, why does Outlook have an option to choose
> NIC? That proves the fact that there are cases where users do want to
> choose the NIC by themselves.
Unless I am missing something there isn't actually an option to choose a
NIC. I see an option to use LAN (which could be many cards like on my
machine now) or various types of dial-up connections.
> You're right in most cases. And you're right in almost all cases in
> server scenario. But there are cases in client scenario where
> outgoing NIC must be able to be overwritten by application.
Well that's more or less what I said. ;-)
--
Eugene
http://www.gershnik.com
.
- References:
- Bind to specify sending NIC on multi-homed computer
- From: Koji Ishii
- Re: Bind to specify sending NIC on multi-homed computer
- From: Eugene Gershnik
- Re: Bind to specify sending NIC on multi-homed computer
- From: Koji Ishii
- Bind to specify sending NIC on multi-homed computer
- Prev by Date: My the client point have a problem.But where don't I take place?
- Next by Date: Re: Connection Properties
- Previous by thread: Re: Bind to specify sending NIC on multi-homed computer
- Next by thread: Re: Bind to specify sending NIC on multi-homed computer
- Index(es):
Relevant Pages
|