aodv

所属分类:通讯编程
开发工具:Visual C++
文件大小:231KB
下载次数:277
上传日期:2008-06-03 10:57:30
上 传 者huangguofang1983
说明:   AODV源码,在omnet++下实现.
(AODV source, in omnet++ Achieve.)

文件列表:
aodv源代码\aodv-uu-0.8\aodv-uu.cc (17642, 2004-02-04)
aodv源代码\aodv-uu-0.8\aodv-uu.h (5834, 2003-10-31)
aodv源代码\aodv-uu-0.8\AODV.IAB (61440, 2007-02-03)
aodv源代码\aodv-uu-0.8\AODV.IAD (928, 2007-02-03)
aodv源代码\aodv-uu-0.8\AODV.IMB (20480, 2007-02-03)
aodv源代码\aodv-uu-0.8\AODV.IMD (528, 2007-02-03)
aodv源代码\aodv-uu-0.8\AODV.PFI (184, 2007-02-03)
aodv源代码\aodv-uu-0.8\AODV.PO (776, 2007-02-03)
aodv源代码\aodv-uu-0.8\AODV.PR (14864, 2007-02-03)
aodv源代码\aodv-uu-0.8\AODV.PRI (93616, 2007-02-03)
aodv源代码\aodv-uu-0.8\AODV.PS (146884, 2007-02-03)
aodv源代码\aodv-uu-0.8\AODV.WK3 (6299, 2007-02-03)
aodv源代码\aodv-uu-0.8\aodv_hello.c (7815, 2004-02-13)
aodv源代码\aodv-uu-0.8\aodv_hello.h (1706, 2004-02-13)
aodv源代码\aodv-uu-0.8\aodv_neighbor.c (5940, 2004-02-13)
aodv源代码\aodv-uu-0.8\aodv_neighbor.h (1381, 2003-09-22)
aodv源代码\aodv-uu-0.8\aodv_rerr.c (6210, 2004-02-03)
aodv源代码\aodv-uu-0.8\aodv_rerr.h (2433, 2003-09-22)
aodv源代码\aodv-uu-0.8\aodv_rrep.c (12617, 2004-02-03)
aodv源代码\aodv-uu-0.8\aodv_rrep.h (2719, 2003-11-18)
aodv源代码\aodv-uu-0.8\aodv_rreq.c (18258, 2004-02-03)
aodv源代码\aodv-uu-0.8\aodv_rreq.h (3434, 2003-10-24)
aodv源代码\aodv-uu-0.8\aodv_socket.c (16012, 2004-02-11)
aodv源代码\aodv-uu-0.8\aodv_socket.h (2230, 2003-09-22)
aodv源代码\aodv-uu-0.8\aodv_timeout.c (7363, 2004-02-06)
aodv源代码\aodv-uu-0.8\aodv_timeout.h (1519, 2003-05-23)
aodv源代码\aodv-uu-0.8\CHANGELOG (6217, 2004-02-13)
aodv源代码\aodv-uu-0.8\debug.c (11109, 2004-02-03)
aodv源代码\aodv-uu-0.8\debug.h (1890, 2004-02-03)
aodv源代码\aodv-uu-0.8\defs.h (6370, 2004-02-11)
aodv源代码\aodv-uu-0.8\endian.c (1746, 2003-04-17)
aodv源代码\aodv-uu-0.8\GPL (17992, 2001-11-09)
aodv源代码\aodv-uu-0.8\icmp.c (3001, 2004-02-03)
aodv源代码\aodv-uu-0.8\icmp.h (1105, 2002-06-19)
aodv源代码\aodv-uu-0.8\kaodv.c (6037, 2004-02-11)
aodv源代码\aodv-uu-0.8\k_route.c (4900, 2003-10-14)
aodv源代码\aodv-uu-0.8\k_route.h (1387, 2003-09-22)
aodv源代码\aodv-uu-0.8\libipq.c (8900, 2002-03-11)
aodv源代码\aodv-uu-0.8\libipq.h (2082, 2002-05-19)
aodv源代码\aodv-uu-0.8\link_qual.c (8790, 2003-10-14)
... ...

Introduction ============ This is an AODV implementation developed at Uppsala University, Sweden, with some funding from Ericsson AB. It has been developed mainly for use in the APE testbed, http://apetestbed.sourceforge.net. The code is released under the GNU General Public License (GPL). See the GPL document for more information. This release is based on AODV draft version 13. There are no guarantees that it implements all features correctly, although this is the goal. The code is provided as is. See the CHANGELOG for updates and changes between releases. This AODV implementation runs as a user-space daemon, maintaining the kernel routing table. Netfilter is used to capture data packets. Filtering is done in user-space, so there may be some performance penalties, although coding is much simplified. Stable operation has higher priority than performance. The code has been successfully tested in a real ad-hoc environment using up to 5 nodes (4 hops) without problems. It has been debugged in ns-2 by running extensive simulations. The performance is usually on par or better than the AODV version in ns-2. It has also been interop tested with great results. If you happen to experience less successful operation of this implementation, please contact the author(s) and describe your problems. Requirements ============ Real world: * Linux OS. * Kernel with Netfilter support, (2.4.x or patched 2.2.x). Most Red Hat/Fedora kernels have this support. * Wireless LAN cards in ad-hoc mode (alternatively a wired setup can be used). ns-2: * See README.ns Installation ============ If you are running AODV-UU in NS-2, then you should read README.ns for install instructions. Make sure you have the kernel source (or at least headers) of the kernel you are compiling against installed in /usr/src/linux. Otherwise the kernel modules might not compile. Compile with "make": > make Install (as "root"): > make install Run (as "root" with recommended options for debugging): > aodvd -l -r 3 For command line options, run: > aodvd --help The following modules must be loaded when running (or compiled into the kernel): * kaodv.o Module loading should happen automatically if AODV is installed and the module loading system (modprobe) is properly configured. Compiling for ARM (iPAQ, Zaurus) ================================ AODV-UU now easily compiles for the ARM platform, which makes it suitable for use on many PDAs, including the Compaq/HP iPAQ and the Sharp Zaurus. However, since cross-platform compiling is necessary, this process requires some extra steps. This is what I did to get it working with the Familiar distribution on a H3800 iPAQ: 1. First download the cross-compiler, for example: > wget ftp://ftp.handhelds.org/pub/linux/arm/toolchain/arm-linux-toolchain-current.tar.gz 2. Unpack the cross-compiler according to instructions in ftp://ftp.handhelds.org/pub/linux/arm/toolchain/README, usually: > cd /; tar zxvf /path/to/arm-linux-toolchain-current.tar.gz 3. Retrieve the kernel source code matching the kernel used on the ARM device.You may check the URL below for binary pre-compiled kernel packages, installable via ipkg. There are no guarantees that these are always available or up to date... http://www.docs.uu.se/docs/research/projects/ape/familiar/ Otherwise, for the Familiar distribution, the kernel source code can be retrieved via anonymous cvs: > export CVSROOT=:pserver:anoncvs@cvs.handhelds.org:/cvs > cvs login Password=anoncvs Get the matching version with "-r": > cvs export -r K2-4-18-rmk3-hh6 linux/kernel 4. Re-link the "asm" and "linux" include directories in arm cross-compiler tree to point to those in the ARM kernel source tree: > ln -s /path/to/arm-kernel-source/include/linux /skiff/local/arm-linux/include/linux > ln -s /path/to/arm-kernel-source/include/asm /skiff/local/arm-linux/include/asm 5. Make sure the arm compiler is in the PATH and that /usr/src/linux points to the ARM kernel source. > export PATH=$PATH:/skiff/local/arm-linux/bin > ln -s /path/to/arm-kernel-source /usr/src/linux 6. Since the default Familiar kernel do not have the proper netfilter support for AODV-UU (CONFIG_IP_NF_QUEUE) it is necessary to compile a new kernel. Follow the instructions at http://www.handhelds.org/handhelds-faq/development.html. Build ipkg-packages for easy installation. Then install kernel using ipkg. It may be possible to transfer only the ip_queue.o module so that installing a new kernel can be avoided. 6. Compile AODV-UU for ARM: > make arm To install, copy kaodv.o and aodvd to the ARM device. Debug output ============ To get debug output, make sure the daemon is compiled with the -DDEBUG option set (check Makefile). Debug information is written to /var/log/aodvd.log if the AODV is run with the "-l" flag: > aodvd -l This is the same output as written to STDOUT if running the daemon in the foreground. To get printouts of the AODV internal routing table, run AODV with: > aodvd -r 2.5 where the number is the interval between routing table printing, in seconds. The routing table is written to /var/log/aodvd.rtlog. Note about Local Repair ======================= As of version 0.6 of AODV-UU, local repair is fully implemented. However, please be aware of the fact that local repair does not always help performance, it may in fact hurt it. Consider turning local repair off if this is not a feature you are interested in. Note about HELLO messages ========================= This implementation rely on HELLO messages. However, it has been found, through real world testing, that HELLO messages are not a good way to do neighbor sensing in a wireless environment (at least not over 802.11). Therefore, you may experience bad performance when running over wireless. There are several reasons for this: * HELLO messages are broadcasted. In 802.11, broadcasting is done at a lower bit rate than unicasting, thus HELLO messages travel further than data. * HELLO messages are small, thus less prone to bit errors than data transmissions. * Broadcast transmissions are not guaranteed to be bidirectional, unlike unicast transmissions. Running a test ============== To test the basic functionality of AODV you need at least three computers configured to run AODV. The nodes IP-address configuration should be in the same subnet. Then try to place the computers so that two of them are out of each others transmission range with the third computer in the middle, as in the illustration below. It may also be convenient to use a MAC-filter, like that part of the APE testbed, http://apetestbed.sourceforge.net. A <-> B <-> C Run on either A or C: > ping -R to ping the remote computer. The "-R" option will record the route taken by ping packets, so that the actual route taken can be seen. Unidirectional links ===================== This AODV implementation can detect the presence of unidirectional links, and avoid them if necessary. It is done by sending a RREP extension along with the hello messages containing the neighbor set of a node. This functionality is not part of the AODV draft as of version 10, but similar functionality may be in future versions. Unidirectional link detection can be enabled with the "-u" option. This feature is experimental and may be BROKEN in any release. Internet gateway support ======================== As of v0.8, AODV-UU implements gateway support by tunneling packets to gateway configured nodes. This is much more robust than a default route solution or similar. AODV-UU must be compiled with "CONFIG_GATEWAY" defined (see Makefile). Nodes that run "aodvd" with the -w flag will automatically act as gateways - thus answering to RREQs according to an "address locality" decision, i.e., RREQs for addresses that a gateway thinks lie outside the ad hoc network will generate a (proxy) RREP. This RREP contains a special extension that automatically sets up a tunnel between the source node and the gateway. Gateways currently implement "address locality" through a prefix check, thus the ad hoc network must share a prefix (e.g., 192.168.0.0/16). Other "locality checks" can easily be implemented in locality.c. Tunnels (i.e., routes to gateways) are marked with a "G" flag in the routing table, while tunnel entries (i.e., Internet destinations) are marked with and "I" flag. In case the ad hoc network does not use a globally valid prefix (or runs Mobile IP or similar), gateways should also have NAT enabled: > /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE Change eth0 to the name of the interface connected to the Internet if necessary. On the ad hoc nodes it is also necessary to add a default route in the kernel routing table, pointing to the ad hoc interface. For example, if the wireless ad hoc interface is eth1: > route add default dev eth1 Otherwise, it will not be possible to communicate with destinations outside the ad hoc prefix. Issues & Troubleshooting ======================== * If a crash occurs, the kernel module "kaodv.o" may remain loaded and can stop traffic from going through on the interface. Unload with "/sbin/rmmod kaodv" (root permissions required). * If the daemon refuse to start and complains about ipchains, make sure that the "ipchains" compatibility kernel module is not loaded. It will conflict with iptables. Do "ipchains -F" followed by "modprobe -r ipchains" to unload it. * For routing between nodes with arbitrary subnet addresses the default gateway in the kernel routing table must point to the node itself. Otherwise communication with addresses on a foreign subnet will not be possible, since the kernel will complain that there is no route available. Setting this gateway is typically done with the command: > route add default dev Notes about the source code =========================== libipq.c and libipq.h are unmodified files from the netfilter package which are included here for convenience. Contact: ======== Source code and implementation questions: Erik Nordstrm NS port questions: Bjrn Wiberg Misc. questions: Henrik Lundgren

近期下载者

相关文件


收藏者