| 23 |  | code goes here | 
          
            |  | 23 | # | 
          
            |  | 24 | # Define nodes used in experiment | 
          
            |  | 25 | # | 
          
            |  | 26 | # Physical Station for net 01. | 
          
            |  | 27 | defNodes('sender', [9,4]) {|node| | 
          
            |  | 28 | node.prototype("test:proto:sender", { | 
          
            |  | 29 | 'destinationHost' => '192.168.10.4', | 
          
            |  | 30 | 'packetSize' => 1024, | 
          
            |  | 31 | 'rate' => 300, | 
          
            |  | 32 | 'protocol' => 'udp' | 
          
            |  | 33 | }) | 
          
            |  | 34 | node.net.w0.mode = "managed" | 
          
            |  | 35 | node.net.w0 { |w| | 
          
            |  | 36 | w.type = 'b' | 
          
            |  | 37 | w.essid = "net01" | 
          
            |  | 38 | w.ip = "%192.168.%x.%y" | 
          
            |  | 39 | } | 
          
            |  | 40 | } | 
          
            |  | 41 |  | 
          
            |  | 42 | # Ap assigned for net 01. | 
          
            |  | 43 | defNodes('receiver', [10,4]) {|node| | 
          
            |  | 44 | node.prototype("test:proto:receiver" , { | 
          
            |  | 45 | 'protocol' => 'udp' | 
          
            |  | 46 | }) | 
          
            |  | 47 | node.net.w0.mode = "master" | 
          
            |  | 48 | node.net.w0 { |w| | 
          
            |  | 49 | w.type = 'b' | 
          
            |  | 50 | w.essid = "net01" | 
          
            |  | 51 | w.ip = "%192.168.%x.%y" | 
          
            |  | 52 | } | 
          
            |  | 53 | } | 
          
            |  | 54 |  | 
          
            |  | 55 | # Define another station under the essid net 2. | 
          
            |  | 56 | defNodes('sender', [11,4]) {|node| | 
          
            |  | 57 | node.prototype("test:proto:sender", { | 
          
            |  | 58 | 'destinationHost' => '192.168.10.4', | 
          
            |  | 59 | 'packetSize' => 1024, | 
          
            |  | 60 | 'rate' => 300, | 
          
            |  | 61 | 'protocol' => 'udp' | 
          
            |  | 62 | }) | 
          
            |  | 63 | node.net.w0.mode = "managed" | 
          
            |  | 64 | node.net.w0 { |w| | 
          
            |  | 65 | w.type = 'b' | 
          
            |  | 66 | w.essid = "net02" | 
          
            |  | 67 | w.ip = "%192.168.%x.%y" | 
          
            |  | 68 | } | 
          
            |  | 69 | } | 
          
            |  | 70 |  | 
          
            |  | 71 | # Connect to the same physical but different virtual AP. | 
          
            |  | 72 | defNodes('receiver', [10,4]) {|node| | 
          
            |  | 73 | node.prototype("test:proto:receiver" , { | 
          
            |  | 74 | 'protocol' => 'udp' | 
          
            |  | 75 | }) | 
          
            |  | 76 | node.net.w0.mode = "master" | 
          
            |  | 77 |  | 
          
            |  | 78 | node.net.w0 { |w| | 
          
            |  | 79 | w.type = 'b' | 
          
            |  | 80 | w.essid = "net02" | 
          
            |  | 81 | w.ip = "%192.168.%x.%y" | 
          
            |  | 82 | } | 
          
            |  | 83 | } | 
          
            |  | 84 |  | 
          
            |  | 85 | # allNodes.net.w0 { |w| | 
          
            |  | 86 | #  w.type = 'b' | 
          
            |  | 87 | #  w.essid = "net01" | 
          
            |  | 88 | #  w.ip = "%192.168.%x.%y" | 
          
            |  | 89 | #} | 
          
            |  | 90 |  | 
          
            |  | 91 | # | 
          
            |  | 92 | # Now, start the application | 
          
            |  | 93 | # | 
          
            |  | 94 | whenAllInstalled() {|node| | 
          
            |  | 95 | wait 30 | 
          
            |  | 96 |  | 
          
            |  | 97 | allNodes.startApplications | 
          
            |  | 98 | wait 40 | 
          
            |  | 99 |  | 
          
            |  | 100 | Experiment.done | 
          
            |  | 101 | } | 
          
            |  | 102 |  | 
          
            |  | 103 |  |