Hello World¶
This is the Experiment Description (ED) for the "Hello World" simple experiment.
Note: In this experiment, nodes are referred to by their [x,y] co-ordinates. This notation for referring to nodes in scripts is historical, and based on the fact that resources used to be organized in a 20 x 20 grid. This is still the case at WINLAB. However, the resources at NICTA are not organized in a grid. Note that some of the tutorials still use the (x,y) cor-ordinate notation to refer to the resources. OMF code is being updated to support a flat numbering system to reference resources in experiments.
1 #
2 # A) Define the 'source' group, which has the unique node [1,1]
3 # Nodes in this group will execute the application 'test:proto:udp_sender'
4 #
5 defGroup('source', [1,1]) {|node|
6
7 node.prototype("test:proto:udp_sender", {
8 'destinationHost' => '192.168.0.2',
9 'localHost' => '192.168.0.1',
10 'packetSize' => 256, # in Bytes
11 'rate' => 8192 # in bits/sec
12
13 })
14
15 # mode can be 'adhoc' or 'managed' or 'master'
16 node.net.w0.mode = "master"
17 }
18
19 #
20 # B) Define the 'sink' group, which has the unique node [1,2]
21 # Nodes in this group will execute the application 'test:proto:udp_receiver'
22 #
23 defGroup('sink', [1,2]) {|node|
24
25 node.prototype("test:proto:udp_receiver" , {
26 'localHost' => '192.168.0.2'
27 })
28
29 # mode can be 'adhoc' or 'managed' or 'master'
30 node.net.w0.mode = "managed"
31 }
32
33 #
34 # C) Configure the wireless interfaces of All the Nodes involved in
35 # this experiment
36 #
37 allGroups.net.w0 { |w|
38 w.type = 'g'
39 w.channel = "6"
40 w.essid = "helloworld"
41 w.ip = "%192.168.0.%y" # the '%' triggers some substitutions
42 }
43
44 #
45 # D) When all the nodes are turned On and the all the applications
46 # are installed and ready, we can start to perform the experiment
47 #
48 whenAllInstalled() {|node|
49
50 wait 30
51
52 allGroups.startApplications
53 wait 20
54
55 Experiment.done
56 }
Click here to go back to the tutorial.