3. Flow of experiment and the problems have occurred
Part1: Compile kernel
In the step of compiling kernel, we have met many problems which costs us a lot of time. Later I will list them.
The webpage we take as reference: http://blog.yam.com/carl44/article/7220788
(1) Download MIPv6
sudo –s
cd /usr/local/src
wget http://mobile-ipv6.org/software/download/mipv6-2.0.2.tar.gz
wget http://mobile-ipv6.org/software/download/mipv6-2.0.2-linux-2.6.16.patch.gz
tar zxfv mipv6-2.0.2.tar.gz
(2) Download kernel source
cd /usr/src
wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.4.tar.bz2
tar jxvf linux-2.6.16.4.tar.bz2
ln -s linux-2.6.16.4 linux
cd linux
(The linux document is where we compiled kernel)
(3) Apply the MIPv6 patch
zcat /usr/local/src/mipv6-2.0.2-linux-2.6.16.patch.gz | patch -p1 --dry-run
zcat /usr/local/src/mipv6-2.0.1-linux-2.6.15.patch.gz | patch -p1
In this step, the error occur so we modify the command to
zcat /usr/local/src/mipv6-2.0.2-linux-2.6.16.patch.gz | patch -p1
(3) Compile kernel
cd /usr/src/linux
make mrproper
make menuconfig
In this step, the error occur if the library “libncurse.dev” is not installed (the default will not install this library) so we have to installed it.
Then we modified the config as follow, note that some config would not found if the (3) is not succeed.
CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y
CONFIG_PROC_FS=y
CONFIG_NET=y
CONFIG_INET=y
CONFIG_IPV6=y
CONFIG_IPV6_MIP6=y
CONFIG_XFRM=y
CONFIG_XFRM_USER=y
CONFIG_XFRM_ENHANCEMENT=y
CONFIG_IPV6_TUNNEL=y
CONFIG_IPV6_ADVANCED_ROUTER=y
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_ARPD=y
CONFIG_INET6_ESP=y
CONFIG_NET_KEY=y
CONFIG_NET_KEY_MIGRATE=y
make clean
make bzImage
In this step, a error will occurred because the library “compiler.h” is modified in new version of linux. So we modified the command to
make bzImage CC="gcc -fno-stack-protector”
make modules
make modules_install
make install
then we make the initrd.img to boot.
The command
mkinitrd –o initrd-2.6.16.4.img /lib/modules
or
mkinitramfs –o initrd-2.6.16.4.img /lib/modules
After making the init image, the error “kernel panic” may occur. We don’t know how it happened. How we solve the problem is to change the version of Ubuntu.
After 5 versions of Ubuntu have tried(the version 6.10 is ok) and more than ten times compiling kernel has done. We have build two server (AR and HA) for the experiment. It takes us about 3days!!
Part 2: Install MIPv6
The webpage we take as reference:
http://blog.yam.com/carl44/article/7221456
cd /usr/local/src/mipv6-2.0.2
CPPFLAGS=-I/usr/src/linux/include ./configure --enable-vt
make
make install
Part3: Set up IPv6
(1) Setting mipv6
First we build a exe file “mip6d” in /etc (in MN and HA) as
#!/bin/sh
#
# mip6d: Starts the Mobile IPv6 Daemon
#
# description: This is a daemon which provide IPv6 Mobility
# support (RFC3775). Init script for Debian and Ubuntu.
#
# (C) GNU GPL Lars Strand <lars strand at linpro no>
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
DAEMON=/usr/local/sbin/mip6d
DESC=mip6d
CONFIG=/etc/mip6d.conf
OPTIONS="-d 0 -c $CONFIG"
set -e
# Check for IPv6 support in kernel
if [ ! -e /proc/sys/net/ipv6 ]; then
echo "IPv6 support must be enabled in the kernel for $DESC to work."
exit 1
fi
# Can we fint the mip6d?
if [ ! -x $DAEMON ]; then
echo "Unable to find $DAEMON."
exit 1
fi
chkconfig() {
if [ ! -e $CONFIG -o ! -s $CONFIG ]; then
echo ""
echo "ERROR: $CONFIG does not exist or is empty."
echo " See mip6d.conf(5) for configuration file syntax and example"
echo " configuration. $DESC will *not* be started."
echo ""
exit 1
fi
}
# See how we were called.
case "$1" in
start)
echo -n "Starting $DESC..."
chkconfig
if ! start-stop-daemon --oknodo --start --exec $DAEMON -- $OPTIONS; then
echo "failed." & exit 1
fi
echo " done."
;;
stop)
echo -n "Stopping $DESC..."
start-stop-daemon --oknodo --stop --exec $DAEMON
echo " done."
;;
restart)
chkconfig
echo -n "Restarting $DESC..."
start-stop-daemon --oknodo --stop --exec $DAEMON
sleep 1
start-stop-daemon --oknodo --start --exec $DAEMON -- $OPTIONS
echo " done."
;;
*)
echo "Usage: $0 {start|stop|restart}" &2
exit 1
;;
esac
exit 0
In MN we type the command below
# 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
In HA we type the command below
# ifconfig eth0 inet6 add fec0:106:2700::1/4
# 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
In AR we type the command below
# ifconfig eth0 inet6 add fec0:106:2300::1/64
# 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
then we make configure file “mip6d.conf” in /etc
HA:
# Mobile IPv6 configuration file: Home Agent
#
# filename: /etc/mip6d.conf
NodeConfig HA;
## If set to > 0, will not detach from tty
DebugLevel 10;
## List of interfaces where we serve as Home Agent
Interface "eth0";
##
## IPsec configuration
##
UseMnHaIPsec enabled;
IPsecPolicySet {
HomeAgentAddress fec0:106:2700::1
HomeAddress fec0:106:2700::1/64;
IPsecPolicy HomeRegBinding UseESP;
IPsecPolicy MobPfxDisc UseESP;
IPsecPolicy TunnelMh UseESP;
}
MN:
# Mobile IPv6 configuration file: Mobile Node
#
# filename: /etc/mip6d.conf
NodeConfig MN;
## If set to > 0, will not detach from tty
DebugLevel 10;
MnDiscardHaParamProb enabled;
Interface "eth0";
MnHomeLink "eth0" {
HomeAgentAddress fec0:106:2700::1;
HomeAddress fec0:106:2700::4/64;
}
##
## IPsec configuration
##
UseMnHaIPsec enabled;
IPsecPolicySet {
HomeAgentAddress fec0:106:2700::1;
HomeAddress fec0:106:2700::4/64;
IPsecPolicy HomeRegBinding UseESP;
IPsecPolicy MobPfxDisc UseESP;
IPsecPolicy TunnelMh UseESP;
}
(2) Setting radvd
radvd is a software to help us to do the broadcast in IPv6
we set the radvd.conf in /etc
AR:
interface eth2
{
AdvSendAdvert on;
AdvIntervalOpt on;
MinRtrAdvInterval 3;
MaxRtrAdvInterval 10;
AdvHomeAgentFlag off;
prefix fec0:106:1100::/64
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
};
};
HA:
interface eth2
{
AdvSendAdvert on;
MaxRtrAdvInterval 3;
MinRtrAdvInterval 1;
AdvIntervalOpt off;
AdvHomeAgentFlag on;
HomeAgentLifetime 10000;
HomeAgentPreference 20;
AdvHomeAgentInfo on;
prefix fec0:106:2700::1/64
{
AdvRouterAddr on;
AdvOnLink on;
AdvAutonomous on;
AdvPreferredLifetime 10000;
AdvValidLifetime 12000;
};
};
After this, if we execute “radvd start” and “radvdump”, we’ll see some information in HA and AR like this, which means we have succeed to broadcast with each other.
Router advertisement from fe80::202:2dff:fe54:d11e (hoplimit 255)
Received by interface eth0
# Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump
AdvCurHopLimit: 64
AdvManagedFlag: off
AdvOtherConfigFlag: off
AdvHomeAgentFlag: on
AdvReachableTime: 0
AdvRetransTimer: 0
Prefix fec0:106:2700::2/64
AdvValidLifetime: 12000
AdvPreferredLifetime: 10000
AdvOnLink: on
AdvAutonomous: on
AdvRouterAddr: on
AdvSourceLLAddress: 00 02 2D 54 D1 1E
AdvHomeAgentInfo:
HomeAgentPreference: 20
HomeAgentLifetime: 1000
And we can use “ping6 –I eth2 (IPv6 IP)” to check if HA and AR is reachable. And we’ve succeed.
But after the step above, we have failed on doing
# mip6d -c /etc/mip6d.conf
the information we retrieved should be like this:
mip6d[3794]: MIPL Mobile IPv6 for Linux v2.0.1 started (Home Agent)
main: MIPL Mobile IPv6 for Linux started in debug mode, not detaching from terminal
conf_show: config_file = /etc/mip6d.conf
conf_show: vt_hostname = localhost
conf_show: vt_service = 7777
conf_show: mip6_entity = 2
conf_show: debug_level = 10
conf_show: PolicyModulePath = [internal]
conf_show: DefaultBindingAclPolicy = 0
conf_show: NonVolatileBindingCache = disabled
conf_show: KeyMngMobCapability = disabled
conf_show: UseMnHaIPsec = enabled
conf_show: MnMaxHaBindingLife = 262140
conf_show: MnMaxCnBindingLife = 420
conf_show: MnRouterProbes = 0
conf_show: MnRouterProbeTimeout = 0.000000
conf_show: InitialBindackTimeoutFirstReg = 1.500000
conf_show: InitialBindackTimeoutReReg = 1.000000
conf_show: UseCnBuAck = disabled
conf_show: DoRouteOptimizationMN = enabled
conf_show: MnUseAllInterfaces = disabled
conf_show: MnDiscardHaParamProb = disabled
conf_show: SendMobPfxSols = enabled
conf_show: SendMobPfxAdvs = enabled
conf_show: SendUnsolMobPfxAdvs = enabled
conf_show: MaxMobPfxAdvInterval = 86400
conf_show: MinMobPfxAdvInterval = 600
conf_show: HaMaxBindingLife = 262140
conf_show: DoRouteOptimizationCN = enabled
xfrm_cn_init: Adding policies and states for CN
xfrm_ha_init: Adding policies and states for HA
vt_server_init: VT server listens 127.0.0.1[7777] OK
But we don’t have , and got some error. This is the bottleneck we’ve met. We have stopped to doing this experiment because it takes us too much time(one week) and I had not slept for three days due to the complex of this experiment and so many difficult problems we have met.