Changes between Initial Version and Version 1 of Old/NodeHandler/Tutorial/UnderstandingHelloWorld


Ignore:
Timestamp:
Sep 29, 2005, 5:22:10 PM (19 years ago)
Author:
zhibinwu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Old/NodeHandler/Tutorial/UnderstandingHelloWorld

    v1 v1  
     1[wiki:WikiStart Orbit] > [wiki:NodeHandler NodeHandler] > [wiki:NodeHandler/Tutorial Tutorial] > Understanding Hello World Experiment Script
     2
     3= Understanding the tutorial script =
     4An experiment name is used to create the corresponding database to store results and to create a unique log for the same
     5{{{
     6Experiment.name = "tutorial-1a"
     7Experiment.project = "orbit:tutorial"
     8}}}
     9Create a group of nodes called ‘sender’ and assign node1-1 to it
     10To the group sender, we assign a role that all nodes belonging to this group will
     11play. Here, we instruct nodehandler to assign the prototype sender to node1-1
     12Note that the ‘sender’ prototype is defined using a corresponding ‘sender.rb’ file
     13and is tied to an actual underlying application that will actual get launched on the
     14node (In this case, the application is ‘otg’ (ORBIT Traffic Generator)
     15
     16These are the command line arguments that will be used by nodehandler when it
     17asks the nodeagent to launch the application, for e.g, the following will
     18description will cause nodeagent to launch ‘otg –destinationHost 192.168.1.3 --
     19packetsize 1024  --rate 300 -- protocol udp
     20{{{
     21defNodes('sender', [1,1]) {|node|                   
     22node.image = nil   #Default image on the node to be used for the experiment
     23node.prototype("test:proto:sender", {
     24   'destinationHost' => '192.168.1.3',
     25    'packetSize' => 1024,
     26    'rate' => 300,
     27    'protocol' => 'udp'
     28  })
     29node.net.w0.mode = "ad-hoc"
     30}
     31}}}
     32Create a group of nodes called ‘receiver’ and assign node1-3 to it
     33To the group receiver, we assign a role that all nodes belonging to this group will
     34play. Here, we instruct nodehandler to assign the prototype receiver to node1-3
     35Note that the ‘sender’ prototype is defined using a corresponding ‘receiver.rb’ file
     36and is tied to an actual underlying application that will actual get launched on the
     37node (In this case, the application is ‘otr’ (ORBIT Traffic Receiver)
     38
     39These are the command line arguments that will be used by nodehandler when it
     40asks the nodeagent to launch the application, for e.g, the following will
     41description will cause nodeagent to launch ‘otr -- hostname 192.168.1.3 –- protocol udp
     42{{{
     43defNodes('receiver', [1,3]) {|node|
     44  node.image = nil 
     45  node.prototype("test:proto:receiver" , {
     46   'hostname' => '192.168.1.3',
     47    'protocol' => 'udp'
     48  })
     49  node.net.w0.mode = "ad-hoc"
     50}
     51}}}
     52Configures the first wireless card on all nodes to 802.11b, essid ‘helloworld’ with ip
     53addresses 192.168.x.y where x.y are the co-ordinates of the nodes
     54{{{
     55allNodes.net.w0 { |w|
     56  w.type = 'b'
     57  w.essid = "helloworld"
     58  w.ip = "%192.168.%x.%y"
     59}
     60}}}
     61Now, start the application,
     62This is a barrier where nodehandler waits to receive an OK message from each of
     63the nodeagents, only proceeds when initial configurations are OK.
     64{{{
     65whenAllInstalled() {|node|
     66}}}
     67This command will request nodeagents to launch the application corresponding
     68to the role that the node is playing, e.g sender will launch the application ‘otg’ and
     69the receiver will launch the application ‘otr’ with the command line options
     70as specified before
     71{{{
     72allNodes.startApplications
     73}}}
     74Conduct experiment for 60 seconds
     75{{{
     76  wait 60
     77}}}
     78End of experiment – Shut down all nodes
     79{{{
     80Experiment.done
     81}}}