Linux Mobile IPv6 HOWTO

Lars Strand

<lars (at) unik no>

2003-12-07
Revision History                                                             
Revision 1.0              2003-12-02           Revised by: TMM               
Reviewed by LDP                                                              
Revision 0.7.2            2003-11-26           Revised by: LKS               
A lot of cleanup. Thanks to John Levon levon [at] movementarian.org          
Revision 0.7.1            2003-11-22           Revised by: LKS               
Changed the license from [http://www.gnu.org/copyleft/fdl.html] GFDL to OPL  
due to some GFDL [http://people.debian.org/~srivasta/                        
Position_Statement.xhtml] problems.                                          
Revision 0.7              2003-11-18           Revised by: LKS               
Converted to XML Docbook. Some cleanup.                                      
Revision 0.6              2002-11-07           Revised by: LKS               
Fixed some errors + update. Thanks to Henrik Petander petander (at) tcs hut  
fi.                                                                          
Revision 0.5.1            2003-11-03           Revised by: LKS               
Updated to MIPL relase 1.0 (kernel 2.4.22).                                  
Revision 0.5              2003-08-05           Revised by: LKS               
Initial release.                                                             


  This document describes the software and procedures to set up and use
mobile IPv6 for Linux.

-----------------------------------------------------------------------------
Table of Contents
1. Introduction
    1.1. What is Mobile IP?
    1.2. Why Mobile IP?
    1.3. How does it work?
   
   
2. IPv6
3. Mobile IPv6 for Linux
    3.1. Patching the kernel
    3.2. Userspace tools
    3.3. MIPv6 device node
    3.4. Automatic startup
   
   
4. Test bed
    4.1. Testcase
    4.2. Step-by-step
   
   
5. Doing some tests
    5.1. Pre-test
    5.2. Movement detection
    5.3. ping6
    5.4. Kernel IP routing table
    5.5. Travelling through several foregin LAN's
    5.6. Returning home
    5.7. Real life testing - smooth handover
   
   
6. FAQ
7. Useful Resources
8. Copyright, acknowledgments and miscellaneous
    8.1. Copyright and License
    8.2. Disclaimer
    8.3. How this document was produced
    8.4. Feedback
    8.5. Acknowledgments
   
   

1. Introduction

  This document describes the software and procedures to set up and use
mobile IPv6 for Linux. The [http://www.ietf.org/internet-drafts/
draft-ietf-mobileip-ipv6-24.txt]   "Mobility Support in IPv6" draft answers
the what and why of mobile IP:
-----------------------------------------------------------------------------

1.1. What is Mobile IP?

  "Each mobile node is always identified by its home address, regardless of
its current point of attachment to the Internet. While situated away from its
home, a mobile node is also associated with a care-of address, which provides
information about the mobile node's current location. IPv6 packets addressed
to a mobile node's home address are transparently routed to its care-of
address via the mobile nodes Home Agent (HA). The protocol enables IPv6 nodes
to cache the binding of a mobile node's home address with its care-of
address, and then to send any packets destined for the mobile node directly
to it at this care-of address." --- draft-ietf-mipv6-24, page 1-2.
-----------------------------------------------------------------------------

1.2. Why Mobile IP?

  "Without specific support for mobility in IPv6, packets destined to a
mobile node (host or router) would not be able to reach it while the mobile
node is away from its home link (the link on which its home IPv6 subnet
prefix is in use), since routing is based on the subnet prefix in a packet's
destination IP address. In order to continue communication in spite of its
movement, a mobile node could change its IP address each time it moves to a
new link, but the mobile node would then not be able to maintain transport
and higher-layer connections when it changes location. Mobility support in
IPv6 is particularly important, as mobile computers are likely to account for
a majority or at least a substantial fraction of the population of the
Internet during the lifetime of IPv6." --- draft-ietf-mipv6-24, page 6.

  For all the details, read the [http://www.ietf.org/internet-drafts/
draft-ietf-mobileip-ipv6-24.txt]   "Mobility Support in IPv6" draft
-----------------------------------------------------------------------------

1.3. How does it work?

[Mobile-IP]

Mobile IP

 

 1. The Mobile Node (MN) travels to a foreign network and gets a new
    care-of-address.
   
 2. The MN performs a binding update to its Home Agent (HA) (the new
    care-of-address gets registered at HA). HA sends a binding
    acknowledgement to MN.
   
 3. A Correspondent Node (CN) wants to contact the MN. The HA intercepts
    packets destined to the MN.
   
 4. The HA then tunnels all packets to the MN from the CN using MN's
    care-of-address.
   
 5. When the MN answers the CN, it may use its current care-of-address (and
    perform a binding to the CN) and communicate with the CN directly
    (optimized routing) or it can tunnel all its packets through the HA.
   

See figure "Mobile IP" for an explanation.
-----------------------------------------------------------------------------

2. IPv6

IP version 6 (IPv6) is a new version of the Internet Protocol, designed as
the successor to IP version 4 (IPv4) [http://www.ietf.org/rfc/rfc791.txt]
[RFC-791]. The changes from IPv4 to IPv6 fall primarily into the following
categories:

*Expanded addressing capabilities
   
*Header format simplification
   
*Improved support for extensions and options
   
*Flow labeling capability
   
*Authentication and privacy capabilities
   

You should have basic knowledge of IPv6 stateless auto-configuring to fully
understand how 'mobile IPv6' (MIPv6) works. You can read up on IPv6 Stateless
Address Autoconfiguration in [http://www.ietf.org/rfc/rfc2462.txt] [RFC2462].

For more information on IPv6 in general, visit the IETF's IPv6 Working Group.
-----------------------------------------------------------------------------

3. Mobile IPv6 for Linux

There are currently two Mobile IPv6 Linux implementations available. The
Lancaster University in the UK has the oldest(?) implementation ([http://
www.cs-ipv6.lancs.ac.uk/MobileIP/]  http://www.cs-ipv6.lancs.ac.uk/MobileIP
/). The latest kernel supported is 2.1.90, and is compatible with IETF mobile
IPv6 draft-v5 (the current revision is v24). The code and website has not
been updated since 1998, so it is considered obsolete.

The other implementation, which is up-to-date, is Helsinki University of
Technology's MIPL project. The latest supported kernel is 2.4.22, and they
have patches for the upcoming 2.6 kernel. Visit [http://
www.mipl.mediapoli.com/]  http://www.mipl.mediapoli.com/ for papers, software
or to browse the mail archive.
-----------------------------------------------------------------------------

3.1. Patching the kernel

The MIPL MIPv6 implementation requires a kernel patch. The implementation
modifies the IPv6 kernel stack, so a kernel recompile is necessary. The
installation process is well documented, but I will give a brief step-by-step
howto.

Please note! The need for two different kernels, one for MN and one for HA,
is obsolete. Just compile support for MN and HA in the same kernel. It is not
possible to run as both an MN and an HA at the same time; which mode is
chosen depends on which of the modules are loaded.

 

 1. Download the latest Linux MIPv6 source code from [http://
    www.mipl.mediapoli.com/]   http://www.mipl.mediapoli.com. The latest
    release today is: mipv6-1.0-v2.4.22. The last four numbers corresponds to
    the Linux kernel the patch should be applied to:
          # cd /usr/local/src                                                    
          # wget http://www.mipl.mediapoli.com/download/mipv6-1.0-v2.4.22.tar.gz 
          # tar zxfv mipv6-1.0-v2.4.22.tar.gz                                    
                                                                                 
   
 2. Download and unpack the correspondent Linux kernel version from [ftp://
    ftp.kernel.org] ftp.kernel.org:
           # cd /usr/src                                                          
           # wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.22.tar.bz2 
           # tar jxvf linux-2.4.22.tar.bz2                                        
           # ln -s linux-2.4.22 linux                                             
           # cd linux                                                             
                                                                                  
   
 3. Apply the MIPv6 patch:
         # patch -p1 --dry-run < /usr/local/src/mipv6-1.0-v2.4.22/mipv6-1.0-v2.4.22.patch  
                                                                                           
   
    The --dry-run option checks that the patch will apply correctly. If you
    get any failed hunks, you should not proceed. If everything went fine do:
                                                                                  
          # patch -p1 < /usr/local/src/mipv6-1.0-v2.4.22/mipv6-1.0-v2.4.22.patch  
                                                                                  
   
 4. Now your kernel tree is ready for configuration. Run your favorite make *
    config. The MIPv6 options are under "Networking Options". The following
    options should be present in ".config":
         CONFIG_EXPERIMENTAL=y                                               
         CONFIG_SYSCTL=y                                                     
         CONFIG_PROC_FS=y                                                    
         CONFIG_MODULES=y                                                    
         CONFIG_NET=y                                                        
         CONFIG_NETFILTER=y                                                  
         CONFIG_UNIX=y                                                       
         CONFIG_INET=y                                                       
         CONFIG_IPV6=m                                                       
         CONFIG_IPV6_SUBTREES=y                                              
         CONFIG_IPV6_IPV6_TUNNEL=m                                           
         CONFIG_IPV6_MOBILITY=m                                              
         CONFIG_IPV6_MOBILITY_MN=m                                           
         CONFIG_IPV6_MOBILITY_HA=m                                           
                                                                             
   
    Since MIPL is still a work-in-progress you might want to enable:
       CONFIG_IPV6_MOBILITY_DEBUG=y                                          
                                                                             
   
    With debug messages it is easier to figure out what happened when
    something goes wrong. Also, when reporting a bug, debug messages are very
    helpful:
   
    To be sure you have all the correct options, you can run 
    chkconf_kernel.sh, which is a small shell script included in the MIPL
    tarball.
   
 5. Next you should compile and install your kernel.
   
    Hint: To easily distinguish this kernel from other kernels, you can
    change the "EXTRAVERSION" value in the /usr/src/linux/Makefile to for
    example "-MIPv6-1".
   

Read the Linux Kernel HOWTO for detailed instruction on how to patch, compile
and install your new kernel.
-----------------------------------------------------------------------------

3.2. Userspace tools

The userspace tool mipdiag, config files and init scripts must be installed
for the module to work correctly:
      # cd /usr/local/src/mipv6-1.0-v2.4.22                                  
      # ./configure                                                          
      # make && make install                                                 
                                                                             
-----------------------------------------------------------------------------

3.3. MIPv6 device node

The MIPv6 module also needs a new device node entry. Issue the command:
      # mknod /dev/mipv6_dev c 0xf9 0                                        
                                                                             
-----------------------------------------------------------------------------

3.4. Automatic startup

 1. Red Hat:
   
    All init scripts are located in /etc/init.d/, which are sym-linked to the
    correct runlevel (/etc/rcX.d/). You can issue the command:
       # chkconfig --add mobile-ip6                                          
                                                                             
   
    to enable MIPv6 at startup, or
       # chkconfig --del mobile-ip6                                          
                                                                             
   
    to remove MIPv6 from startup.
   
 2. Debian:
   
    If you are so lucky to be running Debian, you can issue the command:
       # update-rc.d -n mobile-ip6 start 75 3 4 5 . stop 05 1 2 6 .          
                                                                             
   
    to set up all the necessary links.
   
 3. Slackware:
   
    Slackware users have all their startup/runlevel scripts in /etc/rc.d.
    Since 'configure' doesn't check for "/etc/rc.d", you can add INIT_SLACK="
    /etc/rc.d", and then INIT_SLACK to INITDIRS in 'configure' (search for
    INITDIR in configure). Since you are running Slackware, you probably know
    this already. The following command should then do the trick:
       # echo '/etc/rc.d/mobile-ip6 start' >> /etc/rc.d/rc.local             
                                                                             
   

-----------------------------------------------------------------------------
4. Test bed

Now you should have a working MIPL patched kernel, installed userlevel tools
and enabled automatic startup at boot. If anything went wrong, go through the
above sections carefully.
-----------------------------------------------------------------------------

4.1. Testcase

The addresses we are using in our test-bed are site-local. Note that linking
local addresses won't work! Our test-bed consist of four nodes; see figure 
"Mobile IPv6 testbed".

 1. HA - Home Agent: The HA is located at the home network with address fec0:
    106:2700::2, with one wireless interface.
   
 2. MN - Mobile Node: When MN is on the "home network", it has address fec0:
    106:2700::4. When MN travels to another network, it generates a new 
    "care-of" address.
   
 3. R - Router: This is the router from the home network to the internet. It
    has one wireless interface with address fec0:106:2700::1 and a wired
    interface with address fec0:106:2300::2.
   
 4. AR - Access Router: The link between AR and R is our "internet" (but is
    actually only a cross-cable). The AR has two interfaces; the wired
    interface to R has address fec0:106:2300::1, the wireless has address 
    fec0:106:1100::1.
   

[mipv6-testbed]

Mobile IPv6 testbed
-----------------------------------------------------------------------------

4.2. Step-by-step

4.2.1. Fully functional IPv6 network

Before we can start testing mobile IP, we need a fully functional IPv6
network. All the nodes should be able to ping each other. This is a crucial
part. If, for example, AR is not able to ping HA, then there will be no
binding update.

I will give a brief instruction to get our network up and running using IPv6.
For more info on setting up an IPv6 network, you can read Peter Bieringer's
excellent Linux IPv6 HOWTO.

I've turned off encryption for simplicity - NOTE that you should ALWAYS use
encryption when dealing with wireless networks!

Also note that the different wireless networks have different ESSIDs!

 1. MN: The Mobile Node has one wireless interface. Forwarding should be
    turned off, but should accept autoconf and ra's:
              # iwconfig eth0 mode ad-hoc essid homenet enc off              
              # ifconfig eth0 inet6 add fec0:106:2700::4/64                  
              # echo "0" > /proc/sys/net/ipv6/conf/eth0/forwarding           
              # echo "1" > /proc/sys/net/ipv6/conf/eth0/autoconf             
              # echo "1" > /proc/sys/net/ipv6/conf/eth0/accept_ra            
              # echo "1" > /proc/sys/net/ipv6/conf/eth0/accept_redirects     
              # /etc/init.d/mobile-ipv6 start                                
              # ip route add ::/0 via fec0:106:2700::1                       
                                                                             
   
 2. HA: The Home Agent has one wireless interface. It should have forwarding
    turned on because it uses normal routing to deliver packets captured from
    a physical interface to the virtual tunnel interface. Note: You must add
    a default route or else HA will have problem contacting the MN. One
    possible solution is to have HA as the default router of the home
    network.
              # iwconfig eth0 mode ad-hoc essid homenet enc off              
              # ifconfig eth0 inet6 add fec0:106:2700::2/64                  
              # echo "1" > /proc/sys/net/ipv6/conf/eth0/forwarding           
              # echo "0" > /proc/sys/net/ipv6/conf/eth0/autoconf             
              # echo "0" > /proc/sys/net/ipv6/conf/eth0/accept_ra            
              # echo "0" > /proc/sys/net/ipv6/conf/eth0/accept_redirects     
              # ip route add ::/0 via fec0:106:2700::1                       
              # /etc/init.d/mobile-ipv6 start                                
                                                                             
   
 3. R: The (home) Router has two interfaces, one wireless and one line. The
    Router must have forwarding turned on.
              # ifconfig eth0 inet6 add fec0:106:2300::2/64                  
              # iwconfig eth1 mode ad-hoc essid homenet enc off              
              # ifconfig eth1 inet6 add fec0:106:2700::1/64                  
              # echo "1" > /proc/sys/net/ipv6/conf/all/forwarding            
              # echo "0" > /proc/sys/net/ipv6/conf/all/autoconf              
              # echo "0" > /proc/sys/net/ipv6/conf/all/accept_ra             
              # echo "0" > /proc/sys/net/ipv6/conf/all/accept_redirects      
              # ip route add fec0:106:1100::/64 via fec0:106:2300::1         
                                                                             
   
 4. AR: The Access Router (on a foreign network) also has two interfaces, one
    wireless and one line. Forwarding must be turned on.
              # ifconfig eth0 inet6 add fec0:106:2300::1/64                  
              # iwconfig eth1 mode ad-hoc essid visitnet enc off             
              # ifconfig eth1 inet6 add fec0:106:1100::1/64                  
              # echo "1" > /proc/sys/net/ipv6/conf/all/forwarding            
              # echo "0" > /proc/sys/net/ipv6/conf/all/autoconf              
              # echo "0" > /proc/sys/net/ipv6/conf/all/accept_ra             
              # echo "0" > /proc/sys/net/ipv6/conf/all/accept_redirects      
              # ip route add fec0:106:2700::/64 via fec0:106:2300::2         
                                                                             
   

Instead of modifying proc variables, you can use sysctl.

Note: We are setting static routes on our test-bed. You should now be able to
ping all the hosts from every host.
-----------------------------------------------------------------------------

4.2.2. Configuring radvd on AR

When MN comes to a new network, it does a link-local address configuration,
going to the next phase if that succeeds. I'll let [http://www.ietf.org/rfc/
rfc2462.txt] [RFC2462] (IPv6 Stateless Address Autoconfiguration) describe
the next phase:

  "The next phase of autoconfiguration involves obtaining a Router
Advertisement or determining that no routers are present. If routers are
present, they will send Router Advertisements that specify what sort of
autoconfiguration a host should do. If no routers are present, stateful
autoconfiguration should be invoked."

  "Routers send Router Advertisements periodically, but the delay between
successive advertisements will generally be longer than a host performing
autoconfiguration will want to wait. To obtain an advertisement quickly, a
host sends one or more Router Solicitations to the all-routers multicast
group." --- page 8

This is where we use RADVD.

Read [http://www.ietf.org/rfc/rfc2462.txt] [RFC2462] more more details
concerning IPv6 Stateless Address Autoconfiguration.

We'll configure RADVD on AR's wireless interface. The radvd.conf file should
contain this:
    # cat /etc/radvd.conf                                                    
    interface eth1                                                           
    {                                                                        
          AdvSendAdvert on;                                                  
          AdvIntervalOpt on;                                                 
                                                                             
          MinRtrAdvInterval 3;                                               
          MaxRtrAdvInterval 10;                                              
          AdvHomeAgentFlag off;                                              
                                                                             
          prefix fec0:106:1100::/64                                          
          {                                                                  
              AdvOnLink on;                                                  
              AdvAutonomous on;                                              
              AdvRouterAddr on;                                              
          };                                                                 
    };                                                                       
                                                                             

We then start it:
    # /etc/init.d/radvd start                                                
                                                                             

You should now be able to use radvdump to see that the radvd messages really
are being sent periodically:
    # radvdump                                                               
    Router advertisement from fe80::202:2dff:fe54:d1b2 (hoplimit 255)        
    Received by interface eth1                                               
          # Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump   
          AdvCurHopLimit: 64                                                 
          AdvManagedFlag: off                                                
          AdvOtherConfigFlag: off                                            
          AdvHomeAgentFlag: off                                              
          AdvReachableTime: 0                                                
          AdvRetransTimer: 0                                                 
          Prefix fec0:106:1100::/64                                          
                  AdvValidLifetime: 2592000                                  
                  AdvPreferredLifetime: 604800                               
                  AdvOnLink: on                                              
                  AdvAutonomous: on                                          
                  AdvRouterAddr: off                                         
          AdvSourceLLAddress: 00 02 2D 54 D1 B2                              
                                                                             
-----------------------------------------------------------------------------

4.2.3. Configuring radvd on HA

  To enable the MN to know when it's home, HA should also be sending out RAs.
We should therefore enable RADVD on the HA as well. The /etc/radvd.conf file
should contain:
     # cat /etc/radvd.conf                                                   
     interface eth1                                                          
     {                                                                       
        AdvSendAdvert on;                                                    
        MaxRtrAdvInterval 3;                                                 
        MinRtrAdvInterval 1;                                                 
        AdvIntervalOpt off;                                                  
        AdvHomeAgentFlag on;                                                 
        HomeAgentLifetime 10000;                                             
        HomeAgentPreference 20;                                              
        AdvHomeAgentInfo on;                                                 
        prefix fec0:106:2700::2/64                                           
        {                                                                    
          AdvRouterAddr on;                                                  
          AdvOnLink on;                                                      
          AdvAutonomous on;                                                  
          AdvPreferredLifetime 10000;                                        
          AdvValidLifetime 12000;                                            
        };                                                                   
      };                                                                     
                                                                             

To be completed.
-----------------------------------------------------------------------------

4.2.4. Configuring MIPv6

The last configuration is MIPv6 settings in network-mip6.conf. In RedHat the
file is found under /etc/sysconfig/network-mip6.conf. The file should be
pretty self-explanatory.
     # cat /etc/sysconfig/network-mip6.conf                                  
                                                                             
     # Home Agent configuration file                                         
     FUNCTIONALITY=ha                                                        
     DEBUGLEVEL=1                                                            
     MIN_TUNNEL_NR=1                                                         
     MAX_TUNNEL_NR=5                                                         
     TUNNEL_SITELOCAL=yes                                                    
                                                                             
     # cat /etc/sysconfig/network-mip6.conf                                  
                                                                             
     # Mobile Node configuration file                                        
     FUNCTIONALITY=mn                                                        
     DEBUGLEVEL=1                                                            
     TUNNEL_SITELOCAL=yes                                                    
     MIN_TUNNEL_NR=1                                                         
     MAX_TUNNEL_NR=3                                                         
     HOMEDEV=mip6mnha1                                                       
     HOMEADDRESS=fec0:106:2700::4/64  # MN home adress                       
     HOMEAGENT=fec0:106:2700::2/64    # HA's address                         
                                                                             

Next, start mobile-IP:
    # /etc/init.d/mobile-ip6 start                                           
                                                                             

You can verify that it started by doing:
    # ifconfig                                                               
                                                                             

If a tunnel comes up ip6tnl1, mobile-ip6 is started.
-----------------------------------------------------------------------------

5. Doing some tests

5.1. Pre-test

Do every configuration as shown above; it's especially important to have a
different ESSID on the home net and visited network.

When you start mobile-IPv6 on MN, you will see multicasting router
solicitations messages:
      # tcpdump -i eth0 -vv ip6 or proto ipv6                                          
                                                                                       
      ...                                                                              
      13:32:54.681763 fe80::202:a5ff:fe6f:a08a > ff02::2: icmp6: router solicitation \ 
      (src lladdr: 0:2:a5:6f:a0:8a) (len 16, hlim 255)                                 
                                                                                       
      13:32:55.681763 fe80::202:a5ff:fe6f:a08a > ff02::2: icmp6: router solicitation \ 
      (src lladdr: 0:2:a5:6f:a0:8a) (len 16, hlim 255)                                 
                                                                                       
      13:32:57.681765 fe80::202:a5ff:fe6f:a08a > ff02::2: icmp6: router solicitation \ 
      (src lladdr: 0:2:a5:6f:a0:8a) (len 16, hlim 255)                                 
      ...                                                                              
                                                                                       
                                                                                       
-----------------------------------------------------------------------------

5.2. Movement detection

Generic movement detection uses Neighbor Unreachability Detection to detect
when the default router is no longer bi-directionally reachable, in which
case the mobile node must discover a new default router (usually on a new
link).

To easily see whats going on, you should have one xterm window for each of
these commands:
      # watch ifconfig eth0                                                  
      # watch route -A inet6                                                 
      # tcpdump -i eth0 -vv ip6 or proto ipv6                                
                                                                             

To travel to another net, you can issue the command on MN:
      # iwconfig eth1 essid visitnet                                         
                                                                             

The MN is the on the other wireless network, and since it is sending out 
"router solicitation" (multicast), our AR will respond with it's prefix. MN
will then configure itself with at new IPv6 address with the received prefix
and it's own MAC address. If you type ifconfig eth0 you will see the new IPv6
address:
      # ifconfig eth0                                                              
      eth0  Link encap:Ethernet  HWaddr 00:02:A5:6F:A0:8A                          
            inet addr:192.168.100.134  Bcast:255.255.255.255  Mask:255.255.255.255 
            inet6 addr: fe80::202:a5ff:fe6f:a08a/10 Scope:Link            (1)      
            inet6 addr: fec0:106:1100:0:202:a5ff:fe6f:a08a/64 Scope:Site  (2)      
            inet6 addr: fec0:106:2700::4/64 Scope:Site                    (3)      
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                     
            RX packets:65 errors:44 dropped:0 overruns:0 frame:44                  
            TX packets:134 errors:5 dropped:0 overruns:0 carrier:0                 
            collisions:0 txqueuelen:100                                            
            RX bytes:5528 (5.3 Kb)  TX bytes:21272 (20.7 Kb)                       
            Interrupt:3 Base address:0x100                                         
                                                                                   

(1) The link-local address generated at boot
(2) The new "foriegn" address, generated by combining AR's prefix and
    MAC-address
(3) The "old" (home) address

Almost at the same time, the MN will perform a binding update to HA. In your
tcpdump window, you will see several packets destined to HA. To verify that
the binding update has been sent and acknowledged from MN:
      # mipdiag -s                                                           
      Mobile IPv6 Statistics                                                 
      NEncapsulations           : 0                                          
      NDecapsulations           : 0                                          
      NBindUpdatesRcvd          : 0                                          
      NBindAcksRcvd             : 1    (1)                                   
      NBindNAcksRcvd            : 0                                          
      NBindRqsRcvd              : 0                                          
      NBindUpdatesSent          : 1    (2)                                   
      NBindAcksSent             : 0                                          
      NBindNAcksSent            : 0                                          
      NBindRqsSent              : 0                                          
      NBindUpdatesDropAuth      : 0                                          
      NBindUpdatesDropInvalid   : 0                                          
      NBindUpdatesDropMisc      : 0                                          
      NBindAcksDropAuth         : 0                                          
      NBindAcksDropInvalid      : 0                                          
      NBindAcksDropMisc         : 0                                          
      NBindRqsDropAuth          : 0                                          
      NBindRqsDropInvalid       : 0                                          
      NBindRqsDropMisc          : 0                                          
                                                                             

(1) One binding ACK received.
(2) One binding UPDATE sent.

You can also verify the binding with the following command (on MN):
     # mipdiag -l                                                                               
     Mobile IPv6 Binding update list                                                            
     Recipient CN: fec0:106:2700::2                                                             
     BINDING home address: fec0:106:2700::4 care-of address: fec0:106:1100:0:202:a5ff:fe6f:a08a 
             expires: 115 sequence: 0 state: 1                                                  
             delay: 3 max delay 256 callback time: 68                                           
                                                                                                

You can also verify it on HA with the statistics option (-s) and with the:
     # mipdiag -c                                                            
     Mobile IPv6 Binding cache                                               
     Home Address      Care-of Address                     Lifetime  Type    
     fec0:106:2700::4  fec0:106:1100:0:202:a5ff:fe6f:a08a  104       2       
                                                                             
-----------------------------------------------------------------------------

5.3. ping6

From the MN, you can try to ping AR's eth1 (fec0:106:1100::1):
     # ping6 fec0:106:1100::1                                                      
     PING fec0:106:1100::1(fec0:106:1100::1) from fec0:106:2700::4 : 56 data bytes 
     64 bytes from fec0:106:1100::1: icmp_seq=1 ttl=62 time=8.01 ms                
     64 bytes from fec0:106:1100::1: icmp_seq=2 ttl=62 time=8.02 ms                
     ...                                                                           
                                                                                   

By using tcpdump, you can see how the packets travel:
     12:13:51.789688 fec0:106:1100:0:202:a5ff:fe6f:a08a > fec0:106:2700::2: \  (1)   
     fec0:106:2700::4 > fec0:106:1100::1: icmp6: echo request \ (2)                  
     (len 64, hlim 64) (len 104, hlim 255)                                           
                                                                                     
     12:13:51.797675 fec0:106:2700::2 > fec0:106:1100:0:202:a5ff:fe6f:a08a: \ (3)    
     fec0:106:1100::1 > fec0:106:2700::4: icmp6: echo reply \                        
     (len 64, hlim 62) (len 104, hlim 253)                                           
                                                                                     

(1) The packet first goes from MN to the HA using MN new IPv6 address.
(2) Then from HA to AR.
(3) The AR then responds to HA and tunnels the packets to MN.

You can now see the statistics have been updated:
     # mipdiag -s                                                            
     Mobile IPv6 Statistics                                                  
     NEncapsulations           : 56                                          
     NDecapsulations           : 25                                          
     ...                                                                     
                                                                             
-----------------------------------------------------------------------------

5.4. Kernel IP routing table

One interesting thing MIPv6 does is change the default route to a tunnel. The
new default route becomes:
    # route -A inet6                                                         
    Kernel IPv6 routing table                                                
    Destination      Next Hop       Flags Metric Ref    Use Iface            
    ::/0             ::             UD    64     0        0 ip6tnl1          
    ....                                                                     
                                                                             
-----------------------------------------------------------------------------

5.5. Travelling through several foregin LAN's

To be completed.
-----------------------------------------------------------------------------

5.6. Returning home

To be completed.
-----------------------------------------------------------------------------

5.7. Real life testing - smooth handover

To really get the feel on how mobile IP works, fire up GnomeMeeting (See the
figure GnomeMeeting and start a netmeeting. Note! You must use the latest
GnomeMeeting to get support for IPv6! Then do a "travel" and you can see an
almost smooth handover.

[gnomemeeting1]

Using GnomeMeeting with IPv6 to test roaming between two wireless networks
-----------------------------------------------------------------------------

6. FAQ

 1. Q: Why do we have to create the /dev/mipv6_dev entry?
   
    A: The dev file is mainly so that the userspace tool, mipdiag, can make
    modifications to the kernel parameters using ioctl calls through the
    device file. mknod creates the special device file with paramters
    recognizable by the mobile-ip6 module.
   
 2. Q: Does MIPL support IPSec?
   
    A: There is no support IPSec on 2.4.x. MIPL for 2.6 series will have
    IPSec support from the start. You may use a third-party IPSec
    implementation.
   
 3. Q: How can I control the type of routing used for communication between
    the MN and a CN (through HA tunnel or by direct communication using
    binding update/acks)?
   
    A: You can control this through:
   
      /proc/sys/conf/net/ipv6/mobility/accept_return_routability
   
    If you do not want to use return routability and route optimization, set
    it to 0 with:
   
      # echo 0 > /proc/sys/..../accept_return_routability
   
    Then MN will communicate with CNs only through the home tunnel.
   
 4. Q: Can different wireless networks have different ESSIDs/WEP keys?
   
    A: Yes, but you must change this upon arrival to the new network. MIPv6
    from MIPL can't do this automatically.
   
 5. Q: Host B has two interfaces with two different subnets assigned. When I
    ping B from host A, it does not answer! Why not? Host A knows where host
    B (subnets) are!
   
    A: The host B doesn't know where host A is (B doesn't know where A's net
    is), so you must add a route entry:
   
      # ip route add fec0:106:2700::/64 via fec0:106:2300::1
   
    or
   
      # route -A inet6 add fec0:106:2700::/64 gw fec0:106:2300::1 dev eth0
   
 6. Q: How do I set a default gateway in IPv6?
   
    A: You do that using the traditional "route" or the newer "IP" command:
   
      # ip route ::/0 via <ipv6-host> # route -A inet6 add default gw <
    ipv6-host>
   
 7. Q: Why does the host send a multicast address rather than an anycast
    address, requesting for router solicitation?
   
    A: Because the host wants an answer from every router, not from just any
    router. The idea is to be able to get all parameters and to choose the 
    "best" default router.
   
 8. Q: Why doesn't MN notice that it has moved?
   
    A: It thinks that it's previous router is still reachable. This may
    result from very large lifetimes in router advertisements. Check the
    configuration of the program sending router advertisements in the router.
    If the program supports router advertisement intervals, you can use this
    to help MN in movement detection by setting the use of interval to on.
    See man radvd.conf for details.
   

-----------------------------------------------------------------------------
7. Useful Resources

 

 1. Mobile IPv6 for Linux [http://www.mipl.mediapoli.com/]   http://
    www.mipl.mediapoli.com/
   
 2. Mobile IP Working Group (IETF) [http://www.ietf.org/html.charters/
    mobileip-charter.html]   http://www.ietf.org/html.charters/
    mobileip-charter.html
   
 3. Mobile IPv6 draft [http://www.ietf.org/internet-drafts/
    draft-ietf-mobileip-ipv6-24.txt]   http://www.ietf.org/internet-drafts/
    draft-ietf-mobileip-ipv6-24.txt
   
 4. IPv6 Working Group (IETF) [http://www.ietf.org/html.charters/
    ipv6-charter.html]   http://www.ietf.org/html.charters/ipv6-charter.html
   
 5. RFC2460 Internet Protocol, Version 6 (IPv6) Specification [http://
    www.ietf.org/rfc/rfc2460.txt]   http://www.ietf.org/rfc/rfc2460.txt
   
 6. RFC2461 Neighbor Discovery for IP Version 6 (IPv6) [http://www.ietf.org/
    rfc/rfc2461.txt]   http://www.ietf.org/rfc/rfc2461.txt
   
 7. RFC2462 IPv6 Stateless Address Autoconfiguration [http://www.ietf.org/rfc
    /rfc2462.txt]   http://www.ietf.org/rfc/rfc2462.txt
   
 8. Peter Bieringer's Linux IPv6 HOWTO (en) [http://ldp.linux.no/HOWTO/
    Linux+IPv6-HOWTO/]   http://ldp.linux.no/HOWTO/Linux+IPv6-HOWTO/
   
 9. Current Status of IPv6 Support for Networking Applications [http://
    www.deepspace6.net/docs/ipv6_status_page_apps.html]   http://
    www.deepspace6.net/docs/ipv6_status_page_apps.html
   
10. Linux Kernel HOWTO   http://www.ibiblio.org/pub/Linux/docs/HOWTO/
    other-formats/html_single/Kernel-HOWTO.html
   

-----------------------------------------------------------------------------
8. Copyright, acknowledgments and miscellaneous

8.1. Copyright and License

  Copyright  2003 by Lars Strand. This material may be distributed only
subject to the terms and conditions set forth in the Open Publication
License, v1.0 or later (the latest version is presently available at [http://
www.opencontent.org/openpub/]   http://www.opencontent.org/openpub/ ).

  Linux is a registered trademark of Linus Torvalds.
-----------------------------------------------------------------------------

8.2. Disclaimer

  No liability for the contents of this document can be accepted. Use the
concepts, examples and information at your own risk. There may be errors and
inaccuracies, that could be damaging to your system. Proceed with caution,
and although this is highly unlikely, the author(s) do not take any
responsibility.

  All copyrights are held by their by their respective owners, unless
specifically noted otherwise. Use of a term in this document should not be
regarded as affecting the validity of any trademark or service mark. Naming
of particular products or brands should not be seen as endorsements.
-----------------------------------------------------------------------------

8.3. How this document was produced

This document was originally written in LaTeX using Emacs. HTML version
created with latex2html. Later it was converted to DocBook XML.

An up-to-date version of this document can be found at:

HTML: [http://www.gnist.org/~lars/work/insc/mipv6/]   http://www.gnist.org/
~lars/work/insc/mipv6/
-----------------------------------------------------------------------------

8.4. Feedback

Suggestions, corrections, additions wanted. Contributors wanted and
acknowledged. Flames not wanted.

I can always be reached at <lars at unik no>
-----------------------------------------------------------------------------

8.5. Acknowledgments

This document was produced as a part of Interoperable Networks for Secure
Communications [http://insc.nodeca.mil.no/] (INSC task 6)

Thanks to Andreas Hafslund (andreha [at] unik.no) for initial support. Also
thanks to UniK (University Graduate Center) [http://www.unik.no] http://
www.unik.no and FFI (Norwegian Defence Research Establishment) [http://
www.ffi.mil.no] http://www.ffi.mil.no for hardware support.

Thanks also to the other HOWTO authors whose works I have referenced:

Linux IPv6 HOWTO (en) by Peter Bieringer
