Changes between Initial Version and Version 1 of Tutorials/a0Basic/Tutorial2


Ignore:
Timestamp:
Sep 29, 2005, 9:26:50 PM (19 years ago)
Author:
max
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/a0Basic/Tutorial2

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