summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2009-07-11 15:02:45 +0000
committerrpaulo <rpaulo@FreeBSD.org>2009-07-11 15:02:45 +0000
commit8424d740209fc6cee8a8bc4deba2a40cdc77d1fd (patch)
tree7dd4e6a8c026ec13b70ca0a34e625684d79ec055 /tools
parentba5583d31888cb78136b114790fce49c792c14d0 (diff)
downloadFreeBSD-src-8424d740209fc6cee8a8bc4deba2a40cdc77d1fd.zip
FreeBSD-src-8424d740209fc6cee8a8bc4deba2a40cdc77d1fd.tar.gz
Implementation of the upcoming Wireless Mesh standard, 802.11s, on the
net80211 wireless stack. This work is based on the March 2009 D3.0 draft standard. This standard is expected to become final next year. This includes two main net80211 modules, ieee80211_mesh.c which deals with peer link management, link metric calculation, routing table control and mesh configuration and ieee80211_hwmp.c which deals with the actually routing process on the mesh network. HWMP is the mandatory routing protocol on by the mesh standard, but others, such as RA-OLSR, can be implemented. Authentication and encryption are not implemented. There are several scripts under tools/tools/net80211/scripts that can be used to test different mesh network topologies and they also teach you how to setup a mesh vap (for the impatient: ifconfig wlan0 create wlandev ... wlanmode mesh). A new build option is available: IEEE80211_SUPPORT_MESH and it's enabled by default on GENERIC kernels for i386, amd64, sparc64 and pc98. Drivers that support mesh networks right now are: ath, ral and mwl. More information at: http://wiki.freebsd.org/WifiMesh Please note that this work is experimental. Also, please note that bridging a mesh vap with another network interface is not yet supported. Many thanks to the FreeBSD Foundation for sponsoring this project and to Sam Leffler for his support. Also, I would like to thank Gateworks Corporation for sending me a Cambria board which was used during the development of this project. Reviewed by: sam Approved by: re (kensmith) Obtained from: projects/mesh11s
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/nanobsd/gateworks/G23481
-rw-r--r--tools/tools/nanobsd/gateworks/G23581
-rw-r--r--tools/tools/net80211/scripts/config3
-rw-r--r--tools/tools/net80211/scripts/mesh/common13
-rw-r--r--tools/tools/net80211/scripts/mesh/config.mesh17
-rw-r--r--tools/tools/net80211/scripts/mesh/setup.simple13
-rw-r--r--tools/tools/net80211/scripts/mesh/topology.line38
-rw-r--r--tools/tools/net80211/scripts/mesh/topology.ring40
-rw-r--r--tools/tools/net80211/scripts/mesh/topology.star38
-rw-r--r--tools/tools/net80211/scripts/mesh/topology.tree47
-rw-r--r--tools/tools/net80211/wlanstats/wlanstats.c42
11 files changed, 252 insertions, 1 deletions
diff --git a/tools/tools/nanobsd/gateworks/G2348 b/tools/tools/nanobsd/gateworks/G2348
index b33d3e5..cc691ad 100644
--- a/tools/tools/nanobsd/gateworks/G2348
+++ b/tools/tools/nanobsd/gateworks/G2348
@@ -93,6 +93,7 @@ device random # Entropy device
device wlan # 802.11 support
options IEEE80211_DEBUG # enable debugging msgs
options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
+options IEEE80211_SUPPORT_MESH
options IEEE80211_SUPPORT_TDMA
device wlan_wep # 802.11 WEP support
device wlan_ccmp # 802.11 CCMP support
diff --git a/tools/tools/nanobsd/gateworks/G2358 b/tools/tools/nanobsd/gateworks/G2358
index c7a9431..487b268 100644
--- a/tools/tools/nanobsd/gateworks/G2358
+++ b/tools/tools/nanobsd/gateworks/G2358
@@ -94,6 +94,7 @@ device random # Entropy device
device wlan # 802.11 support
options IEEE80211_DEBUG # enable debugging msgs
options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
+options IEEE80211_SUPPORT_MESH
options IEEE80211_SUPPORT_TDMA
device wlan_wep # 802.11 WEP support
device wlan_ccmp # 802.11 CCMP support
diff --git a/tools/tools/net80211/scripts/config b/tools/tools/net80211/scripts/config
index e501bc0..aa502e1 100644
--- a/tools/tools/net80211/scripts/config
+++ b/tools/tools/net80211/scripts/config
@@ -49,6 +49,9 @@ test -z "$WPA_PASSPHRASE" && WPA_PASSPHRASE='I am not a geek'
# default ssid for ap vaps
test -z "$SSID" && SSID=freebsd-ap
+# default meshid for mesh vaps
+test -z "$MESHID" && MESHID=freebsd-mesh
+
# directory to create files like hostapd.conf
test -z "$TMPDIR" && TMPDIR=.
diff --git a/tools/tools/net80211/scripts/mesh/common b/tools/tools/net80211/scripts/mesh/common
new file mode 100644
index 0000000..a8816a2
--- /dev/null
+++ b/tools/tools/net80211/scripts/mesh/common
@@ -0,0 +1,13 @@
+#! /bin/sh
+#
+# Common setup.
+#
+# $FreeBSD$
+#
+PATH=../:.:$PATH
+. config
+. config.mesh
+
+WLAN=`ifconfig wlan create wlanmode mesh wlandev $WIRELESS`
+ifconfig $WLAN meshid $MESHID channel $CHANNEL mtu 1500
+wlandebug -i $WLAN mesh+hwmp+state+scan+assoc
diff --git a/tools/tools/net80211/scripts/mesh/config.mesh b/tools/tools/net80211/scripts/mesh/config.mesh
new file mode 100644
index 0000000..c144218
--- /dev/null
+++ b/tools/tools/net80211/scripts/mesh/config.mesh
@@ -0,0 +1,17 @@
+#
+# Common configuration settings for mesh test scripts.
+#
+# $FreeBSD$
+#
+
+NODE1_IP=10.0.1.100
+NODE2_IP=10.0.1.101
+NODE3_IP=10.0.1.102
+NODE4_IP=10.0.1.103
+NODE5_IP=10.0.1.104
+
+NODE1_MAC=00:0b:6b:2d:dc:d8
+NODE2_MAC=00:0b:6b:2d:db:ac
+NODE3_MAC=00:0b:6b:2d:dd:17
+NODE4_MAC=00:0b:6b:87:1c:f0
+NODE5_MAC=00:14:a5:33:33:a7
diff --git a/tools/tools/net80211/scripts/mesh/setup.simple b/tools/tools/net80211/scripts/mesh/setup.simple
new file mode 100644
index 0000000..ee7b56e
--- /dev/null
+++ b/tools/tools/net80211/scripts/mesh/setup.simple
@@ -0,0 +1,13 @@
+#! /bin/sh
+#
+# Script for creating a simple Mesh Point.
+# Topology is fully connected if every node is a neighbor of each other.
+#
+# $FreeBSD$
+#
+PATH=../:.:$PATH
+. config
+. config.mesh
+
+. common
+ifconfig $WLAN up
diff --git a/tools/tools/net80211/scripts/mesh/topology.line b/tools/tools/net80211/scripts/mesh/topology.line
new file mode 100644
index 0000000..695f8bd
--- /dev/null
+++ b/tools/tools/net80211/scripts/mesh/topology.line
@@ -0,0 +1,38 @@
+#! /bin/sh
+#
+# Script for creating a mesh in line topology.
+#
+# node1 <-> node2 <-> node3 <-> node4 <-> node5
+#
+# $FreeBSD$
+#
+PATH=../:.:$PATH
+. config
+. config.mesh
+
+. common
+ifconfig $WLAN mac:allow
+MAC=`ifconfig $WLAN | grep ether | awk '{ print $2 }'`
+case $MAC in
+ $NODE1_MAC)
+ ifconfig $WLAN inet $NODE1_IP
+ ifconfig $WLAN mac:add $NODE2_MAC
+ ;;
+ $NODE2_MAC)
+ ifconfig $WLAN inet $NODE2_IP
+ ifconfig $WLAN mac:add $NODE1_MAC mac:add $NODE3_MAC
+ ;;
+ $NODE3_MAC)
+ ifconfig $WLAN inet $NODE3_IP
+ ifconfig $WLAN mac:add $NODE2_MAC mac:add $NODE4_MAC
+ ;;
+ $NODE4_MAC)
+ ifconfig $WLAN inet $NODE4_IP
+ ifconfig $WLAN mac:add $NODE3_MAC mac:add $NODE5_MAC
+ ;;
+ $NODE5_MAC)
+ ifconfig $WLAN inet $NODE5_IP
+ ifconfig $WLAN mac:add $NODE4_MAC
+ ;;
+esac
+ifconfig $WLAN up
diff --git a/tools/tools/net80211/scripts/mesh/topology.ring b/tools/tools/net80211/scripts/mesh/topology.ring
new file mode 100644
index 0000000..1810f3c
--- /dev/null
+++ b/tools/tools/net80211/scripts/mesh/topology.ring
@@ -0,0 +1,40 @@
+#! /bin/sh
+#
+# Script for creating a mesh in ring topology.
+#
+# node1 - node2 - node3 - node4 - node5
+# ^ |
+# \-------------------------------
+#
+# $FreeBSD$
+#
+PATH=../:.:$PATH
+. config
+. config.mesh
+
+. common
+ifconfig $WLAN mac:allow
+MAC=`ifconfig $WLAN | grep ether | awk '{ print $2 }'`
+case $MAC in
+ $NODE1_MAC)
+ ifconfig $WLAN inet $NODE1_IP
+ ifconfig $WLAN mac:add $NODE2_MAC mac:add $NODE5_MAC
+ ;;
+ $NODE2_MAC)
+ ifconfig $WLAN inet $NODE2_IP
+ ifconfig $WLAN mac:add $NODE1_MAC mac:add $NODE3_MAC
+ ;;
+ $NODE3_MAC)
+ ifconfig $WLAN inet $NODE3_IP
+ ifconfig $WLAN mac:add $NODE2_MAC mac:add $NODE4_MAC
+ ;;
+ $NODE4_MAC)
+ ifconfig $WLAN inet $NODE4_IP
+ ifconfig $WLAN mac:add $NODE3_MAC mac:add $NODE5_MAC
+ ;;
+ $NODE5_MAC)
+ ifconfig $WLAN inet $NODE5_IP
+ ifconfig $WLAN mac:add $NODE1_MAC mac:add $NODE4_MAC
+ ;;
+esac
+ifconfig $WLAN up
diff --git a/tools/tools/net80211/scripts/mesh/topology.star b/tools/tools/net80211/scripts/mesh/topology.star
new file mode 100644
index 0000000..a7396a0
--- /dev/null
+++ b/tools/tools/net80211/scripts/mesh/topology.star
@@ -0,0 +1,38 @@
+#! /bin/sh
+#
+# Script for creating a mesh in star topology.
+# Node 3 will be the center.
+#
+# $FreeBSD$
+#
+PATH=../:.:$PATH
+. config
+. config.mesh
+
+. common
+ifconfig $WLAN mac:allow
+MAC=`ifconfig $WLAN | grep ether | awk '{ print $2 }'`
+case $MAC in
+ $NODE1_MAC)
+ ifconfig $WLAN inet $NODE1_IP
+ ifconfig $WLAN mac:add $NODE3_MAC
+ ;;
+ $NODE2_MAC)
+ ifconfig $WLAN inet $NODE2_IP
+ ifconfig $WLAN mac:add $NODE3_MAC
+ ;;
+ $NODE3_MAC)
+ ifconfig $WLAN inet $NODE3_IP
+ ifconfig $WLAN mac:add $NODE1_MAC mac:add $NODE2_MAC mac:add \
+ $NODE4_MAC mac:add $NODE5_MAC
+ ;;
+ $NODE4_MAC)
+ ifconfig $WLAN inet $NODE4_IP
+ ifconfig $WLAN mac:add $NODE3_MAC
+ ;;
+ $NODE5_MAC)
+ ifconfig $WLAN inet $NODE5_IP
+ ifconfig $WLAN mac:add $NODE3_MAC
+ ;;
+esac
+ifconfig $WLAN up
diff --git a/tools/tools/net80211/scripts/mesh/topology.tree b/tools/tools/net80211/scripts/mesh/topology.tree
new file mode 100644
index 0000000..9a2ed32
--- /dev/null
+++ b/tools/tools/net80211/scripts/mesh/topology.tree
@@ -0,0 +1,47 @@
+#! /bin/sh
+#
+# Script for creating a mesh in tree (hirearchical) topology.
+#
+# node1
+# ^
+# |
+# / \
+# v v
+# node2 node3
+# ^ ^
+# | |
+# v v
+# node4 node5
+#
+# $FreeBSD$
+#
+PATH=../:.:$PATH
+. config
+. config.mesh
+
+. common
+ifconfig $WLAN mac:allow
+MAC=`ifconfig $WLAN | grep ether | awk '{ print $2 }'`
+case $MAC in
+ $NODE1_MAC)
+ ifconfig $WLAN inet $NODE1_IP
+ ifconfig $WLAN mac:add $NODE2_MAC mac:add $NODE3_MAC
+ ;;
+ $NODE2_MAC)
+ ifconfig $WLAN inet $NODE2_IP
+ ifconfig $WLAN mac:add $NODE1_MAC mac:add $NODE4_MAC
+ ;;
+ $NODE3_MAC)
+ ifconfig $WLAN inet $NODE3_IP
+ ifconfig $WLAN mac:add $NODE1_MAC mac:add $NODE5_MAC
+ ;;
+ $NODE4_MAC)
+ ifconfig $WLAN inet $NODE4_IP
+ ifconfig $WLAN mac:add $NODE2_MAC
+ ;;
+ $NODE5_MAC)
+ ifconfig $WLAN inet $NODE5_IP
+ ifconfig $WLAN mac:add $NODE3_MAC
+ ;;
+esac
+ifconfig $WLAN up
diff --git a/tools/tools/net80211/wlanstats/wlanstats.c b/tools/tools/net80211/wlanstats/wlanstats.c
index dd8e106..1d4ef33 100644
--- a/tools/tools/net80211/wlanstats/wlanstats.c
+++ b/tools/tools/net80211/wlanstats/wlanstats.c
@@ -322,7 +322,27 @@ static const struct fmt wlanstats[] = {
{ 4, "ht_downgrade", "ht_downgrade", "HT station downgraded to legacy operation" },
#define S_HT_ASSOC_NORATE AFTER(S_HT_ASSOC_DOWNGRADE)
{ 4, "ht_norate", "ht_norate", "HT station rejected because of HT rate set" },
-#define S_INPUT AFTER(S_HT_ASSOC_NORATE)
+#define S_MESH_WRONGMESH AFTER(S_HT_ASSOC_NORATE)
+ { 4, "mesh_wrong", "mesh_wrong", "frame discarded because sender not a mesh sta" },
+#define S_MESH_NOLINK AFTER(S_MESH_WRONGMESH)
+ { 4, "mesh_nolink", "mesh_nolink", "frame discarded because link not established" },
+#define S_MESH_FWD_TTL AFTER(S_MESH_NOLINK)
+ { 4, "mesh_fwd_ttl", "mesh_fwd_ttl", "frame not forwarded because TTL zero" },
+#define S_MESH_FWD_NOBUF AFTER(S_MESH_FWD_TTL)
+ { 4, "mesh_fwd_nobuf", "mesh_fwd_nobuf", "frame not forwarded because mbuf could not be allocated" },
+#define S_MESH_FWD_TOOSHORT AFTER(S_MESH_FWD_NOBUF)
+ { 4, "mesh_fwd_tooshort", "mesh_fwd_tooshort", "frame not forwarded because too short to have 802.11 header" },
+#define S_MESH_FWD_DISABLED AFTER(S_MESH_FWD_TOOSHORT)
+ { 4, "mesh_fwd_disabled", "mesh_fwd_disabled", "frame not forwarded because administratively disabled" },
+#define S_MESH_FWD_NOPATH AFTER(S_MESH_FWD_DISABLED)
+ { 4, "mesh_fwd_nopath", "mesh_fwd_nopath", "frame not forwarded because no path found to destination" },
+#define S_HWMP_WRONGSEQ AFTER(S_MESH_FWD_NOPATH)
+ { 4, "hwmp_wrongseq", "hwmp_wrongseq", "frame discarded because mesh sequence number is invalid" },
+#define S_HWMP_ROOTREQS AFTER(S_HWMP_WRONGSEQ)
+ { 4, "hwmp_rootreqs", "hwmp_rootreqs", "root PREQ frames sent" },
+#define S_HWMP_ROOTANN AFTER(S_HWMP_ROOTREQS)
+ { 4, "hwmp_rootann", "hwmp_rootann", "root RANN frames received" },
+#define S_INPUT AFTER(S_HWMP_ROOTANN)
{ 8, "input", "input", "total data frames received" },
#define S_RX_UCAST AFTER(S_INPUT)
{ 8, "rx_ucast", "rx_ucast", "unicast data frames received" },
@@ -766,6 +786,16 @@ wlan_get_curstat(struct statfoo *sf, int s, char b[], size_t bs)
case S_HT_ASSOC_NOHTCAP:STAT(ht_assoc_nohtcap);
case S_HT_ASSOC_DOWNGRADE:STAT(ht_assoc_downgrade);
case S_HT_ASSOC_NORATE: STAT(ht_assoc_norate);
+ case S_MESH_WRONGMESH: STAT(mesh_wrongmesh);
+ case S_MESH_NOLINK: STAT(mesh_nolink);
+ case S_MESH_FWD_TTL: STAT(mesh_fwd_ttl);
+ case S_MESH_FWD_NOBUF: STAT(mesh_fwd_nobuf);
+ case S_MESH_FWD_TOOSHORT: STAT(mesh_fwd_tooshort);
+ case S_MESH_FWD_DISABLED: STAT(mesh_fwd_disabled);
+ case S_MESH_FWD_NOPATH: STAT(mesh_fwd_nopath);
+ case S_HWMP_WRONGSEQ: STAT(hwmp_wrongseq);
+ case S_HWMP_ROOTREQS: STAT(hwmp_rootreqs);
+ case S_HWMP_ROOTANN: STAT(hwmp_rootrann);
case S_INPUT: NSTAT(rx_data);
case S_OUTPUT: NSTAT(tx_data);
case S_RX_UCAST: NSTAT(rx_ucast);
@@ -910,6 +940,16 @@ wlan_get_totstat(struct statfoo *sf, int s, char b[], size_t bs)
case S_HT_ASSOC_NOHTCAP:STAT(ht_assoc_nohtcap);
case S_HT_ASSOC_DOWNGRADE:STAT(ht_assoc_downgrade);
case S_HT_ASSOC_NORATE: STAT(ht_assoc_norate);
+ case S_MESH_WRONGMESH: STAT(mesh_wrongmesh);
+ case S_MESH_NOLINK: STAT(mesh_nolink);
+ case S_MESH_FWD_TTL: STAT(mesh_fwd_ttl);
+ case S_MESH_FWD_NOBUF: STAT(mesh_fwd_nobuf);
+ case S_MESH_FWD_TOOSHORT: STAT(mesh_fwd_tooshort);
+ case S_MESH_FWD_DISABLED: STAT(mesh_fwd_disabled);
+ case S_MESH_FWD_NOPATH: STAT(mesh_fwd_nopath);
+ case S_HWMP_WRONGSEQ: STAT(hwmp_wrongseq);
+ case S_HWMP_ROOTREQS: STAT(hwmp_rootreqs);
+ case S_HWMP_ROOTANN: STAT(hwmp_rootrann);
case S_INPUT: NSTAT(rx_data);
case S_OUTPUT: NSTAT(tx_data);
case S_RX_UCAST: NSTAT(rx_ucast);
OpenPOWER on IntegriCloud