Re: Possible a better order to switch connections

On Sun, 2005-10-02 at 19:08 -0700, Karl Hegbloom wrote:
> On Mon, 2005-10-03 at 01:17 +0300, Paul Ionescu wrote:
> > > The "downtime" is brief, and the new interface cannot have the same IP as
> > > the old one if you don't bring the old one down first.
> > 
> > The "downtime" is sometime not so brief, and why not avoid the downtime if
> > possible ?
> But when I pull out the wire jack from eth0, I mean it.  There's no
> point in having an IP there anyhow.  The thing is that applications
> don't know I've pulled the plug.
> > Besides, one can have the same IP on multiple interfaces if needed.
> > You can test it.
> I've never tried that and it had not occurred to me.  How does the
> routing deal with that?  It seems like what you'd want is for the
> routing to send anything new out over the new interface...  but that's
> not up right away.

I should think longer before I send...  It occurs to me that if there
are two interfaces with the same IP, then routing should choose the one
that has a link beat.  So if eth0 has no wire, and ath0 has a
connection, then the packets should be routed over ath0.

It seems like two interfaces with the same IP might confuse the ARP
mechanism somewhat.  Perhaps the first ARP table entry is always chosen,
or perhaps they are sent round-robin, or maybe load-balancing can be
done?  I really need to read more about that all.

> Hmmm... so if I pull the wire jack, and the interface stays up logically
> until the WIFI link is established, what happens to packets and
> connections that existed at the point I pulled the wire out?  They
> probably block, but if the new interface is given the old IP, will they
> get sent on that, or lost, or what?

I wonder if it's possible to trick DHCP into handing out the same IP for
the WIFI as for the eth0 by setting the WIFI MAC to the same id as that
of the eth0?  Is that a good idea or bad one?  Can Linux do that?  That
might work better than assigning the old IP to the new interface in that
it's a little bit simpler?  Maybe not.

I'm starting to like the idea of bringing up the new interface before
bringing down the old one, if that provides the possibility that open
connections can stay open across the interface change.  It's obvious to
me that, barring the presence of some kind of mobile-ip or a VPN that
can change physical interface association, the hand-over can only happen
when the network and netmask of the new interface is the same as that of
the old.

If we're using DHCP, that information is not knowable until right about
the time that the new interface is coming alive.  It's at that point
that a decision can be made as to whether or not to move the old IP over
to an IP alias on the new interface.  That, combined with DBUS
signalling of NetworkManager aware applications, seems like a pretty
nifty solution.

When a new program starts up, what IP does it bind on for outgoing
connections?  I suppose that it must by default be given the primary IP
of the gateway interface?  Can NetworkManager detect when there are no
longer any connections using the old IP, so it can remove the IP alias?
It is probably possible, given that SNMP can obtain that information.

Karl Hegbloom <hegbloom pdx edu>

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]