Changes between Version 2 and Version 3 of Old/NodeHandler/FAQ/ToUseNoiseGenerator
- Timestamp:
- Nov 23, 2005, 7:47:18 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Old/NodeHandler/FAQ/ToUseNoiseGenerator
v2 v3 14 14 * Antenna 4: Between node7-7 and node7-8. 15 15 16 I am attaching a template script to use the noise generator 16 Attached is a template script to use the noise generator. Please use tutorial-noise.rb as a baseline 17 17 18 18 The configurable parameters are … … 23 23 Here is a template script to use the noise generator 24 24 {{{ 25 #Template to use noise generator in the experiment 25 Experiment.name = "tutorial-1a" 26 Experiment.project = "orbit:tutorial" 27 Experiment.defProperty('noisePower', -44, 'Noise level injected') 28 # 29 # Define nodes used in experiment 30 # 31 defNodes('sender', [1,2]) {|node| 32 node.image = nil # assume the right image to be on disk 26 33 27 Experiment.defProperty(‘noisePower', -44, Noise level injected') 34 node.prototype("test:proto:sender", { 35 'destinationHost' => '192.168.1.1', 36 'packetSize' => 1024, 37 'rate' => 300, 38 'protocol' => 'udp' 39 }) 40 node.net.w0.mode = "master" 41 } 28 42 29 nodes([2,2], 'sender') {|node| … 30 31 nodes([8,8], ‘receiver') {|node| … 32 33 antenna(4,4).signal {|s| 34 35 s.bandwidth = 20 36 s.channel = 3 37 s.power = Experiment.property(“noisePower") 43 defNodes('receiver', [1,1]) {|node| 44 node.image = nil # assume the right image to be on disk 45 node.prototype("test:proto:receiver" , { 46 'hostname' => '192.168.1.1', 47 'protocol' => 'udp' 48 }) 49 node.net.w0.mode = "managed" 38 50 } 39 51 40 52 53 allNodes.net.w0 { |w| 54 w.type = 'b' 55 w.essid = "helloworld" 56 } 57 58 antenna(4,4).signal {|s| 59 s.bandwidth = 20 60 s.channel = 36 61 s.power = prop.noisePower 62 } 63 64 # 65 # Now, start the application 66 # 41 67 whenAllInstalled() {|node| 42 68 43 allNodes.startApplications44 69 45 wait 10 70 #Then start receiver and sender 71 NodeSet['receiver'].startApplications 72 wait 30 73 NodeSet['sender'].startApplications 46 74 47 # increase noise from -44 dBm to -20dBm in steps of 2 dBm 48 antenna(4,4).signal.on 49 -44.step(-20, 2) { |p| 50 Experiment.props.noisePower = p 51 wait 30 75 antenna(4,4).signal.on 76 77 # Step noise power from -44 to 0dbm in steps of 4db 78 -44.step(0, 4) { |p| 79 80 prop.noisePower = p 81 wait 5 82 } 83 84 wait 10 85 86 Experiment.done 52 87 } 53 88 54 Experiment.done55 89 56 } 90 57 91 58 92 }}}