omf_ec 6.0.0.pre.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Rakefile +7 -0
- data/bin/omf_test +161 -0
- data/config/ec.yml +164 -0
- data/exp_repo/system/exp/eventlib.rb +96 -0
- data/exp_repo/system/exp/imageNode.rb +283 -0
- data/exp_repo/system/exp/reset.rb +21 -0
- data/exp_repo/system/exp/saveNode.rb +99 -0
- data/exp_repo/system/exp/stat.rb +49 -0
- data/exp_repo/system/exp/stdlib.rb +122 -0
- data/exp_repo/system/exp/tell.rb +53 -0
- data/exp_repo/system/exp/testlib.rb +12 -0
- data/exp_repo/system/exp/winlib.rb +154 -0
- data/exp_repo/system/topo/active.rb +9 -0
- data/exp_repo/system/topo/all.rb +10 -0
- data/exp_repo/system/topo/circle.rb +23 -0
- data/exp_repo/test/app/aodvd.rb +73 -0
- data/exp_repo/test/app/appDef1.rb +102 -0
- data/exp_repo/test/app/athstats.rb +76 -0
- data/exp_repo/test/app/echo.rb +36 -0
- data/exp_repo/test/app/gennyReceiverAppDef.rb +100 -0
- data/exp_repo/test/app/gennySenderAppDef.rb +106 -0
- data/exp_repo/test/app/itgdec.rb +79 -0
- data/exp_repo/test/app/itgr.rb +77 -0
- data/exp_repo/test/app/itgs.rb +105 -0
- data/exp_repo/test/app/nop.rb +36 -0
- data/exp_repo/test/app/otg2.rb +68 -0
- data/exp_repo/test/app/otg2_mp.rb +56 -0
- data/exp_repo/test/app/otr2.rb +56 -0
- data/exp_repo/test/app/otr2_mp.rb +51 -0
- data/exp_repo/test/app/trace_oml2.rb +62 -0
- data/exp_repo/test/app/wlanconfig_oml2.rb +42 -0
- data/exp_repo/test/exp/conf-room-demo.rb +118 -0
- data/exp_repo/test/exp/planetlab.rb +82 -0
- data/exp_repo/test/exp/test01.rb +42 -0
- data/exp_repo/test/exp/test02.rb +60 -0
- data/exp_repo/test/exp/test03.rb +95 -0
- data/exp_repo/test/exp/test04.rb +105 -0
- data/exp_repo/test/exp/test05.rb +87 -0
- data/exp_repo/test/exp/test06.rb +71 -0
- data/exp_repo/test/exp/tutorial/hello-world-wired.rb +79 -0
- data/exp_repo/test/exp/tutorial/hello-world-wireless.rb +87 -0
- data/exp_repo/test/exp/tutorial/using-filters.rb +69 -0
- data/exp_repo/test/exp/tutorial/using-groups.rb +64 -0
- data/exp_repo/test/exp/tutorial/using-properties.rb +93 -0
- data/exp_repo/test/exp/tutorial/using-prototypes.rb +111 -0
- data/exp_repo/test/proto/aodvrouter.rb +55 -0
- data/exp_repo/test/proto/driverqueryapp.rb +59 -0
- data/exp_repo/test/proto/forwarder.rb +73 -0
- data/exp_repo/test/proto/itgcbrsender.rb +70 -0
- data/exp_repo/test/proto/itgdecoder.rb +64 -0
- data/exp_repo/test/proto/itgreceiver.rb +55 -0
- data/exp_repo/test/proto/itgvoipsender.rb +64 -0
- data/exp_repo/test/proto/listener2.rb +62 -0
- data/exp_repo/test/proto/nop.rb +47 -0
- data/exp_repo/test/proto/probelink.rb +48 -0
- data/exp_repo/test/proto/raw_receiver.rb +64 -0
- data/exp_repo/test/proto/receiver2_mp.rb +48 -0
- data/exp_repo/test/proto/sender2_mp.rb +54 -0
- data/exp_repo/test/proto/udp_receiver.rb +55 -0
- data/exp_repo/test/proto/udp_sender.rb +61 -0
- data/lib/omf_ec/version.rb +3 -0
- data/lib/omf_ec.rb +5 -0
- data/omf_ec.gemspec +24 -0
- metadata +145 -0
@@ -0,0 +1,154 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2006-2009 National ICT Australia (NICTA), Australia
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
21
|
+
#
|
22
|
+
#
|
23
|
+
# = winlib.rb
|
24
|
+
#
|
25
|
+
# == Description
|
26
|
+
#
|
27
|
+
# THIS IS FOR WINLAB ONLY
|
28
|
+
#
|
29
|
+
# To use the old OMF 5.2 syntax for node description (e.g. [x,y])
|
30
|
+
# - load this file in your experiment
|
31
|
+
# - rename your 'defTopology' in your experiment by 'defTopology52'
|
32
|
+
# - rename your 'defGroup' in your experiment by 'defGroup52'
|
33
|
+
# See the examples of use in the test section at the end of this file
|
34
|
+
#
|
35
|
+
|
36
|
+
|
37
|
+
# THIS IS FOR WINLAB ONLY
|
38
|
+
# Return a HRN for a resource based on:
|
39
|
+
# - its [x,y] coordinates
|
40
|
+
# - the testbed console on which this experiment is currently being executed
|
41
|
+
# - a fixed PREFIX
|
42
|
+
# e.g. if console's hostname is 'console.grid.orbit-lab.org' and prefix is 'node'
|
43
|
+
# and the resource is at coordinate [1,2]
|
44
|
+
# then the returned HRN is 'node1-2.grid.orbit-lab.org'
|
45
|
+
#
|
46
|
+
HRN_PREFIX='node'
|
47
|
+
@@hrnSuffix = nil
|
48
|
+
def hrn(x,y)
|
49
|
+
@@hrnSuffix = `hostname`.chomp!.split('console')[1] if @@hrnSuffix.nil?
|
50
|
+
raise "Translating 5.2 resource syntax to 5.3 one. "+
|
51
|
+
"Cannot figure out which WINLAB console we are running on! " +
|
52
|
+
"(hostname: #{`hostname`})" if @@hrnSuffix.nil?
|
53
|
+
return "#{HRN_PREFIX}#{x}-#{y}#{@@hrnSuffix}"
|
54
|
+
end
|
55
|
+
|
56
|
+
# THIS IS FOR WINLAB ONLY
|
57
|
+
# Turns a list of node in the 5.2 [x,y] syntax into a list of 5.3 HRN
|
58
|
+
# (this code is from the 5.2. Topology class)
|
59
|
+
#
|
60
|
+
def turn_52_to_53(nodes)
|
61
|
+
list = []
|
62
|
+
if ! nodes[0].kind_of?(Array)
|
63
|
+
# Array should contain two ranges
|
64
|
+
return [] if nodes.length != 2
|
65
|
+
x = nodes[0]
|
66
|
+
if x.kind_of?(Integer)
|
67
|
+
x = [x]
|
68
|
+
elsif x.kind_of?(ExperimentProperty)
|
69
|
+
x = [x.value]
|
70
|
+
end
|
71
|
+
y = nodes[1]
|
72
|
+
if y.kind_of?(Integer)
|
73
|
+
y = [y]
|
74
|
+
elsif y.kind_of?(ExperimentProperty)
|
75
|
+
y = [y.value]
|
76
|
+
end
|
77
|
+
# Expected two range declarations, but found #{nodes.join(', ')}."
|
78
|
+
return [] if ! ((x.kind_of?(Range) || x.kind_of?(Array)) && (y.kind_of?(Array) || y.kind_of?(Range)))
|
79
|
+
x.each { |i| y.each {|j| list << hrn(i, j) } }
|
80
|
+
else
|
81
|
+
nodes.each {|n| list << turn_52_to_53(n) }
|
82
|
+
end
|
83
|
+
return list
|
84
|
+
end
|
85
|
+
|
86
|
+
# THIS IS FOR WINLAB ONLY
|
87
|
+
# Turns a group/topology selector from the 5.2 to the 5.3 format
|
88
|
+
# If the format change is not possible, returns the original selector
|
89
|
+
#
|
90
|
+
def process_selector(selector)
|
91
|
+
resources = nil
|
92
|
+
# Make sure we use the selector's value if it's an Experiment Property
|
93
|
+
selector = selector.value if selector.kind_of?(ExperimentProperty)
|
94
|
+
# If this is a 5.2 selector then turn it into a 5.3 one
|
95
|
+
if selector.kind_of?(Array)
|
96
|
+
# Add a single resource
|
97
|
+
if (selector.length == 2 && selector[0].kind_of?(Integer) && selector[1].kind_of?(Integer))
|
98
|
+
resources = [hrn(selector[0],selector[1])]
|
99
|
+
# Add a many resource
|
100
|
+
else
|
101
|
+
resources = turn_52_to_53(selector)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
# If the 5.2 to 5.3 process did not succeed, then use the original selector
|
105
|
+
sel = (!resources.nil? && !resources.empty?) ? resources.join(',') : selector
|
106
|
+
return sel
|
107
|
+
end
|
108
|
+
|
109
|
+
# THIS IS FOR WINLAB ONLY
|
110
|
+
# Provide a new 'defGroup52' method which accept 5.3 node coordinate syntax,
|
111
|
+
# turns them into 5.3 HRN syntax and call the 5.3 defGroup with it
|
112
|
+
#
|
113
|
+
def defGroup52(groupName, selector = nil, &block)
|
114
|
+
sel = process_selector(selector)
|
115
|
+
#puts ">>> s: '#{selector}'" ; puts ">>> r: '#{sel}'"
|
116
|
+
OMF::EC::CmdContext.instance.defGroup(groupName, sel, &block)
|
117
|
+
end
|
118
|
+
|
119
|
+
# THIS IS FOR WINLAB ONLY
|
120
|
+
# Provide a new 'defTopology52' method which accept 5.3 node coordinate syntax,
|
121
|
+
# turns them into 5.3 HRN syntax and call the 5.3 defTopology with it
|
122
|
+
#
|
123
|
+
def defTopology52(topoName, selector = nil, &block)
|
124
|
+
sel = process_selector(selector)
|
125
|
+
#puts ">>> s: '#{selector.inspect}'" ; puts ">>> r: '#{sel}'"
|
126
|
+
OMF::EC::CmdContext.instance.defTopology(topoName, sel, &block)
|
127
|
+
end
|
128
|
+
|
129
|
+
#
|
130
|
+
# Testing Topology: uncomment below and run with "omf-5.3 exec winlib.rb"
|
131
|
+
#
|
132
|
+
#defTopology52('topo1', [2,3])
|
133
|
+
#defTopology52('topo2', [[2,3],[4,5],[6,7]])
|
134
|
+
#defTopology52('topo3', [1..2,4..5])
|
135
|
+
#defTopology52('topo4', [[1..2,4..5],[6,7],[8,9]])
|
136
|
+
#defProperty('res2', [1..2,1..2], "Some nodes")
|
137
|
+
#defTopology52('topo5', property.res2)
|
138
|
+
#(1..5).each { |i|
|
139
|
+
# puts "Content of Topology: topo#{i}"
|
140
|
+
# Topology["topo#{i}"].eachNode { |n| puts "- #{n}" }
|
141
|
+
#}
|
142
|
+
#Experiment.done
|
143
|
+
|
144
|
+
#
|
145
|
+
# Testing Groups: uncomment below and run with "omf-5.3 exec winlib.rb"
|
146
|
+
#
|
147
|
+
#defGroup52('group1', [2,3])
|
148
|
+
#defGroup52('group2', [[2,3],[4,5],[6,7]])
|
149
|
+
#defGroup52('group3', [1..2,4..5])
|
150
|
+
#defGroup52('group4', [[1..2,4..5],[6,7],[8,9]])
|
151
|
+
#defProperty('res1', [1..2,1..2], "Some nodes")
|
152
|
+
#defGroup52('group5', property.res1)
|
153
|
+
#defGroup52('group6', ['group1','group2'])
|
154
|
+
#Experiment.done
|
@@ -0,0 +1,23 @@
|
|
1
|
+
defProperty('radius', 8, "Circle radius")
|
2
|
+
defProperty('xCenter', 10, "x coordinate of circle center")
|
3
|
+
defProperty('yCenter', 10, "y coordinate of circle center")
|
4
|
+
|
5
|
+
# nodes arranged in a circle
|
6
|
+
defTopology('system:topo:circle') { |t|
|
7
|
+
puts "<#{t}>"
|
8
|
+
# use simple 4-way algorithm
|
9
|
+
radius = prop.radius.value
|
10
|
+
xCenter = prop.xCenter.value
|
11
|
+
yCenter = prop.yCenter.value
|
12
|
+
|
13
|
+
r2 = radius * radius
|
14
|
+
t.addNode(xCenter, yCenter + radius)
|
15
|
+
t.addNode(xCenter, yCenter - radius)
|
16
|
+
(1..radius).each { |x|
|
17
|
+
y = (Math.sqrt(r2 - x*x) + 0.5).to_i
|
18
|
+
t.addNode(xCenter + x, yCenter + y)
|
19
|
+
t.addNode(xCenter + x, yCenter - y)
|
20
|
+
t.addNode(xCenter - x, yCenter + y)
|
21
|
+
t.addNode(xCenter - x, yCenter - y)
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2006-2009 National ICT Australia (NICTA), Australia
|
3
|
+
#
|
4
|
+
# Copyright (c) 2004-2009 WINLAB, Rutgers University, USA
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
14
|
+
# all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
# THE SOFTWARE.
|
23
|
+
#
|
24
|
+
#
|
25
|
+
#
|
26
|
+
# Create an application representation from scratch
|
27
|
+
#
|
28
|
+
require 'omf-expctl/application/appDefinition'
|
29
|
+
|
30
|
+
a = AppDefinition.create('test:app:aodvd')
|
31
|
+
a.name = "aodvd"
|
32
|
+
a.version(0, 0, 1)
|
33
|
+
a.shortDescription = "Iperf traffic generator"
|
34
|
+
a.description = <<TEXT
|
35
|
+
Iperf is a traffic generator for TCP and UDP traffic. It contains generators
|
36
|
+
producing various forms of packet streams and port for sending
|
37
|
+
these packets via various transports, such as TCP and UDP.
|
38
|
+
TEXT
|
39
|
+
|
40
|
+
# addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
|
41
|
+
a.addProperty('interface', 'Interface to run on', ?i, :string, false)
|
42
|
+
a.addProperty('log', 'Enable logging', ?l, :string, false)
|
43
|
+
a.addProperty('rttable', 'Log rting table every N secs', ?r, :string, false)
|
44
|
+
|
45
|
+
a.addMeasurement("receiverport", nil, [
|
46
|
+
['flow_no','int'],
|
47
|
+
['throughput',Float],
|
48
|
+
['jitter',Float],
|
49
|
+
['packet_loss',Float]
|
50
|
+
])
|
51
|
+
a.path = "/usr/sbin/aodvd"
|
52
|
+
|
53
|
+
if $0 == __FILE__
|
54
|
+
require 'stringio'
|
55
|
+
require 'rexml/document'
|
56
|
+
include REXML
|
57
|
+
|
58
|
+
sio = StringIO.new()
|
59
|
+
a.to_xml.write(sio, 2)
|
60
|
+
sio.rewind
|
61
|
+
puts sio.read
|
62
|
+
|
63
|
+
sio.rewind
|
64
|
+
doc = Document.new(sio)
|
65
|
+
t = AppDefinition.from_xml(doc.root)
|
66
|
+
|
67
|
+
puts
|
68
|
+
puts "-------------------------"
|
69
|
+
puts
|
70
|
+
t.to_xml.write($stdout, 2)
|
71
|
+
|
72
|
+
end
|
73
|
+
|
@@ -0,0 +1,102 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2006-2009 National ICT Australia (NICTA), Australia
|
3
|
+
#
|
4
|
+
# Copyright (c) 2004-2009 WINLAB, Rutgers University, USA
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
14
|
+
# all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
# THE SOFTWARE.
|
23
|
+
#
|
24
|
+
#
|
25
|
+
#
|
26
|
+
|
27
|
+
# Create an application representation from scratch
|
28
|
+
|
29
|
+
#
|
30
|
+
|
31
|
+
require "appDefinition.rb"
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
a = AppDefinition.create("nodeAgent")
|
38
|
+
|
39
|
+
a.url = "http://apps.orbit-lab.org/nodeAgent"
|
40
|
+
|
41
|
+
a.name = "NodeAgent"
|
42
|
+
|
43
|
+
a.version(0, 0, 1)
|
44
|
+
|
45
|
+
a.shortDescription = "Node Agent"
|
46
|
+
|
47
|
+
a.description = "\
|
48
|
+
|
49
|
+
A node agent is active on every experiment node and communicates through \
|
50
|
+
|
51
|
+
semantic multicast with all other agents in the system. It can control all the resources \
|
52
|
+
|
53
|
+
on a node and can react to commands from the management agent to control \
|
54
|
+
|
55
|
+
the life cycle of experiments on the respective node."
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
# addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
|
60
|
+
|
61
|
+
a.addProperty("channel_id", "Channel to send on", "c", "int", true)
|
62
|
+
|
63
|
+
a.addProperty("payload_length", "Length of payload of packet", "l", "int", true)
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
a.addMeasurement("group1", nil, [
|
70
|
+
|
71
|
+
["rssi", AppMeasurement::FLOAT],
|
72
|
+
|
73
|
+
["noise", AppMeasurement::FLOAT]
|
74
|
+
|
75
|
+
])
|
76
|
+
|
77
|
+
a.addMeasurement("group2", nil, [
|
78
|
+
|
79
|
+
["throughput", AppMeasurement::FLOAT]
|
80
|
+
|
81
|
+
])
|
82
|
+
|
83
|
+
a.addMeasurement("group3", nil, [
|
84
|
+
|
85
|
+
["offered_load", AppMeasurement::FLOAT]
|
86
|
+
|
87
|
+
])
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
a.to_xml.write($stdout, 2)
|
92
|
+
|
93
|
+
puts
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
@@ -0,0 +1,76 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2006-2009 National ICT Australia (NICTA), Australia
|
3
|
+
#
|
4
|
+
# Copyright (c) 2004-2009 WINLAB, Rutgers University, USA
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
14
|
+
# all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
# THE SOFTWARE.
|
23
|
+
#
|
24
|
+
#
|
25
|
+
#
|
26
|
+
# Create an application representation from scratch
|
27
|
+
#
|
28
|
+
require 'omf-expctl/application/appDefinition'
|
29
|
+
|
30
|
+
a = AppDefinition.create('test:app:athstats')
|
31
|
+
a.name = "athstats"
|
32
|
+
a.version(0, 0, 1)
|
33
|
+
a.shortDescription = "Application to gather madwifi driver statistics"
|
34
|
+
a.description = <<TEXT
|
35
|
+
This C application gathers driver statistics and reports them.
|
36
|
+
TEXT
|
37
|
+
|
38
|
+
# addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
|
39
|
+
a.addProperty('interface', 'Use ath0/ath1, ath0 by default', nil, :string, false)
|
40
|
+
a.addProperty('interval', 'Number of msec between calls to query driver', nil, :string, false)
|
41
|
+
|
42
|
+
a.addMeasurement("queryport", nil, [
|
43
|
+
['succ_tx_attempts', 'int'],
|
44
|
+
['fail_xretries', 'int'],
|
45
|
+
['fail_fifoerr', 'int'],
|
46
|
+
['fail_filtered', 'int'],
|
47
|
+
['short_retries', 'int'],
|
48
|
+
['long_retries', 'int'],
|
49
|
+
['total_frames_rcvd', 'int'],
|
50
|
+
['crc_errors', 'int'],
|
51
|
+
['fifo_errors', 'int'],
|
52
|
+
['phy_errors', 'int']
|
53
|
+
])
|
54
|
+
a.path = "/usr/bin/athstats-oml"
|
55
|
+
|
56
|
+
if $0 == __FILE__
|
57
|
+
require 'stringio'
|
58
|
+
require 'rexml/document'
|
59
|
+
include REXML
|
60
|
+
|
61
|
+
sio = StringIO.new()
|
62
|
+
a.to_xml.write(sio, 2)
|
63
|
+
sio.rewind
|
64
|
+
puts sio.read
|
65
|
+
|
66
|
+
sio.rewind
|
67
|
+
doc = Document.new(sio)
|
68
|
+
t = AppDefinition.from_xml(doc.root)
|
69
|
+
|
70
|
+
puts
|
71
|
+
puts "-------------------------"
|
72
|
+
puts
|
73
|
+
t.to_xml.write($stdout, 2)
|
74
|
+
|
75
|
+
end
|
76
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2006-2009 National ICT Australia (NICTA), Australia
|
3
|
+
#
|
4
|
+
# Copyright (c) 2004-2009 WINLAB, Rutgers University, USA
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
14
|
+
# all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
# THE SOFTWARE.
|
23
|
+
#
|
24
|
+
#
|
25
|
+
require 'omf-expctl/application/appDefinition'
|
26
|
+
|
27
|
+
defApplication('test:app:echo', 'echo') { |a|
|
28
|
+
|
29
|
+
a.version(1, 0, 0)
|
30
|
+
a.shortDescription = "The shell Echo command"
|
31
|
+
a.description = <<TEXT
|
32
|
+
echo is a wrapper around the echo shell command.
|
33
|
+
TEXT
|
34
|
+
|
35
|
+
a.path = "/bin/echo"
|
36
|
+
}
|
@@ -0,0 +1,100 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2006-2009 National ICT Australia (NICTA), Australia
|
3
|
+
#
|
4
|
+
# Copyright (c) 2004-2009 WINLAB, Rutgers University, USA
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
14
|
+
# all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
# THE SOFTWARE.
|
23
|
+
#
|
24
|
+
#
|
25
|
+
#
|
26
|
+
|
27
|
+
# Create an application representation from scratch
|
28
|
+
|
29
|
+
#
|
30
|
+
|
31
|
+
require "appDefinition.rb"
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
a = AppDefinition.create("gennyReceiver")
|
36
|
+
|
37
|
+
a.url = "http://apps.orbit-lab.org/gennyReceiver"
|
38
|
+
|
39
|
+
a.name = "gennyReceiver"
|
40
|
+
|
41
|
+
a.version(0, 0, 1)
|
42
|
+
|
43
|
+
a.shortDescription = "Traffic sink"
|
44
|
+
|
45
|
+
a.description = <<TEXT
|
46
|
+
|
47
|
+
Genny Revceiver is the receiving peer of the UDP traffic
|
48
|
+
|
49
|
+
generator that reports measurements such as RSSI, noise
|
50
|
+
|
51
|
+
and throughput. It can be configured to use
|
52
|
+
|
53
|
+
libmac (for RSSI measurement) or plain sockets
|
54
|
+
|
55
|
+
as its underlying transport mechanism.
|
56
|
+
|
57
|
+
TEXT
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
# addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
|
62
|
+
|
63
|
+
a.addProperty(:interface_name, "Interface to send on", ?i, :string, false)
|
64
|
+
|
65
|
+
a.addProperty(:use_socket, "Socket or Libmac", ?s, :boolean, false)
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
a.addMeasurement(:group1, nil, [
|
72
|
+
|
73
|
+
[:rssi, AppMeasurement::FLOAT],
|
74
|
+
|
75
|
+
[:noise, AppMeasurement::FLOAT]
|
76
|
+
|
77
|
+
])
|
78
|
+
|
79
|
+
a.addMeasurement(:group2, nil, [
|
80
|
+
|
81
|
+
[:throughput, AppMeasurement::FLOAT]
|
82
|
+
|
83
|
+
])
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
a.repository("http://repository.orbit-lab.org/common/gennyReceiver")
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
if $0 == __FILE__
|
92
|
+
|
93
|
+
a.to_xml.write($stdout, 2)
|
94
|
+
|
95
|
+
puts
|
96
|
+
|
97
|
+
end
|
98
|
+
|
99
|
+
|
100
|
+
|
@@ -0,0 +1,106 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2006-2009 National ICT Australia (NICTA), Australia
|
3
|
+
#
|
4
|
+
# Copyright (c) 2004-2009 WINLAB, Rutgers University, USA
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
14
|
+
# all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
# THE SOFTWARE.
|
23
|
+
#
|
24
|
+
#
|
25
|
+
#
|
26
|
+
|
27
|
+
# Create an application representation from scratch
|
28
|
+
|
29
|
+
#
|
30
|
+
|
31
|
+
require "appDefinition.rb"
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
a = AppDefinition.create("gennySender")
|
36
|
+
|
37
|
+
a.url = "http://apps.orbit-lab.org/gennySender"
|
38
|
+
|
39
|
+
a.name = "gennySender"
|
40
|
+
|
41
|
+
a.version(0, 0, 1)
|
42
|
+
|
43
|
+
a.shortDescription = "Programmable traffic generator"
|
44
|
+
|
45
|
+
a.description = <<TEXT
|
46
|
+
|
47
|
+
Genny Sender is a custom UDP traffic generator that is able to send
|
48
|
+
|
49
|
+
packets at a constant bit rate. It can be configured to use libmac
|
50
|
+
|
51
|
+
or plain sockets as its underlying transport mechanism. Users can
|
52
|
+
|
53
|
+
change packet rates and payload lengths during the course of the
|
54
|
+
|
55
|
+
experiment. Genny sender uses pipes to accept run-time arguments
|
56
|
+
|
57
|
+
from users.
|
58
|
+
|
59
|
+
TEXT
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
# addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
|
64
|
+
|
65
|
+
a.addProperty('interface_name', "Interface to send on", ?i, :string, false)
|
66
|
+
|
67
|
+
#a.addProperty(:pipe_name, "Pipe on which genny sender listens on", ?p, String, false)
|
68
|
+
|
69
|
+
a.addProperty('rate', "Packet rate", ?r, :integer, true)
|
70
|
+
|
71
|
+
a.addProperty('payload_length', "Payload length (bytes)", ?l, :integer, true)
|
72
|
+
|
73
|
+
a.addProperty('use_socket', "Socket or Libmac", ?s, :boolean, false)
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
a.addMeasurement("group3", nil, [
|
78
|
+
|
79
|
+
["offered_load", Float]
|
80
|
+
|
81
|
+
])
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
a.repository("http://repository.orbit-lab.org/common/gennySender")
|
86
|
+
|
87
|
+
a.repository("http://controlpxe.orbit-lab.org/repository/genny-0.3.tar")
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
a.path = "/opt/genny/bin/gennySender"
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
if $0 == __FILE__
|
98
|
+
|
99
|
+
a.to_xml.write($stdout, 2)
|
100
|
+
|
101
|
+
puts
|
102
|
+
|
103
|
+
end
|
104
|
+
|
105
|
+
|
106
|
+
|