Changes between Version 2 and Version 3 of Old/NodeHandler/FAQ/ToUseNoiseGenerator


Ignore:
Timestamp:
Nov 23, 2005, 7:47:18 PM (19 years ago)
Author:
Surya Satyavolu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Old/NodeHandler/FAQ/ToUseNoiseGenerator

    v2 v3  
    1414  * Antenna 4: Between node7-7 and node7-8.
    1515
    16 I am attaching a template script to use the noise generator
     16Attached is a template script to use the noise generator. Please use tutorial-noise.rb as a baseline
    1717
    1818The configurable parameters are
     
    2323Here is a template script to use the noise generator
    2424{{{
    25 #Template to use noise generator in the experiment
     25Experiment.name = "tutorial-1a"
     26Experiment.project = "orbit:tutorial"
     27Experiment.defProperty('noisePower', -44, 'Noise level injected')
     28#
     29# Define nodes used in experiment
     30#
     31defNodes('sender', [1,2]) {|node|
     32  node.image = nil  # assume the right image to be on disk
    2633
    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}
    2842
    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")
     43defNodes('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"
    3850}
    3951
    4052
     53allNodes.net.w0 { |w|
     54  w.type = 'b'
     55  w.essid = "helloworld"
     56}
     57
     58antenna(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#
    4167whenAllInstalled() {|node|
    4268
    43 allNodes.startApplications
    4469
    45 wait 10
     70  #Then start receiver and sender
     71  NodeSet['receiver'].startApplications
     72  wait 30
     73  NodeSet['sender'].startApplications
    4674
    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
    5287}
    5388
    54 Experiment.done
    5589
    56 }
     90                                 
    5791
    5892}}}