wireless.html 7.07 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
<!--
   EMULAB-COPYRIGHT
   Copyright (c) 2004 University of Utah and the Flux Group.
   All rights reserved.
  -->
<center>
<h2>Emulab Tutorial - Using Wireless Nodes</h2>
</center>

Some Emulab nodes may contain wireless interfaces, and those nodes may
be scattered around at various locations. To find out where those
nodes are located and what their node IDs are, see the <a
Leigh B. Stoller's avatar
Leigh B. Stoller committed
13
14
15
16
17
18
href=https://www.emulab.net/floormap.php3>wireless floormaps</a> page.
When you click on one of the colored dots, you will be taken to a page
describing the node and what type of interfaces the node has installed
in it. To use wireless nodes in an experiment, you must provide a few
Emulab specific NS directives in your NS file, which are illustrated
in the following small example:
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

	<code><pre>
	source tb_compat.tcl
	set ns [new Simulator]

	# Four wireless capable nodes for a lan.	
	set nodew1 [$ns node]
	set nodew2 [$ns node]
	set nodew3 [$ns node]
	set nodew4 [$ns node]
	# A regular node.
	set node5  [$ns node]

	# A wireless lan.
	set lan0 [$ns make-lan "nodew1 nodew2 nodew3 nodew4" 54Mb 0ms]

	# A regular duplex link from a wireless capable node to a plain node.
	set link0 [$ns duplex-link $nodew1 $node5 100Mb 0ms DropTail]

	# Choose the lan protocol.
39
	tb-set-lan-protocol $lan0 "80211g"
40
41
42
43
44
45
46
47
48

	# You must choose which node to act as the access point.
	tb-set-lan-accesspoint $lan0 $nodew1

	# Choose some other settings.
	tb-set-lan-setting $lan0 "channel" 5
	tb-set-node-lan-setting $lan0 $nodew1 "txpower" "auto"

	# You must use Redhat 9.0 on wireless capable nodes.
49
50
51
52
	tb-set-node-os $nodew1 RHL90-WIRELESS
	tb-set-node-os $nodew2 RHL90-WIRELESS
	tb-set-node-os $nodew3 RHL90-WIRELESS
	tb-set-node-os $nodew4 RHL90-WIRELESS
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
	tb-set-node-os $node3  FBSD-STD

	# Turn on static routing.
	$ns rtproto Static
	$ns run			</code></pre>

A few points should be noted:
<ul>
<li> <tt>lan0</tt> is created with standard <tt>make-lan</tt>
     directive, but with a bandwidth that reflects the typical speed of a
     wireless link (54Mb for 80211a and 80211g, 11Mb for 80211b). Note that
     you may not use duplex links of wireless interfaces; just lans.

<li> After you create the lan, choose the <em>protocol</em> for the lan
     with the <tt>tb-set-lan-protocol</tt> directive. Currently, you can
     set the protocol to one of <tt>80211a, 80211b, or 80211g.</tt>. If you
     fail to set the protocol, the lan will consist of wired links, most
     likely with delay nodes inserted!

<li> <tt>link0</tt> is a plain duplex link. You may create plain links
     as long as the nodes have enough wired interfaces. If you try to
     create an experiment that uses more links (wired or wireless) on a
     node, the experiment will fail to map.

<li> You must specify which node is to act as the <em>access point</em> for
     the lan.  Rather then using dedicated access points, Emulab's
     implementation of wireless lans uses the interface's capability to
     become an access point for a lan. The node that is choosen to be the
     access point should obviously be within range of all of the nodes in
     the lan. There is currently no automated mechanism to pick the access
     point for you, but one is planned for the future.

<li> Wireless lans allow a number of configuration parameters to be
     specified, either for the lan as a whole, or for individual members of
     a lan. There are two Emulab specific directives that you can use;
     <tt>tb-set-lan-setting</tt> sets a configuration parameter for the
     entire lan. In the example above, we set the channel to be used for
     the lan to channel five. Per-node settings can be specified with the
     <tt>tb-set-node-lan-setting</tt> directive. In the example, we set the
     transmit power for <tt>nodew1</tt> to auto; all other nodes will
     default to an interface specific setting.

<li> You must use Redhat 9.0 to take advantage of wireless interfaces. Be
     sure to set the OSID for all of your wireless nodes to
97
     <tt>RHL90-WIRELESS</tt>.
98
99
100
101
102
103
104
105
106
107
108
109
110
</ul>

Numerous interface settings are possible using <tt>tb-set-lan-setting</tt>
and <tt>tb-set-node-lan-setting</tt>. These mostly correspond to options
that are available using the <tt>iwconfig</tt> command on Redhat 9.0. Not
all options are accepted by all cards, and the format of the value you
provide for the option must be acceptable to iwconfig. At some point in the
future we hope to make this more explicit so that know exactly what options
are available each type of card, and what their legal values are. For now
you have to be something of an expert. Here is a rough guide to what you
can currently specify:

<ul>
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<li> <tt>channel</tt> - Set the channel for the lan to either a
     channel number or a frequency. If you do not set the channel one
     will be choosen for you, and thats probably just as bad as
     setting it yourself without knowing what other people are using!

<li> <tt>rate</tt> - Some interfaces support setting a bit rate
     different then the default. The default is to tell the interface
     to use "auto" mode (varies the rate according to RF conditions),
     but you can specify a specific rate for either the entire lan or
     for just one node. The value should be in bits per second with no
     units (11000, 54000, etc). See the iwconfig man page for more
     details on the format of this option. 

<li> <tt>txpower</tt> - Some interfaces support setting the transmit
     power to something different then the default. The default is to
     tell the interface to use "auto" mode. See the iwconfig man page
     for more details on the format of this option. Not all interfaces
     support this option. 
     
<li> <tt>sensitivity</tt> - Some interfaces support setting the sensitivity
     to something different then the default. The default is to
     tell the interface to use "auto" mode. See the iwconfig man page
     for more details on the format of this option. Not all interfaces
     support this option. 
135
</ul>
Leigh B. Stoller's avatar
Leigh B. Stoller committed
136

137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
After your experiment is swapped in, the above settings (including the
accesspoint) can be changed on the fly, using either the
<tt>link_config</tt> script on <tt>users.emulab.net</tt>, or with the
XMLRPC interface. For example, if you want to change the accesspoint
of a lan, first determine the MAC address (dotted or undotted notation
is fine) of the interface you want to be the accesspoint, and then use
link_config:

<code><pre>
	link_config myproj myexp lan0 accesspoint=00:09:5B:94:26:AF
</code></pre>

Or you can use the <a href=../xmlrpcapi.php3>XMLRPC interface</a> from
your desktop or from <tt>users</tt>.

<code><pre>
	sshxmlrpc_client.py link_config proj=myproj exp=myexp
		link=lan0 "params={'accesspoint': '00:09:5B:94:26:AF'}"
</code></pre>
Leigh B. Stoller's avatar
Leigh B. Stoller committed
156
157
158
159
160
161
162
163
164
165
166
167
168
169

You may also change the settings for an individual node in a wireless
lan (although in some cases this could make the lan unusable if you
were to change a setting on just a single node). To do this, use the
<tt>-s</tt> option to link_config or the <tt>src</tt> argument to the
XMLRPC interface:

<code><pre>
	link_config -s nodew1 myproj myexp lan0 txpower=50

	sshxmlrpc_client.py link_config proj=myproj exp=myexp
		src=nodew1 link=lan0 "params={'txpower': 50}"
</code></pre>