//**************************************************************************// // Field Based Routing Protocol // // Readme // // by Michael Steiger, steigerm@ee.ethz.ch // // and Sascha Trifunovic, sachat@ee.ethz.ch // // IPv6 additions by Sebastian Altorfer, asebi@ee.ethz.ch // // Concept and project: Rainer Baumann, ETH Zurich, baumann@tik.ee.ethz.ch // // License: GPL // //**************************************************************************// -------- Overview -------- 1 How to install the fbr protocol implementation 1.1 Note for Knoppix users 1.2 How to activate the IPv6 mode 2 How to configure the network devices 2.1 Configuration for the IPv6 case 2.2 Note for the IPv6 case 3 How to run the program 4 How to clean up 5 How to see some Kernel debugging output 5.1 How to see additional debugging output in the IPv6 case 6 How to configure the IPv6-to-IPv4 TRT in the IPv6 case 6.1 How to install and set-up the totd DNS proxy 6.2 How to install and set-up pTRTd 6.3 General IPv6-to-IPv4 environment 6.4 Exemplary configurations of eth0, eth1 and eth2 6.5 Configuration of the resolv.conf file for hosts in the WMN 5.5 Testing the TRT ---------------------------------------------- 1 How to install the fbr protocol implementation ---------------------------------------------- First of all the source code needs to be compiled. There is a Makefile which does all the work for. However the code consist of two parts, the daemon and the modules. The modules, unlike the daemon, which is compiled against the libc headers, are compiled against the kernel headers. In kernel 2.6 you will need a precompiled kernel to be able to compile any modules. To make things even easier, just follow the step by step instructions: Change to the folder where the kernel sources belong: # cd /usr/src If not there, download them. Use apt-get on Debian or Knoppix. Replace x with your actual version: # apt-get update # apt-get install linux-source-2.6.x Now there should be a file in the current folder with the name "linux-source-2.6.x.tar.bz2". Decompress it: # tar -xjf linux-source-2.6.x Give the folder a nicer name: # mv linux-source-2.6.x linux-2.6.x # cd linux-2.6.x Copy the current config file: # cp /boot/config-2.6.x .config Compile: # make # make modules 1.1 Note for Knoppix users: --------------------------- For some Knoppix versions there are no kernel sources available via apt-get. In this case download the DVD image of Knoppix and copy the kernel sources from there. 1.2 How to activate the IPv6 mode: ---------------------------------- # make IPVERSION=-DIPV6 # make install For the IPv4 case use: # make # make install -------------------------------------- 2 How to configure the network devices -------------------------------------- To be able to run the program the network devices have to be configured first. Every computer needs at least a wireless card; the gateway needs an other device, connected to the internet. In the following text we assume the wireless device is called ath0. In order to be able to build an ad-hoc network, all the hosts need to be part of the same subnet, share the same ssid, be part of the same cell and communicate over the same channel. The easiest way to configure the device, especially if you need it more than once is to add the following lines into "/etc/network/interfaces": iface ath0 inet static address 192.168.1.1 netmask 255.255.255.0 broadcast 255.255.255.255 wireless-mode ad-hoc wireless-channel 1 wireless-essid test 2.1 Configuration for the IPv6 case: ------------------------------------ The following lines have to be added to the "/etc/network/interfaces" file for the IPv6 case: iface ath0 inet6 static address 2001::61 netmask 16 wireless-mode ad-hoc wireless-channel 1 wireless-essid test Then start the device: # ifup ath0 2.2 Note for the IPv6 case: --------------------------- If the # ifup ath0 command does not work properly there is another way to configure the network device. Add only the following lines to the "/etc/network/interfaces" file: iface ath0 inet6 static address 2001::61 netmask 16 Then run the following commands: # wlanconfig ath0 destroy # wlanconfig ath0 create wlandev wifi0 wlanmode ad-hoc # iwconfig ath0 channel 1 # iwconfig ath0 essid test # ifup ath0 The cell cannot be configured automatically, so do it now: # iwconfig ath0 ap 01:02:03:04:05:06 Obviously the address, netmask, cell or any other parameter can be changed to correspond your needs. ------------------------ 3 How to run the program ------------------------ After performing all the steps explained above you can start the program. Assuming eth0 is the device connected to the Internet. In host mode: # fbr -i ath0 In gateway mode: # fbr - i ath0 -g eth0 If you want to run it in the background just add the option -d. If you need help: # fbr -h If it still doesn't work, mail us. ----------------- 4 How to clean up ----------------- To stop the program use ctrl+c if it is visible or kill the process if invisible. This is done the following way: Get the process id: # ps -e Kill the process # kill id To uninstall the whole thing: # cd /path to the fbr source # make uninstall And clean up: # make clean ----------------------------------------- 5 How to see some kernel debugging output ----------------------------------------- The daemon informs you about the important changes of topology and the current potential and gateway. This information cannot be turned off; you can only demonize (detach from terminal) the process. In the modules any output is disabled and can only be enabled at compiling time. To do so uncomment the "#define FBR_DEBUG" statement in "fbr-mod.h" of both modules. This enables a bunch of printk. The output of the printk is not visible in a normal terminal. If you want to see them, you can e.g. change the screen with ctrl+alt+F1 and you will be flooded with information about every packet coming in and going out and the binary tree and so on... filter it yourself. 5.1 How to see additional debugging output in the IPv6 case: ----------------------------------------------------------- For additional debugging messages add "#define FBR_DEBUG_SPAM" and "#define FBR_DEBUG_SPAM_2" to the files "defs.h", "mod_gw/fbr-mod.h" and "mod_host/fbr-mod.h". -------------------------------------------------------- 6 How to configure the IPv6-to-IPv4 TRT in the IPv6 case -------------------------------------------------------- For the TRT you will need a seperate machine with two network devices running on a Linux ( we used Knoppix ) that supports dual-stacking and you need a connection to the IPv4 Internet. You will need the following third party applications: - totd, "Trick or Treat Daemon" DNS proxy, http://www.vermicelli.pasta.cs.uit.no/software/totd.html - pTRTd, "Portable Transport Relay Translator Daemon", http://v6web.litech.org/ptrtd/ 6.1 How to install and set-up the totd DNS proxy: ------------------------------------------------- First, download the source code and decompress it ( suppose 1.4 is the release number ): # tar xvzf totd-latest.tar.gz # cd totd-1.4 # ./configure # make depend # make # make install Then copy the file "totd.sample.conf" from the directory you have de-compressed the totd source code (totd.tgz) to "/usr/local/etc/totd.conf": # cp totd.sample.conf /usr/local/etc/totd.conf Then edit the configuration file for your needs. "man totd" for more information about the individual options. It is important that you set the prefix in the configuration file to "fec0:0:0:ffff::/64". This is the default prefix that pTRTd uses. Then you can start the totd with # totd 6.2 How to install and set-up pTRTd: ------------------------------------ For pTRTd to work it is required that the binary "sbin/ip" from the iproute-packet is available. It is also necessary that the "tun/tap"-driver ( http://vtun.sourceforge.net/tun/ ) is present in the kernel. After decompressing the source simply run: # ./configure # make # make install You can now run pTRTd: # ptrtd 6.3 General IPv6-to-IPv4 environment: ------------------------------------- { WMN ( IPv6 only) }[ HEAT gateway ](eth0)---------(eth1)[ TRT ](eth2)-----------{ IPv4 Internet } The TRT is connected to the HEAT gateway and to the IPv4 Internet. Let's assume that the device that connects the HEAT gateway to the TRT is "eth0", the device at the other end of that connection at the TRT is "eth1" and the device at the TRT that connects it to the IPv4 Internet is "eth2" 6.4 Exemplary configurations of eth0, eth1 and eth2: ---------------------------------------------------- Add the following lines to the "/etc/network/interfaces" files of the corresponding machines: -eth0: iface eth0 inet6 static address 2002::61 netmask 16 gateway 2002::62 -eth1: iface eth1 inet6 static address 2002::62 netmask 16 -eth2: auto eth2 iface eth2 inet dhcp [!] It is crucial that the hosts in the WMN and the link that connects the TRT and the FBR gateway are in different subnets! [!] 6.5 Configuration of the resolv.conf file for hosts in the WMN: --------------------------------------------------------------- The "/etc/resolv.conf" file of hosts inside the WMN should only contain one entry: nameserver 2002::62 Where 2002::62 is the address of the TRT which may be different in your configuration. 6.7 Testing the TRT: -------------------- The following tests are to be performed with fbr running on a host inside the WMN. You can test if the TRT is working by first pinging the TRT: #ping6 2002::62 where 2002::62 is the address of the TRT in our case. If this works you can then do a DNS lookup of an IPv4 host: #dig www.google.com ANY You should get an answer with some AAAA entries that have the IPv6 prefix that you previously configured. Then you can test if the pTRTd is working by pinging an IPv4 host: #ping6 www.google.com Note that if you get answers it is the pTRTd that is answering, meaning that it is running. For a final test you can then use the IPv6 capable browser of your choice ( we used Firefox ) to access an IPv4 website. It should load and display as if you were on a regular IPv4 host connected to the IPv4 Internet.