{{{ ############# Tutorial1 ################################## # This script defines the experiment # that has one sender and one receiver # Sender, Receiver - 802.11a channel 36 # UDP flow at 1 Mbps # Receiver reports throughput, jitter and packet loss per second # Iperf traffic generator ############################################################ require 'net/http' require 'uri' Experiment.name = "iperf-udp" Experiment.project = "orbit:tutorial" # # Define nodes used in experiment # ########################################### # Sender definition and configuration ########################################### defNodes('sender', [1,1]) {|node| node.image = nil # assume the right image to be on disk # use prototype "sender" # and set it's property "destinationHost" to # the receiver node # and bind the remaining properties to the # experiment property space node.prototype("test:proto:iperfudpsender", { 'client' => '192.168.1.2', #Send to 'use_udp' => nil, #UDP client 'sender_rate' => 7000, #Input offered load (bits per sec) 'len' => 1024 #Payload length (bytes) }) node.net.w0.ip = "%192.168.%x.%y" node.net.w0.mode = "Managed" node.net.w0.type = 'b' node.net.w0.essid = "cwmin" } ########################################### # Receiver definition and configuration ########################################### defNodes('receiver', [1,2]) {|node| node.net.w0.ip = "%192.168.%x.%y" node.image = nil # assume the right image to be on disk node.prototype("test:proto:iperfudpreceiver" , { 'server' => nil, # Server 'use_udp' => nil, # Use UDP 'len' => 1024, #Payload length (bytes) 'report_interval' => 10 #Report interval(seconds) }) node.net.w0.mode = "Master" node.net.w0.type = 'b' node.net.w0.essid = "cwmin" } ########################################### # When nodeAgents have reported "OK" to # the nodeHandler start the application ########################################### whenAllInstalled() {|node| wait 10 nodes('receiver').startApplications wait 10 nodes('sender').startApplications wait 30 allNodes.stopApplications Experiment.done } }}}