wiki:Old/NodeHandler/Tutorial/UnderstandingHelloWorld

Orbit > NodeHandler > Tutorial > Understanding Hello World Experiment Script

Understanding the tutorial script

An experiment name is used to create the corresponding database to store results and to create a unique log for the same

Experiment.name = "tutorial-1a"
Experiment.project = "orbit:tutorial"

Create a group of nodes called ‘sender’ and assign node1-1 to it To the group sender, we assign a role that all nodes belonging to this group will play. Here, we instruct nodehandler to assign the prototype sender to node1-1 Note that the ‘sender’ prototype is defined using a corresponding ‘sender.rb’ file and is tied to an actual underlying application that will actual get launched on the node (In this case, the application is ‘otg’ (ORBIT Traffic Generator)

These are the command line arguments that will be used by nodehandler when it asks the nodeagent to launch the application, for e.g, the following will description will cause nodeagent to launch ‘otg –destinationHost 192.168.1.3 — packetsize 1024 —rate 300 — protocol udp

defNodes('sender', [1,1]) {|node|                   
node.image = nil   #Default image on the node to be used for the experiment
node.prototype("test:proto:sender", {
   'destinationHost' => '192.168.1.3',
    'packetSize' => 1024,
    'rate' => 300,
    'protocol' => 'udp'
  })
node.net.w0.mode = "ad-hoc"
}

Create a group of nodes called ‘receiver’ and assign node1-3 to it To the group receiver, we assign a role that all nodes belonging to this group will play. Here, we instruct nodehandler to assign the prototype receiver to node1-3 Note that the ‘sender’ prototype is defined using a corresponding ‘receiver.rb’ file and is tied to an actual underlying application that will actual get launched on the node (In this case, the application is ‘otr’ (ORBIT Traffic Receiver)

These are the command line arguments that will be used by nodehandler when it asks the nodeagent to launch the application, for e.g, the following will description will cause nodeagent to launch ‘otr — hostname 192.168.1.3 –- protocol udp

defNodes('receiver', [1,3]) {|node|
  node.image = nil  
  node.prototype("test:proto:receiver" , {
   'hostname' => '192.168.1.3',
    'protocol' => 'udp'
  })
  node.net.w0.mode = "ad-hoc"
}

Configures the first wireless card on all nodes to 802.11b, essid ‘helloworld’ with ip addresses 192.168.x.y where x.y are the co-ordinates of the nodes

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

Now, start the application, This is a barrier where nodehandler waits to receive an OK message from each of the nodeagents, only proceeds when initial configurations are OK.

whenAllInstalled() {|node|

This command will request nodeagents to launch the application corresponding to the role that the node is playing, e.g sender will launch the application ‘otg’ and the receiver will launch the application ‘otr’ with the command line options as specified before

allNodes.startApplications

Conduct experiment for 60 seconds

  wait 60

End of experiment – Shut down all nodes

Experiment.done
Last modified 19 years ago Last modified on Sep 29, 2005, 5:22:10 PM
Note: See TracWiki for help on using the wiki.