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.
Files changed (66) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +4 -0
  3. data/Rakefile +7 -0
  4. data/bin/omf_test +161 -0
  5. data/config/ec.yml +164 -0
  6. data/exp_repo/system/exp/eventlib.rb +96 -0
  7. data/exp_repo/system/exp/imageNode.rb +283 -0
  8. data/exp_repo/system/exp/reset.rb +21 -0
  9. data/exp_repo/system/exp/saveNode.rb +99 -0
  10. data/exp_repo/system/exp/stat.rb +49 -0
  11. data/exp_repo/system/exp/stdlib.rb +122 -0
  12. data/exp_repo/system/exp/tell.rb +53 -0
  13. data/exp_repo/system/exp/testlib.rb +12 -0
  14. data/exp_repo/system/exp/winlib.rb +154 -0
  15. data/exp_repo/system/topo/active.rb +9 -0
  16. data/exp_repo/system/topo/all.rb +10 -0
  17. data/exp_repo/system/topo/circle.rb +23 -0
  18. data/exp_repo/test/app/aodvd.rb +73 -0
  19. data/exp_repo/test/app/appDef1.rb +102 -0
  20. data/exp_repo/test/app/athstats.rb +76 -0
  21. data/exp_repo/test/app/echo.rb +36 -0
  22. data/exp_repo/test/app/gennyReceiverAppDef.rb +100 -0
  23. data/exp_repo/test/app/gennySenderAppDef.rb +106 -0
  24. data/exp_repo/test/app/itgdec.rb +79 -0
  25. data/exp_repo/test/app/itgr.rb +77 -0
  26. data/exp_repo/test/app/itgs.rb +105 -0
  27. data/exp_repo/test/app/nop.rb +36 -0
  28. data/exp_repo/test/app/otg2.rb +68 -0
  29. data/exp_repo/test/app/otg2_mp.rb +56 -0
  30. data/exp_repo/test/app/otr2.rb +56 -0
  31. data/exp_repo/test/app/otr2_mp.rb +51 -0
  32. data/exp_repo/test/app/trace_oml2.rb +62 -0
  33. data/exp_repo/test/app/wlanconfig_oml2.rb +42 -0
  34. data/exp_repo/test/exp/conf-room-demo.rb +118 -0
  35. data/exp_repo/test/exp/planetlab.rb +82 -0
  36. data/exp_repo/test/exp/test01.rb +42 -0
  37. data/exp_repo/test/exp/test02.rb +60 -0
  38. data/exp_repo/test/exp/test03.rb +95 -0
  39. data/exp_repo/test/exp/test04.rb +105 -0
  40. data/exp_repo/test/exp/test05.rb +87 -0
  41. data/exp_repo/test/exp/test06.rb +71 -0
  42. data/exp_repo/test/exp/tutorial/hello-world-wired.rb +79 -0
  43. data/exp_repo/test/exp/tutorial/hello-world-wireless.rb +87 -0
  44. data/exp_repo/test/exp/tutorial/using-filters.rb +69 -0
  45. data/exp_repo/test/exp/tutorial/using-groups.rb +64 -0
  46. data/exp_repo/test/exp/tutorial/using-properties.rb +93 -0
  47. data/exp_repo/test/exp/tutorial/using-prototypes.rb +111 -0
  48. data/exp_repo/test/proto/aodvrouter.rb +55 -0
  49. data/exp_repo/test/proto/driverqueryapp.rb +59 -0
  50. data/exp_repo/test/proto/forwarder.rb +73 -0
  51. data/exp_repo/test/proto/itgcbrsender.rb +70 -0
  52. data/exp_repo/test/proto/itgdecoder.rb +64 -0
  53. data/exp_repo/test/proto/itgreceiver.rb +55 -0
  54. data/exp_repo/test/proto/itgvoipsender.rb +64 -0
  55. data/exp_repo/test/proto/listener2.rb +62 -0
  56. data/exp_repo/test/proto/nop.rb +47 -0
  57. data/exp_repo/test/proto/probelink.rb +48 -0
  58. data/exp_repo/test/proto/raw_receiver.rb +64 -0
  59. data/exp_repo/test/proto/receiver2_mp.rb +48 -0
  60. data/exp_repo/test/proto/sender2_mp.rb +54 -0
  61. data/exp_repo/test/proto/udp_receiver.rb +55 -0
  62. data/exp_repo/test/proto/udp_sender.rb +61 -0
  63. data/lib/omf_ec/version.rb +3 -0
  64. data/lib/omf_ec.rb +5 -0
  65. data/omf_ec.gemspec +24 -0
  66. metadata +145 -0
@@ -0,0 +1,79 @@
1
+ #
2
+ # Copyright (c) 2006-2010 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
+ # Tutorial experiment
23
+ #
24
+ defProperty('res1', 'omf.nicta.node1', "ID of sender node")
25
+ defProperty('res2', 'omf.nicta.node2', "ID of receiver node")
26
+ defProperty('duration', 60, "Duration of the experiment")
27
+ defProperty('graph', false, "Display graph or not")
28
+
29
+ defGroup('Sender', property.res1) do |node|
30
+ node.addApplication("test:app:otg2") do |app|
31
+ app.setProperty('udp:local_host', '192.168.0.2')
32
+ app.setProperty('udp:dst_host', '192.168.0.3')
33
+ app.setProperty('udp:dst_port', 3000)
34
+ app.measure('udp_out', :samples => 1)
35
+ end
36
+ node.net.e0.ip = "192.168.0.2"
37
+ end
38
+
39
+ defGroup('Receiver', property.res2) do |node|
40
+ node.addApplication("test:app:otr2") do |app|
41
+ app.setProperty('udp:local_host', '192.168.0.3')
42
+ app.setProperty('udp:local_port', 3000)
43
+ app.measure('udp_in', :samples => 1)
44
+ end
45
+ node.net.e0.ip = "192.168.0.3"
46
+ end
47
+
48
+ onEvent(:ALL_UP_AND_INSTALLED) do |event|
49
+ info "This is my first OMF experiment"
50
+ wait 10
51
+ allGroups.startApplications
52
+ info "All my Applications are started now..."
53
+ wait property.duration
54
+ allGroups.stopApplications
55
+ info "All my Applications are stopped now."
56
+ Experiment.done
57
+ end
58
+
59
+ if property.graph.value
60
+ addTab(:defaults)
61
+ addTab(:graph2) do |tab|
62
+ opts = { :postfix => %{This graph shows the Sequence Number from the UDP traffic.}, :updateEvery => 1 }
63
+ tab.addGraph("Sequence_Number", opts) do |g|
64
+ dataOut = Array.new
65
+ dataIn = Array.new
66
+ mpOut = ms('udp_out')
67
+ mpIn = ms('udp_in')
68
+ mpOut.project(:oml_ts_server, :seq_no).each do |sample|
69
+ dataOut << sample.tuple
70
+ end
71
+ mpIn.project(:oml_ts_server, :seq_no).each do |sample|
72
+ dataIn << sample.tuple
73
+ end
74
+ g.addLine(dataOut, :label => "Sender (outgoing UDP)")
75
+ g.addLine(dataIn, :label => "Receiver (incoming UDP)")
76
+ end
77
+ end
78
+ end
79
+
@@ -0,0 +1,87 @@
1
+ #
2
+ # Copyright (c) 2006-2010 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
+ # Tutorial experiment
23
+ #
24
+ defProperty('res1', 'omf.nicta.node1', "ID of sender node")
25
+ defProperty('res2', 'omf.nicta.node2', "ID of receiver node")
26
+ defProperty('duration', 60, "Duration of the experiment")
27
+ defProperty('graph', false, "Display graph or not")
28
+
29
+ defGroup('Sender', property.res1) do |node|
30
+ node.addApplication("test:app:otg2") do |app|
31
+ app.setProperty('udp:local_host', '192.168.0.2')
32
+ app.setProperty('udp:dst_host', '192.168.0.3')
33
+ app.setProperty('udp:dst_port', 3000)
34
+ app.measure('udp_out', :samples => 1)
35
+ end
36
+ node.net.w0.mode = "adhoc"
37
+ node.net.w0.type = 'g'
38
+ node.net.w0.channel = "6"
39
+ node.net.w0.essid = "helloworld"
40
+ node.net.w0.ip = "192.168.0.2"
41
+ end
42
+
43
+ defGroup('Receiver', property.res2) do |node|
44
+ node.addApplication("test:app:otr2") do |app|
45
+ app.setProperty('udp:local_host', '192.168.0.3')
46
+ app.setProperty('udp:local_port', 3000)
47
+ app.measure('udp_in', :samples => 1)
48
+ end
49
+ node.net.w0.mode = "adhoc"
50
+ node.net.w0.type = 'g'
51
+ node.net.w0.channel = "6"
52
+ node.net.w0.essid = "helloworld"
53
+ node.net.w0.ip = "192.168.0.3"
54
+ end
55
+
56
+ onEvent(:ALL_UP_AND_INSTALLED) do |event|
57
+ info "This is my first OMF experiment"
58
+ wait 10
59
+ allGroups.startApplications
60
+ info "All my Applications are started now..."
61
+ wait property.duration
62
+ allGroups.stopApplications
63
+ info "All my Applications are stopped now."
64
+ Experiment.done
65
+ end
66
+
67
+ if property.graph.value
68
+ addTab(:defaults)
69
+ addTab(:graph2) do |tab|
70
+ opts = { :postfix => %{This graph shows the Sequence Number from the UDP traffic.}, :updateEvery => 1 }
71
+ tab.addGraph("Sequence_Number", opts) do |g|
72
+ dataOut = Array.new
73
+ dataIn = Array.new
74
+ mpOut = ms('udp_out')
75
+ mpIn = ms('udp_in')
76
+ mpOut.project(:oml_ts_server, :seq_no).each do |sample|
77
+ dataOut << sample.tuple
78
+ end
79
+ mpIn.project(:oml_ts_server, :seq_no).each do |sample|
80
+ dataIn << sample.tuple
81
+ end
82
+ g.addLine(dataOut, :label => "Sender (outgoing UDP)")
83
+ g.addLine(dataIn, :label => "Receiver (incoming UDP)")
84
+ end
85
+ end
86
+ end
87
+
@@ -0,0 +1,69 @@
1
+ # Copyright (c) 2006-2010 National ICT Australia (NICTA), Australia
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the "Software"), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ # THE SOFTWARE.
20
+ #
21
+ # Tutorial experiment
22
+ #
23
+ defProperty('res1', 'omf.nicta.node1', "ID of sender node")
24
+ defProperty('res2', 'omf.nicta.node2', "ID of receiver node")
25
+ defProperty('packetsize', 256, "Packet size (byte) from the sender node")
26
+ defProperty('runtime', 60, "Time in second for the experiment is to run")
27
+
28
+ defGroup('Sender',property.res1) do |node|
29
+ node.addApplication("test:app:otg2") do |app|
30
+ app.setProperty('udp:local_host', '192.168.0.2')
31
+ app.setProperty('udp:dst_host', '192.168.0.3')
32
+ app.setProperty('udp:dst_port', 3000)
33
+ app.setProperty('cbr:size', property.packetsize)
34
+ app.measure('udp_out', :samples => 3) do |mp|
35
+ mp.filter('seq_no', 'avg')
36
+ end
37
+ end
38
+ node.net.w0.mode = "adhoc"
39
+ node.net.w0.type = 'g'
40
+ node.net.w0.channel = "6"
41
+ node.net.w0.essid = "helloworld"
42
+ node.net.w0.ip = "192.168.0.2"
43
+ end
44
+
45
+ defGroup('Receiver',property.res2) do |node|
46
+ node.addApplication("test:app:otr2") do |app|
47
+ app.setProperty('udp:local_host', '192.168.0.3')
48
+ app.setProperty('udp:local_port', 3000)
49
+ app.measure('udp_in', :samples => 2) do |mp|
50
+ mp.filter('pkt_length', 'sum')
51
+ mp.filter('seq_no', 'avg')
52
+ end
53
+ end
54
+ node.net.w0.mode = "adhoc"
55
+ node.net.w0.type = 'g'
56
+ node.net.w0.channel = "6"
57
+ node.net.w0.essid = "helloworld"
58
+ node.net.w0.ip = "192.168.0.3"
59
+ end
60
+
61
+ onEvent(:ALL_UP_AND_INSTALLED) do |event|
62
+ wait 10
63
+ allGroups.startApplications
64
+ wait property.runtime / 2
65
+ property.packetsize = 512
66
+ wait property.runtime / 2
67
+ allGroups.stopApplications
68
+ Experiment.done
69
+ end
@@ -0,0 +1,64 @@
1
+ #
2
+ # Copyright (c) 2006-2010 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
+ # Tutorial experiment
23
+ #
24
+ defProperty('res1', 'omf.nicta.node1', "ID of sender node")
25
+ defProperty('res2', 'omf.nicta.node2', "ID of receiver node")
26
+ defProperty('duration', 60, "Duration of the experiment")
27
+
28
+ defGroup('Sender', property.res1) do |node|
29
+ node.addApplication("test:app:otg2") do |app|
30
+ app.setProperty('udp:local_host', '%net.w0.ip%')
31
+ app.setProperty('udp:dst_host', '192.168.255.255')
32
+ app.setProperty('udp:broadcast', 1)
33
+ app.setProperty('udp:dst_port', 3000)
34
+ app.measure('udp_out', :samples => 1)
35
+ end
36
+ end
37
+
38
+ defGroup('Receiver', property.res2) do |node|
39
+ node.addApplication("test:app:otr2") do |app|
40
+ app.setProperty('udp:local_host', '192.168.255.255')
41
+ app.setProperty('udp:local_port', 3000)
42
+ app.measure('udp_in', :samples => 1)
43
+ end
44
+ end
45
+
46
+ allGroups.net.w0 do |interface|
47
+ interface.mode = "adhoc"
48
+ interface.type = 'g'
49
+ interface.channel = "6"
50
+ interface.essid = "helloworld"
51
+ interface.ip = "192.168.0.%index%"
52
+ end
53
+
54
+ onEvent(:ALL_UP_AND_INSTALLED) do |event|
55
+ wait 10
56
+ group("Receiver").startApplications
57
+ wait 5
58
+ group("Sender").startApplications
59
+ wait property.duration
60
+ group("Sender").stopApplications
61
+ wait 5
62
+ group("Receiver").stopApplications
63
+ Experiment.done
64
+ end
@@ -0,0 +1,93 @@
1
+ #
2
+ # Copyright (c) 2006-2010 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
+ # Tutorial experiment
23
+ #
24
+ defProperty('res1', 'omf.nicta.node1', "ID of sender node")
25
+ defProperty('res2', 'omf.nicta.node2', "ID of receiver node")
26
+ defProperty('packetsize', 128, "Packet size (byte) from the sender node")
27
+ defProperty('bitrate', 2048, "Bitrate (bit/s) from the sender node")
28
+ defProperty('runtime', 40, "Time in second for the experiment is to run")
29
+ defProperty('wifiType', "g", "The type of WIFI to use in this experiment")
30
+ defProperty('channel', '6', "The WIFI channel to use in this experiment")
31
+ defProperty('netid', "example2", "The ESSID to use in this experiment")
32
+ defProperty('graph', false, "Display graph or not")
33
+
34
+ defGroup('Sender',property.res1) do |node|
35
+ node.addApplication("test:app:otg2") do |app|
36
+ app.setProperty('udp:local_host', '192.168.0.2')
37
+ app.setProperty('udp:dst_host', '192.168.0.3')
38
+ app.setProperty('udp:dst_port', 3000)
39
+ app.setProperty('cbr:size', property.packetsize)
40
+ app.setProperty('cbr:rate', property.bitrate * 2)
41
+ app.measure('udp_out', :samples => 1)
42
+ end
43
+ node.net.w0.mode = "adhoc"
44
+ node.net.w0.type = property.wifiType
45
+ node.net.w0.channel = property.channel
46
+ node.net.w0.essid = property.netid
47
+ node.net.w0.ip = "192.168.0.2"
48
+ end
49
+
50
+ defGroup('Receiver',property.res2) do |node|
51
+ node.addApplication("test:app:otr2") do |app|
52
+ app.setProperty('udp:local_host', '192.168.0.3')
53
+ app.setProperty('udp:local_port', 3000)
54
+ app.measure('udp_in', :samples => 1)
55
+ end
56
+ node.net.w0.mode = "adhoc"
57
+ node.net.w0.type = property.wifiType
58
+ node.net.w0.channel = property.channel
59
+ node.net.w0.essid = property.netid
60
+ node.net.w0.ip = "192.168.0.3"
61
+ end
62
+
63
+ onEvent(:ALL_UP_AND_INSTALLED) do |event|
64
+ info "This is my first OMF experiment"
65
+ wait 10
66
+ allGroups.startApplications
67
+ info "All my Applications are started now..."
68
+ wait property.runtime / 4
69
+ property.packetsize = 256
70
+ wait property.runtime / 4
71
+ property.packetsize = 512
72
+ wait property.runtime / 4
73
+ property.packetsize = 1024
74
+ wait property.runtime / 4
75
+ allGroups.stopApplications
76
+ info "All my Applications are stopped now."
77
+ Experiment.done
78
+ end
79
+
80
+ if property.graph.value
81
+ addTab(:defaults)
82
+ addTab(:graph2) do |tab|
83
+ opts = { :postfix => %{This graph shows the Packet Size of the incoming UDP traffic (byte).}, :updateEvery => 1 }
84
+ tab.addGraph("Incoming UDP Packet Size", opts) do |g|
85
+ dataIn = Array.new
86
+ mpIn = ms('udp_in')
87
+ mpIn.project(:oml_ts_server, :pkt_length).each do |sample|
88
+ dataIn << sample.tuple
89
+ end
90
+ g.addLine(dataIn, :label => "Incoming UDP (byte)")
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,111 @@
1
+ #
2
+ # Copyright (c) 2006-2010 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
+ # Tutorial experiment
23
+ #
24
+ defProperty('res1', 'omf.nicta.node1', "ID of sender node")
25
+ defProperty('res2', 'omf.nicta.node2', "ID of receiver node")
26
+ defProperty('duration', 30, "Duration of the experiment")
27
+ defProperty('graph', false, "Display graph or not")
28
+
29
+ defGroup('CBR_Sender', property.res1) do |node|
30
+ options = { 'localHost' => '%net.w0.ip%',
31
+ 'destinationHost' => '192.168.255.255',
32
+ 'packetSize' => 256 }
33
+ node.addPrototype("test:proto:cbr_generator", options)
34
+ end
35
+
36
+ defGroup('EXPO_Sender', property.res1) do |node|
37
+ options = { 'localHost' => '%net.w0.ip%',
38
+ 'destinationHost' => '192.168.255.255',
39
+ 'packetSize' => 1024 }
40
+ node.addPrototype("test:proto:expo_generator", options)
41
+ end
42
+
43
+ defGroup('Receiver', property.res2) do |node|
44
+ node.addApplication("test:app:otr2") do |app|
45
+ app.setProperty('udp:local_host', '192.168.255.255')
46
+ app.setProperty('udp:local_port', 3000)
47
+ app.measure('udp_in', :samples => 1)
48
+ end
49
+ end
50
+
51
+ allGroups.net.w0 do |interface|
52
+ interface.mode = "adhoc"
53
+ interface.type = 'g'
54
+ interface.channel = "6"
55
+ interface.essid = "helloworld"
56
+ interface.ip = "192.168.0.%index%"
57
+ end
58
+
59
+ onEvent(:ALL_UP_AND_INSTALLED) do |event|
60
+ wait 10
61
+ info "Starting the Receiver"
62
+ group("Receiver").startApplications
63
+ info "Starting the EXPO-traffic Sender"
64
+ group("EXPO_Sender").startApplications
65
+ wait property.duration
66
+ info "Stopping the EXPO-traffic Sender"
67
+ group("EXPO_Sender").stopApplications
68
+ wait 5
69
+ info "Starting the CBR-traffic Sender"
70
+ group("CBR_Sender").startApplications
71
+ wait property.duration
72
+ info "Now stopping all everything"
73
+ #allGroups.stopApplications
74
+ group("CBR_Sender").stopApplications
75
+ group("Receiver").stopApplications
76
+ Experiment.done
77
+ end
78
+
79
+
80
+ if property.graph.value
81
+ addTab(:defaults)
82
+ addTab(:graph2) do |tab|
83
+ opts1 = { :postfix => %{This graph shows the Sequence Number from CBR and EXP UDP traffic.}, :updateEvery => 1 }
84
+ tab.addGraph("Sequence Number", opts1) do |g|
85
+ dataOut = Hash.new
86
+ mpOut = ms('udp_out')
87
+ mpOut.project(:oml_sender_id, :oml_ts_server, :seq_no).each do |sample|
88
+ sender, time, seq = sample.tuple
89
+ dataOut[sender] = [] if dataOut[sender] == nil
90
+ dataOut[sender] << [time,seq]
91
+ end
92
+ dataOut.each do |source, data|
93
+ g.addLine(data, :label => "#{msSenderName[source]}")
94
+ end
95
+ end
96
+ opts2 = { :postfix => %{This graph shows the Packet Size (bytes)from CBR and EXP UDP traffic.}, :updateEvery => 1 }
97
+ tab.addGraph("Packet Size", opts2) do |g|
98
+ dataOut = Hash.new
99
+ mpOut = ms('udp_out')
100
+ mpOut.project(:oml_sender_id, :oml_ts_server, :pkt_length).each do |sample|
101
+ sender, time, plength = sample.tuple
102
+ dataOut[sender] = [] if dataOut[sender] == nil
103
+ dataOut[sender] << [time,plength]
104
+ end
105
+ dataOut.each do |source, data|
106
+ g.addLine(data, :label => "#{msSenderName[source]}")
107
+ end
108
+ end
109
+ end
110
+ end
111
+
@@ -0,0 +1,55 @@
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
+ # Define a prototype
27
+ #
28
+
29
+ p = Prototype.create("test:proto:aodvrouter")
30
+ p.name = "AODV daemon"
31
+ p.description = "Nodes which receive packets"
32
+ p.defProperty('interface', 'Interface to listen on')
33
+ p.defProperty('log', 'Enable logging')
34
+ p.defProperty('routelog', 'Enable logging')
35
+
36
+ aodvd = p.addApplication('aodvd', "test:app:aodvd")
37
+ aodvd.bindProperty('interface')
38
+ aodvd.bindProperty('log')
39
+ aodvd.bindProperty('rttable','routelog')
40
+
41
+ aodvd.addMeasurement('receiverport', Filter::SAMPLE,
42
+ {Filter::SAMPLE_SIZE => 1},
43
+ [
44
+ ['flow_no'],
45
+ ['throughput'],
46
+ ['jitter'],
47
+ ['packet_loss']
48
+ ]
49
+ )
50
+
51
+ if $0 == __FILE__
52
+ p.to_xml.write($stdout, 2)
53
+ puts
54
+ end
55
+
@@ -0,0 +1,59 @@
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
+ # Define a prototype
27
+ #
28
+
29
+ p = Prototype.create("test:proto:driverqueryapp")
30
+ p.name = "Wireless Driver Stats"
31
+ p.description = "Statistics obtained by querying the driver periodically"
32
+ p.defProperty('interface', 'interface to gather stats from')
33
+ p.defProperty('interval', 'How often to query the driver')
34
+
35
+ athstats = p.addApplication(:athstats, "test:app:athstats")
36
+ athstats.bindProperty('interface')
37
+ athstats.bindProperty('interval')
38
+
39
+ athstats.addMeasurement('queryport', Filter::SAMPLE,
40
+ {Filter::SAMPLE_SIZE => 1},
41
+ [
42
+ ['succ_tx_attempts'],
43
+ ['fail_xretries'],
44
+ ['fail_fifoerr'],
45
+ ['fail_filtered'],
46
+ ['short_retries'],
47
+ ['long_retries'],
48
+ ['total_frames_rcvd'],
49
+ ['crc_errors'],
50
+ ['fifo_errors'],
51
+ ['phy_errors']
52
+ ]
53
+ )
54
+
55
+ if $0 == __FILE__
56
+ p.to_xml.write($stdout, 2)
57
+ puts
58
+ end
59
+