Computer Network Laboratory    Group 5

LAB 4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

˙The Detail Flow of Lab4 and The Problems We Met.

 

 

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 the above step, the error occurred so we modified the command to:

             zcat /usr/local/src/mipv6-2.0.2-linux-2.6.16.patch.gz | patch -p1

 

4.Compile kernel

             cd /usr/src/linux

             make mrproper

             make menuconfig

            

             In this step, the error occurred 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 follows, note that some config would not found if the step 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

 

                 And then keep going.

 

                 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.

            

             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 been 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 follows:

            

             #!/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 find 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