wiki:Old/Documentation/OTG/ScriptsRepository/ExpBcast

Version 1 (modified by zhibinwu, 19 years ago) ( diff )

Orbit > OTG > Scripts Repository > UDP brocast Sender with RAW socket receiver

xperiment.name = "tutorial-bcast"
Experiment.project = "orbit:tutorial"

#
# Define nodes used in experiment
#
defNodes('sender', [1,2]) {|node|
  node.image = nil  # assume the right image to be on disk

  node.prototype("test:proto:sender", {
    'destinationHost' => '192.168.255.255',
    'packetSize' => 1024,
    'rate' => 300,
    'protocol' => 'udp' ,
    'broadcast' => 'on'
  })
  node.net.w0.mode = "master"
}

defNodes('receiver', [1,1]) {|node|
  node.image = nil  # assume the right image to be on disk
  node.prototype("test:proto:raw_receiver" , {
      'dstfilter' => '192.168.255.255',
      'rxdev' => 'ath0',
      'protocol' => 'raw_libmac'
  })
  node.net.w0.mode = "managed"
}

allNodes.net.w0 { |w|
  w.type = 'b'
  w.essid = "helloworld"
  w.ip = "%192.168.%x.%y"
}

#
# Now, start the application
#
whenAllInstalled() {|node|
  wait 30

  allNodes.startApplications
  wait 40

  Experiment.done
}

Note: See TracWiki for help on using the wiki.