Changes between Version 3 and Version 4 of Old/Documentation/OTG/ScriptsRepository/ExpFWD


Ignore:
Timestamp:
Feb 2, 2006, 5:48:58 PM (18 years ago)
Author:
zhibinwu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Old/Documentation/OTG/ScriptsRepository/ExpFWD

    v3 v4  
    1515# Define nodes used in experiment
    1616#
    17 defNodes('sender', [3,3]) {|node|
     17defNodes('sender', [4,3]) {|node|
    1818  node.image = nil  # assume the right image to be on disk
    1919
     
    3030
    3131
    32 
    33 nodes([8,8], 'receiver') {|node|
    34   node.image = nil
    35   node.prototype("test:proto:receiver" , {
    36    'hostname' => '12.0.0.7',
    37     'protocol' => 'udp'
     32defNodes('receiver', [7,6]) {|node|
     33  node.image = nil  # assume the right image to be on disk
     34  node.prototype("test:proto:raw_receiver" , {
     35      'dstfilter' => '12.0.0.7',
     36      'rxdev' => 'ath0',
     37      'protocol' => 'raw'
    3838  })
    39     node.net.w0.mode = "ad-hoc"
    40     node.net.w0.type = 'a'
    41   #  node.net.w0.essid = "mhop"
    42     node.net.w0.ip = "12.0.0.7"
    43     node.net.w0.gateway="12.0.0.1"
     39  node.net.w0.mode = "master"
    4440}
    4541
    46 defNodes('receiver', [1,1]) {|node|
    47   node.image = nil 
    48   node.prototype("test:proto:receiver" , {
    49     'protocol' => 'udp'
    50   })
    51   node.net.w0.mode = "managed"
    52     node.net.w0.ip = "12.0.0.7"
    53 }
    54 nodes([4,4], 'forwarder1') {|node|
     42defNodes('forwarder, [5,8]) {|node|
    5543  node.image = nil  # assume the right image to be on disk
    5644   node.prototype("test:proto:forwarder", {
    5745   'protocol' => 'raw',
    58    'rxdev' =>'eth0',
    59    'txdev' =>'eth2',
     46   'rxdev' =>'ath0',
     47   'txdev' =>'ath0',
    6048   'ipFilter' =>  "12.0.0.7",
    6149   'nextHopMAC' =>'00:0E:35:85:0F:59'
    6250  })
    63   node.net.e0.ip="11.0.0.1"
    64    node.net.w0.mode = "ad-hoc"
    65    node.net.w0.type = 'a'
    66  #  node.net.w0.essid = "mhop"
    67    node.net.w0.ip = "11.0.0.2"
     51   node.net.w0.ip="11.0.0.1"
     52   node.net.w0.mode = "managed"   
    6853}
    6954
    70 nodes([5,5], 'forwarder2') {|node|
    71   node.image = nil  # assume the right image to be on disk
    72   node.prototype("test:proto:forwarder", {
    73    'protocol' => 'raw',
    74    'rxdev' =>'eth2',
    75    'txdev' =>'eth2',
    76    'ipFilter' => '12.0.0.7',
    77    'nextHopMAC' =>'00:0E:35:9E:4D:82'
    78    })
    79    node.net.w0.mode = "ad-hoc"
    80    node.net.w0.type = 'a'
    81 #   node.net.w0.essid = "mhop"
    82    node.net.w0.ip = "14.0.0.1"
    83    }
    84 nodes([6,6], 'forwarder3') {|node|
    85 node.image = nil  # assume the right image to be on disk
    86 node.prototype("test:proto:forwarder", {
    87     'protocol' => 'raw',
    88     'rxdev' =>'eth2',
    89     'txdev' =>'eth2',
    90     'ipFilter' => '12.0.0.7',
    91     'nextHopMAC' =>'00:0E:35:9E:55:7F'
    92     })
    93     node.net.w0.mode = "ad-hoc"
    94     node.net.w0.type = 'a'
    95     # node.net.w0.essid = "mhop"
    96      node.net.w0.ip = "15.0.0.1"
    97   }
    98 
    99 nodes([7,7], 'forwarder4') {|node|
    100 node.image = nil  # assume the right image to be on disk
    101 node.prototype("test:proto:forwarder", {
    102     'protocol' => 'raw',
    103     'rxdev' =>'eth2',
    104     'txdev' =>'eth2',
    105     'ipFilter' => '12.0.0.7',
    106     'nextHopMAC' => '00:0E:35:9E:4D:B8'
    107     })
    108     node.net.w0.mode = "ad-hoc"
    109     node.net.w0.type = 'a'
    110     # node.net.w0.essid = "mhop"
    111     node.net.w0.ip = "12.0.0.1"
    112     }
    113 whenAll("/*/*", "procs/proc/status[text()='INSTALLED.OK']") {|node|
    114 #
    115 # Start the OML Collection Server
    116 #
    117 filename = "http://console.grid.orbit-lab.org:4000/omls"
    118 url = "http://idb1.grid.orbit-lab.org:5001/startCollectionServer?config_file=#{filename}"
    119 response = Net::HTTP.get_response(URI.parse(url))
    120 if (! response.kind_of? Net::HTTPSuccess)
    121         raise "Can't start OML Collection Server : #{response.to_s}"
    122 end
     55allNodes.net.w0 { |w|
     56  w.essid = "helloworld"
     57}
    12358
    12459#
    12560# Now, start the application
    12661#
    127   Experiment.props.packetSize = 256
    128   Experiment.props.rate = 2000
     62whenAllInstalled() {|node|
     63  wait 30
    12964
    130   print "\t\n Enter ESSID now\n"
    131   Kernel.sleep 20
     65  allNodes.startApplications
     66  wait 40
    13267
    133 
    134   NodeSet['receiver'].startApplication('otr')
    135   NodeSet['forwarder1'].startApplication('otf')
    136   NodeSet['forwarder2'].startApplication('otf')
    137   NodeSet['forwarder3'].startApplication('otf')
    138   NodeSet['forwarder4'].startApplication('otf')
    139   NodeSet['sender'].startApplication('otg')
    140 
    141  # Kernel.sleep 5
    142   NodeSet['sender'].send(:STDIN, 'proc/otg', 'size 1024')
    143   NodeSet['sender'].send(:STDIN, 'proc/otg', 'rate 5000')
    144 
    145   Kernel.sleep 60
    146   NodeSet['sender'].send(:STDIN, 'proc/otg', 'exit')
    147   NodeSet['receiver'].send(:STDIN, 'proc/otr', 'exit')
    148  NodeSet['forwarder1'].send(:STDIN, 'proc/otf', 'exit')
    149   NodeSet['forwarder2'].send(:STDIN, 'proc/otf', 'exit')
    150   NodeSet['forwarder3'].send(:STDIN, 'proc/otf', 'exit')
    151   NodeSet['forwarder4'].send(:STDIN, 'proc/otf', 'exit')
    152   Kernel.sleep 10
    153 
    154 #
    155 # Stop the OML Collection Server
    156 #
    157 filename = "http://console.grid.orbit-lab.org:4000/omls"
    158 url = "http://idb1.grid.orbit-lab.org:5001/stopCollectionServer?config_file=#{filename}"
    159 response = Net::HTTP.get_response(URI.parse(url))
    160 if (! response.kind_of? Net::HTTPSuccess)
    161         raise "Can't stop OML Collection Server : #{response.to_s}"
    162 end
    163 
    164 
    165  NodeHandler.exit
    166 
     68  Experiment.done
    16769}
    168 
    169 
    170 
    171 
    17270
    17371}}}