From ACT4D Project Wiki
Previous work by Apoorv and Sankalp Currently Working Vishal Jain, Amit Choursiya
Wireless networks have become ubiquitous in the last few years and new protocols are coming up to address newer needs. TDMA mesh networks are used in several situations, like Wireless ISPs, sensor networks etc. However, proper testing of wireless networks is not simple. Furthermore, though several experimental protocols are devised, many are not adopted commercially because of various reasons, including lack of management tools.
Here, we document our efforts in building a wired testbed of upto 4-5 nodes to test wireless networks running FRACTEL (a TDMA multi-hop network operating on 802.11 frequencies).
- Wireless Nodes
- RF cables
- RF Attenuators
- RF Splitter/Combiner
In School of Information and Technology Lab
- Soekris Boxes: 3 x (soekris (net 4801) box in working condition with jaunty installed + power adapter). One other soekris box has a corrupted IDE hard disk which needs to be changed to get it working.
- Null modem cable: To connect to soekris boxes.
- Wireless Cards: 5 x Mikrotik R52 miniPCI wireless cards (Atheros chipset AR5413)
- Attenuators: 3 x 40db, 60W attenuators + 1 x 20dB, 2W attenuator + 1 x 30dB, 2W attenuator working for frequency range 0 - 3 GHz.
- RF Splitter/Combiner: 2 x 4-Way Splitter, 4 x 2-Way splitter
- PCI to mini-PCI Adapters 5 pieces with an antenna and a pigtail.
- RF Cables:
- 10 x LMR-400 cable (thicker coaxial) of length 1 meter having N-male connectors at both the ends. In addition, 20 meters of this cable is also there.
- 15 X thinner cable of length 1 meter each, having N-malewlanconfig, iwconfig and ifconfig connectors at both the ends.
- In addition to this, in order to standardize the type of connectors we have small wires (9 in total) of length 3-4 cm having a custom male connector on one end and an N-female connector on the other.
Setting up testbed
Setting up Wireless Nodes
For wireless nodes, one can either use the soekris boxes available in the lab, or can plugin wireless PCI cards (For our project we needed Atheros 5K series cards) in the PCI slots of desktops. If PCI cards are not available, then one can use mini-PCI cards along with a PCI to mini-PCI adapter. Put the card in the miniPCI slot available in the adapter which itself is put in the PCI slot on the desktops. Use 'lshw -C network' to see if the card is being identified. Please read the card specifications to identify which connector should be connected with the pigtail.
Communicating with Soekris box
We can connect to soekris boxes over serial cable as well. This is useful when facing problems (like mysterious reboots), or for installing OS on the box.
Equipment needed:Linux Machine with serial port. Serial cable.
- Connect the soekris box and your linux machine via null modem cable.
- Install and run minicom on your linux machine.
- Reboot the soekris machine. You should see some normal text(e.g. "Post:123456789abcdefg") and some BIOS text on the minicom screen. If you don't (and see garbage text), change the baud rate and try again. Our Soekris boxes have been configured to run at 115200 bps by default.
- If an OS is already installed, it should display OS boot messages and boot properly(it may take 2-3 minutes though) and you should ultimately see a text-based login screen. Otherwise, you may have to install an OS on the soekris box.
Intalling OS on Soekris
We feel that the best way to install an OS on the soekris machines is through a network-boot. Main guide for installing Linux throught this way : http://seronline.de?p=34. Also see :.
- Equipment needed: Lan switch, serial cable (null modem)).
- DHCP:The above method will need you to run your own dhcp server, so disconnect your DHCP server and soekris node from the normal lab network momentarily while it boots. (Otherwise the authorised institute server would be given priority by the Soekris machine).
- Our recommended choice is to install Ubuntu server edition, with openssh. Afterwards, install the generic kernel to avoid kernel panics due to PAE support.
Installing Custom kernel
You may need to install custom kernels on the machine (for e.g to run FRACTEL). The recommended way is to follow https://help.ubuntu.com/community/Kernel/Compile#AltBuildMethod .
Since compilation can be quite slow on soekris machines, you can copy the .config file to a desktop and build the linux-image and linux-headers package on the desktop. Afterwards, you can use the same package to install the kernel on all the soekris machines.
Note: If you install custom kernel on soekris machines, you may get kernel panics at boot time. One possible reason is that the grub entry uses UUID instead of drive letters(like /dev/sda1) for the parameter root. Find the correct entry by using sudo fdisk -l and make the corresponding changes in grub file.
Building, installing and loading madwifi
Note:madwifi has been superseded by the ath5k driver. Most machines will automatically install the ath5k driver and start using it. Blacklist the ath5k driver in /etc/modprobe.d/blacklist. Also unblacklist the ath_pci driver if blacklisted.
- Download the madwifi source. (See http://madwifi-project.org/wiki/UserDocs/GettingMadwifi for how). Extract the source in a directory, say 'madwifi-source'.
- Go to 'madwifi-source'. Run 'make', followed by 'sudo make install'. 'make' will build the kernel modules, while 'make install' will copy the modules to the directory where modules are loaded in memory from. (You will need tools and packages like gcc,make, linux-headers-`uname -r` etc.)
- Run 'modprobe ath_pci' to actually load the modules into the kernel.
- Run lsmod,lshw and lspci to actually confirm that the driver is correctly loaded and working. 'ifconfig -a' should also show an interface named wifi0.
tar xvf madiwifi-source.tar.gz cd madwifi-source make sudo make install lsmod sudo modprobe ath_pci sudo lshw -C network sudo lspci -v ifconfig -a
Building a wifi-network using madwifi
Note:The interfaces are somewhat confusing when using madwifi. There's an interface called wifi0, which is not used for anything(AFAIK) except to create and destroy other interfaces. These new interface(s) are the ones which are afterwards to configure the network, or send and receive packets.
- Verify that driver is loaded and working. (See above).
- Use ifconfig and iwconfig to set connectivity parameters. (IP, wifi-channel, mode etc.) Note that to change wifi-mode, interfaces have to be destroyed and then recreated.
- Carry out the corresponding changes on the other machine(s).
- Use 'iwlist scan' to see available networks.
- Test the network using pings.
iwconfig sudo wlanconfig ath1 destroy sudo wlanconfig ath create wlandev wifi0 wlanmode adhoc sudo ifconfig 192.168.0.1 netmask 255.255.255.0 up sudo iwconfig ath0 essid meshnet txpower 19dbm channel 7 rate auto sudo iwlist scan ping 192.168.0.2
Measuring signal strengths
Signal strengths can be measured my creating two interfaces, one in networking(adhoc etc.) mode and the other in monitor mode. Create a normal network using the first interface, but run tcpdump on the second interface to capture packets with the radiotap header.
Building and Installing FRACTEL
- FRACTEL requires a kernel with timer resolution of 1000 Hz. Recompile the kernel to achieve this.
- Refer to the installation guide with FRACTEL for basic details.
- Compile the appropriate FRACTEL version(there are two), alongwith the other helper modules (logging daemon, routing daemon etc.)
- Modify the startup script appropriately(with correct paths etc.).
- Run the startup script.
- Also remember to enable packet forwarding ('sudo sysctl net.ipv4.ip_forward=1')
Note:See the /proc/net/madwifi/ath0/fractel_config file to check whether parameters are being set or not.
List of commands, tools and packages used
- make,gcc(C):Commands for building
- uname:Check Kernel versions.
- linux-image-<version>,linux-headers-<version>(P):Contain the linux image and its headers files
- wlanconfig, iwconfig and ifconfig(C):Commands to create,destroy and configure network interfaces.
- lshw and lspci(C):Commands to list hardware and the drivers associated with them.
- modprobe,modinfo and lsmod(C):Commands to display, add and remove kernel modules currently laoded into memory.
- openssh-server, openssh(P):ssh client and server
- wireshark(T):GUI tool for viewing captured packet data.
- tcpdump(C):CLI tool for capturing packet data
- ping,tracert(C):Determine network connectivity
- Logviewer(T):GUI tool to view system logs. (Use CLI if not available)
- Source navigator, cscope(T) - tools that allow easy navigation of C code.
Problems faced with the Testbed
P:: 'lshw -C network' does not show the presence of wireless network card.
S:: Make sure the card is properly fitted in the PCI slot. If using a mini-PCI card, ensure it is properly fitted in the adapter which itself is properly fitted in the PCI slot. If possible use a screw to fix the adapter.
P: The card is being detected but it is unclaimed, even after properly installing and loading the madwifi driver.
S: This is a problem for which we couldn't find any solution. It sometimes happened that the card (on the desktop) was perfectly working with madwifi, but with modified driver (fractel), the hardware goes unclaimed. It is baffling, since same card+adapter worked perfectly on some other desktop.
P: 'lshw -C network' shows the card and driver is detecting it, but it is disabled.
S: Use 'ifconfig -a' to see the list of interfaces available. If wireless interface is already there, up the interface, else use the commands mentioned in Building a network using madwifi section and check again.
P: When I up the wireless interface, it detects the network initially but then I get kernel panics.
S: We did face this problem with linux kernel 2.6.32.x and networking in adhoc mode. Disabling the wireless networks which is automatically activated by the network manager was the trick. Up the wireless interface again.
P: Sometimes the soekris boxes do not boot properly and generally hang during boot.
S: Connected the soekris box to the desktop using null modem and booted. This resulted in proper boots. Also reinstalling the OS solved the problem later on.
P: Sometimes the equipment does not work properly and it gets detected very late.
S: If possible try to get a oscilloscope or a similar handy instrument in the lab. This can be used to check signal strengths and thus the equipment.
- Since the work involves a lot of computer nodes, install ssh on each node, even if it can be controlled physically. Try and automate common tasks using scripts, saves lot of time.
- Use standard conventions for hostnames, usernames, passwords, ipaddresses etc.
- Use source control for any code. Especially useful if you have to push the code out to all nodes.
- Try and work as much as possible on the desktops. Their lower latencies and processing times can eliminate a lot of wasted time.
- Reports-Use Lyx (provides WYSIWYG editing, with almost no latex problems). Use Gliffy for creating diagrams.
- While building a testbed, for making connections, use a standard connector. For instance, we have converters which convert a specific connector type to N-female connectors, which can be then be connected using wires having N-male connectors. Otherwise, one has to get and keep an account of customized wires.
List of vendors
- Frontier Trading Company: Deals in R.F., Co-Axial And Microwave Connectors, Antennas, Attenuators and Cables. Crimping is also done here. Address: E - 177 Lajpat Nagar I, Delhi, Delhi ( South ) - 110024. Rating 3/5.
- Integrative Solutions Pvt. Ltd: Deals in equipment required for BTS installation. Has an R&D workshop where one can get equipment tested before purchasing. Also, the prices are reasonable. Address: B-73, Industtrial area, Mayapuri Phase-1, New Delhi-64. List of products they offer can be seen using File:Integrative IBS Product List.xls, File:Integrative ISM & WI-MAX PRODUCTS.xls. Rating 5/5.