[wiki:Documentation] | !bssidFix = A Solution Ad-Hoc BSSID Partitioning Problems = When wifi network cards are placed in ad-hoc mode (iwconfig ath0 mode 'ad-hoc') they will automatically search for networks with the same essid (iwconfig ath0 essid 'blah'). They will adopt the bssid of the first node to turn on that has the specified essid. Unfortunately, this algorithm and/or implementation is not very good and even relatively small networks, nodes that have the same 'essid' will end up with different a 'bssid'. Since the wifi card drivers filter by bsssid, nodes that should be in the same ad-hoc network can't exchange packets. The solution to this problem can be found by modifying the madwifi drivers (for Atheros wifi cards only), so that the bssid a node generates is a hash of the essid instead of its MAC address. This ensures that nodes with indentical essid's end up with identical bssid's. Although it has not been extensively tested with non-modified nodes, this modification to the madwifi drivers should be fully backwards compatible with non-modified nodes. == What to Change == These instructions are designed to be applied to the baseline.ndz as of Aug 25,2006. 1. ssh to one of the nodes (ssh root@node1-2) 2. open /usr/src/madwifi/trunk/net80211/ieee80211_node.c in your favourite text editor 3. goto line 427, you'll see some code that looks like this: {{{ if (ic->ic_flags & IEEE80211_F_DESBSSID) IEEE80211_ADDR_COPY(ni->ni_bssid, ic->ic_des_bssid); else ni->ni_bssid[0] |= 0x02; /* local bit for IBSS */ }}} 4. Right after these lines add the lines: {{{ int len = 0; while (ic->ic_des_essid[len] != 0) len++; int i; for (i=0;ini_bssid[i] = ic->ic_des_essid[i % len]; } }}} 5. Save the file 6. cd /usr/src/madwifi/trunk 7. make 8. cp /usr/src/madwifi/trunk/net80211/*.ko /lib/modules/2.6.12/net 9. modprobe -r ath_pci 10. modprobe ath_pci You will probably want to save the image this modified node so that you can save running these steps each time you want to perform an experiment. Save the image of the node: {{{ joeuser@console.sb1:~$ saveNode 1,2 }}}