Subject: [MOBILE-IP] Changing default routers

From: Martin McSweeney <[email-masked]>
Date: Tue, 5 Dec 2000 20:49:13 -0500

I have a problem i've been staring at for awhile, so maybe someone here
can help me:
I have an implementation of Mobile IP for Linux.  Consider the following
scenerio:
        My mobile is connected to a FA, and the IP routing table on the
mobile looks:
        24.226.68.1 dev eth0  scope link
        127.0.0.0/8 dev lo  scope link
        default via 24.226.68.1 dev eth0
where 24.226.68.1 is the FA.
The ARP cache looks like:
        24.226.68.1 dev eth0 lladdr 00:90:ab:14:14:70 nud reachable

Now, my mobile switches link-layer connectivity, and I decide to use a
different foreign agent (because of a new advertisement).  The foreign
agent has an IP address of 24.226.90.1.
Now, when I receive the new agent advertisement, and I decide to switch
foreign agents, I *immediately* delete the arp cache entry for the old
foreign agent and change my default route for the new foreign agent.
Therefore, the IP routing table and my arp cache do not contain any
entries for the old foreign agent (it does not show up via "ip" command).
The new entries look like:
        24.226.90.1 dev eth0  scope link
        127.0.0.0/8 dev lo  scope link
        default via 24.226.90.1 dev eth0
The ARP cache looks like:
        24.226.68.1 dev eth0 lladdr 00:90:ab:14:4c:90 nud reachable

The registration request gets to the foreign agent because IP looks in the
routing table and matches the entry.
BUT, anything that must go via default (ie. there is not a match in the IP
table), the packets contain link-layer addresses of the old foreign agent.
This continues for about 2 seconds, and then suddenly the packets contain
the hardware address of the new foreign agent.  As a result, all my
traffic from the mobile is lost in those 2 seconds.
This leads me to believe that Linux kernels keep a "cache" of the arp
cache, and does not update it until the 2 seconds is up.
RFC 1122 hints at this-- "a reroute timer for detecting dead default
gateways), but I cannot find anything else anywhere on the web that
documents this type of behaviour. And, I cannot find anything in Linux
kernel source.

Can anyone help me understand what is going on????

thanks,
martin
[email-masked]