Changes between Version 1 and Version 2 of Old/NodeHandler/Commands/defNodes


Ignore:
Timestamp:
Nov 27, 2005, 2:24:34 AM (19 years ago)
Author:
max
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Old/NodeHandler/Commands/defNodes

    v1 v2  
    33This command defines a set of nodes used in the experiment. An experiment can contain multiple such declarations.
    44
    5 == Syntax: defNodes(setName, selector, &block) ==
     5== Syntax: defNodes(setName, selector, &block = nil) ==
    66
    77  * '''setName:''' Name of the defined set.
     
    1717  * [x, y1..y2]: Same as previous, but for the y coordinate.
    1818  * [x1..x2, y1..y2]: This defines a rectangle area of nodes within the grid.
    19   * [[x1,y1], [x2,y2], [x3,y3]]: An arbitrary long list of single nodes. Obvioulsy, any entry in this list can also use the line and rectangle descriptions defined above.
     19  * 'setName': Includes all the nodes defined by another set
     20  * [[x1,y1], [x2,y2], [x3,y3]]: An arbitrary long list of single nodes. Obvioulsy, any entry in this list can also use any of th e above defined syntaxes.
     21
     22The optional 'block' allows the experimenter to configure all the nodes in the set as a single entity. The following commands are defined inside the block:
     23
     24  * image=
     25  * prototype
     26  * net
     27
     28The following, additional commands are for expert users only:
     29
     30  * addApplication
     31  * onNodeUp
     32  * pxeImage
    2033
    2134== Usage ==
    2235
     36{{{
     37defNodes('sender1', [1, 1])
     38defNodes('sender2', [2, 1..8])
     39defNodes('sender', ['sender1', 'sender2', [3, 1..8]]) {|node|
     40  node.prototype("test:proto:sender", {
     41    'destinationHost' => '192.168.1.1',
     42    'packetSize' => 1024,   #Packet size
     43    'rate' => 300,          #Offered load = 300 kbps
     44    'protocol' => 'udp'     #Protocol = UDP
     45  })
     46  node.net.w0.mode = "master" #802.11 Master Mode
     47}
     48}}}
     49
    2350== See Also ==