| | 1 | = Using AODV with the testbed = |
| | 2 | |
| | 3 | Currently, we support AODV-UU protocol 0.9.1 on kernel version 2.6.12. Using the application and prototype definition format, we can currently specify |
| | 4 | * the interface to run on |
| | 5 | * enable logging |
| | 6 | * enable route table logging |
| | 7 | |
| | 8 | |
| | 9 | |
| | 10 | == For Experimenters == |
| | 11 | * Step 1: In order to use AODV routing protocol in your experiment, make sure you use the baseline.ndz image on your nodes that has aodv installed. |
| | 12 | * Step 2: Use the following experiment script. This will launch both the traffic generator and AODV on the nodes. AODV currently logs locally to the node every N secs which is configurable. However, in the future, this will be OMLized to log into the database instead. |
| | 13 | |
| | 14 | '''AODV router prototype and app defs are installed on all consoles. So users should be able to use it from any console''' |
| | 15 | === Experiment script === |
| | 16 | |
| | 17 | {{{ |
| | 18 | ################################################## |
| | 19 | # AODV with OTG |
| | 20 | # Every node has two prototypes: sender/receiver and AODV |
| | 21 | # AODV rt table logs are reported every 4 secs on the nodes to |
| | 22 | # /var/log/aodv.rtlog |
| | 23 | # These will soon be OMLized to report to the database instead |
| | 24 | ################################################## |
| | 25 | |
| | 26 | Experiment.name = "tutorial-aodv" |
| | 27 | Experiment.project = "orbit:tutorial" |
| | 28 | |
| | 29 | # |
| | 30 | # Define nodes used in experiment |
| | 31 | # |
| | 32 | defNodes('sender', [1,2]) {|node| |
| | 33 | node.image = nil # assume the right image to be on disk |
| | 34 | |
| | 35 | node.prototype("test:proto:sender", { |
| | 36 | 'destinationHost' => '192.168.1.1', |
| | 37 | 'packetSize' => 1024, |
| | 38 | 'rate' => 300, |
| | 39 | 'protocol' => 'udp' |
| | 40 | }) |
| | 41 | node.net.w0.mode = "master" |
| | 42 | } |
| | 43 | |
| | 44 | defNodes('receiver', [1,1]) {|node| |
| | 45 | node.image = nil # assume the right image to be on disk |
| | 46 | node.prototype("test:proto:receiver" , { |
| | 47 | 'hostname' => '192.168.1.1', |
| | 48 | 'protocol' => 'udp_libmac' |
| | 49 | }) |
| | 50 | node.net.w0.mode = "managed" |
| | 51 | } |
| | 52 | |
| | 53 | defNodes('everyone',[[1,1],[1,2]]) {|node| |
| | 54 | node.image = nil |
| | 55 | node.prototype("test:proto:aodvrouter", { |
| | 56 | 'interface' => 'ath0', #Run aodvd on interface ath0 |
| | 57 | 'log' => nil, #Enable logging |
| | 58 | 'routelog' => 4 #Enable routing table logging every 4 secs |
| | 59 | }) |
| | 60 | } |
| | 61 | |
| | 62 | |
| | 63 | allNodes.net.w0 { |w| |
| | 64 | w.type = 'b' |
| | 65 | w.essid = "helloworld" |
| | 66 | w.ip = "%192.168.%x.%y" |
| | 67 | } |
| | 68 | |
| | 69 | # |
| | 70 | # Now, start the application |
| | 71 | # |
| | 72 | whenAllInstalled() {|node| |
| | 73 | #First start AODV daemon on all nodes |
| | 74 | NodeSet['everyone'].startApplications |
| | 75 | |
| | 76 | wait 10 |
| | 77 | |
| | 78 | #Then start receiver and sender |
| | 79 | NodeSet['receiver'].startApplications |
| | 80 | wait 30 |
| | 81 | NodeSet['sender'].startApplications |
| | 82 | |
| | 83 | wait 180 |
| | 84 | |
| | 85 | Experiment.done |
| | 86 | } |
| | 87 | |
| | 88 | }}} |
| | 89 | |
| | 90 | |
| | 91 | |
| | 92 | == For Developers == |
| | 93 | The application definition and prototype definitions corresponding to AODV router are as follows |
| | 94 | |
| | 95 | == Application definition == |
| | 96 | {{{ |
| | 97 | # |
| | 98 | # Create an application representation from scratch |
| | 99 | # |
| | 100 | require 'handler/appDefinition' |
| | 101 | |
| | 102 | a = AppDefinition.create('test:app:aodvd') |
| | 103 | a.name = "aodvd" |
| | 104 | a.version(0, 0, 1) |
| | 105 | a.shortDescription = "Iperf traffic generator" |
| | 106 | a.description = <<TEXT |
| | 107 | Iperf is a traffic generator for TCP and UDP traffic. It contains generators |
| | 108 | producing various forms of packet streams and port for sending |
| | 109 | these packets via various transports, such as TCP and UDP. |
| | 110 | TEXT |
| | 111 | |
| | 112 | # addProperty(name, description, mnemonic, type, isDynamic = false, constraints |
| | 113 | = nil) |
| | 114 | a.addProperty('interface', 'Interface to run on', ?i, String, false) |
| | 115 | a.addProperty('log', 'Enable logging', ?l, String, false) |
| | 116 | a.addProperty('rttable', 'Log rting table every N secs', ?r, String, false) |
| | 117 | a.path = "/usr/sbin/aodvd" |
| | 118 | |
| | 119 | if $0 == __FILE__ |
| | 120 | require 'stringio' |
| | 121 | require 'rexml/document' |
| | 122 | include REXML |
| | 123 | |
| | 124 | sio = StringIO.new() |
| | 125 | a.to_xml.write(sio, 2) |
| | 126 | sio.rewind |
| | 127 | puts sio.read |
| | 128 | |
| | 129 | sio.rewind |
| | 130 | doc = Document.new(sio) |
| | 131 | t = AppDefinition.from_xml(doc.root) |
| | 132 | |
| | 133 | puts |
| | 134 | puts "-------------------------" |
| | 135 | puts |
| | 136 | t.to_xml.write($stdout, 2) |
| | 137 | |
| | 138 | end |
| | 139 | |
| | 140 | }}} |
| | 141 | |
| | 142 | === Prototype definition === |
| | 143 | {{{ |
| | 144 | # |
| | 145 | # Define a prototype |
| | 146 | # |
| | 147 | |
| | 148 | require 'handler/prototype' |
| | 149 | require 'handler/filter' |
| | 150 | require 'handler/appDefinition' |
| | 151 | |
| | 152 | p = Prototype.create("test:proto:aodvrouter") |
| | 153 | p.name = "AODV daemon" |
| | 154 | p.description = "Nodes which receive packets" |
| | 155 | p.defProperty('interface', 'Interface to listen on') |
| | 156 | p.defProperty('log', 'Enable logging') |
| | 157 | p.defProperty('routelog', 'Enable logging') |
| | 158 | |
| | 159 | aodvd = p.addApplication('aodvd', "test:app:aodvd") |
| | 160 | aodvd.bindProperty('interface') |
| | 161 | aodvd.bindProperty('log') |
| | 162 | aodvd.bindProperty('rttable','routelog') |
| | 163 | |
| | 164 | |
| | 165 | if $0 == __FILE__ |
| | 166 | p.to_xml.write($stdout, 2) |
| | 167 | puts |
| | 168 | end |
| | 169 | |
| | 170 | |
| | 171 | }}} |