Professional Documents
Culture Documents
set MESSAGE_PORT 42
set BROADCAST_ADDR -1
# ======================================================================
# Define options
# ======================================================================
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation
model
set val(ant) Antenna/OmniAntenna ;# Antenna type
set val(ll) LL ;# Link layer type
set val(ifq) Queue/DropTail/PriQueue ;# Interface queue type
set val(ifqlen) 250 ;# max packet in ifq
set val(netif) Phy/WirelessPhy ;# network interface
type
set val(mac) Mac/802_11 ;# MAC type
set val(nn) 24 ;# number of
mobilenodes
set val(rp) AODV ;# routing protocol
set val(x) 1000
set opt(energymodel) EnergyModel ;# TOTALLY 150 JOULES
set opt(initialenergy) 0.01 ;# Initial energy in Joules
set val(y) 1000
#ns-random 0
create-god $val(nn)
# CONFIGURE AND CREATE NODES
proc finish {} {
global sink0 sink1 sink2 sink3 sink4 sink5 sink6 sink7 sink8 sink9
sink10 sink11 sink12 sink13 sink14 sink15 sink16 sink17 sink18 sink19
sink20 sink21 sink22 sink23 f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13
f14 f15 f16 f17 f18 f19 f20 f21 f22 f23 f24 f25 f26 f27 f28 f29 f30 f31
f32 f33 f34 f35 f36 f37 f38 f39 f40
#Set The Time After Which The Procedure Should Be Called Again
}
}
$ns at 0.7 "$ns trace-annotate \"For 5 seconds mobiles nodes send HELLO
messages to establish 1-hop and 2-hop neighbors\""