Changes between Initial Version and Version 1 of Tutorials


Ignore:
Timestamp:
Sep 29, 2005, 8:41:03 PM (19 years ago)
Author:
Surya Satyavolu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials

    v1 v1  
     1[wiki:WikiStart Orbit] > Tutorial-1: Hello World Example
     2
     3The "Hello World" Experiment is simple.  The script for this experiment is shown below.
     4
     5{{{
     6Experiment.name = "tutorial-1a"
     7Experiment.project = "orbit:tutorial"
     8
     9#
     10# Define nodes used in experiment
     11#
     12defNodes('sender', [1,1]) {|node|
     13  node.image = nil  # assume the right image to be on disk
     14
     15  node.prototype("test:proto:sender", {
     16    'destinationHost' => '192.168.1.2',
     17    'packetSize' => 1024,
     18    'rate' => 300,
     19    'protocol' => 'udp'   
     20  })
     21  node.net.w0.mode = "managed"
     22}
     23
     24defNodes('receiver', [1,2]) {|node|
     25  node.image = nil  # assume the right image to be on disk
     26  node.prototype("test:proto:receiver" , {
     27    'protocol' => 'udp'
     28  })
     29  node.net.w0.mode = "master"
     30}
     31
     32allNodes.net.w0 { |w|
     33  w.type = 'b'
     34  w.essid = "helloworld"
     35  w.ip = "%192.168.%x.%y"
     36}
     37
     38#
     39# Now, start the application
     40#
     41whenAllInstalled() {|node|
     42  wait 30
     43
     44  allNodes.startApplications
     45  wait 40
     46
     47  Experiment.done
     48}
     49}}}
     50
     51Figure 1.  Script for "Hello World" Experiment
     52
     53
     54To understand the details of the script, go [wiki:Tutorial/UnderstandingHelloWorld Understanding the Hello World Script]