[ns] AWK file for handover delay in FMIPv6

2011-06-03 Thread chadi jabroun










Hi all


I need an awk file to calculate the handover delay in MIPv6.

could any body send me this awk file.


thank you very much, your help will be very appreciated

best regards,

Chadi
  


[ns] [very urgent] Extension for IEEE 802.11p

2011-05-28 Thread chadi jabroun







Hi

 

I want to create a handover scenario using the IEEE 802.11p.

 

I need an extension for the IEEE 802.11p.

 

could any one send me the IEEE802.11p package or a link to download it.

 

Please it is very urgent

 

thank you  for your help.

 

best regards,

 

Chadi Jabroun
  


[ns] [very urgent] Extension for IEEE 802.11p

2011-05-27 Thread chadi jabroun


Hi
 
I want to create a handover scenario using the IEEE 802.11p.
 
I need an extension for the IEEE 802.11p.
 
could any one send me the IEEE802.11p package or a link to download it.
 
Please it is very urgent
 
thank you  for your help.
 
best regards,
 
Chadi Jabroun 


[ns] [very urgent] need IEEE 802.11p package

2011-05-19 Thread chadi jabroun


Hi

I want to create a handover process using the IEEE 802.11p.

The IEEE 802.11p extension which is integrated in ns2.34 doesn't support 
handover layer 2.

Does any body have an IEEE package that support handover.

please i need your help it is very very urgent.

Thank you very much 

best regards,

Chadi Jabroun  
  


[ns] [very urgent] error when installing the IEEE 802.p package (serbrook uni)

2011-05-17 Thread chadi jabroun


Hi 

I'm trying to integrate the IEEE 802.11p package developed by sherbrook 
university .
please could any body help me?

I get the following error when I do: make

--
In file included from mac/ofdmphy.h:6,
 from mac/mac802_11p.h:7,
 from mac/mac802_11p.cc:16:
mac/wireless-phy.h:130: error: expected identifier before 'r'
mac/wireless-phy.h:130: error: expected `}' before 'r'
mac/wireless-phy.h:130: error: expected unqualified-id before 'r'
mac/wireless-phy.h: In member function ‘bool WirelessPhy::Is_node_on()’:
mac/wireless-phy.h:97: error: ‘node_on_’ was not declared in this scope
mac/wireless-phy.h: In member function ‘bool WirelessPhy::Is_sleeping()’:
mac/wireless-phy.h:98: error: ‘status_’ was not declared in this scope
mac/wireless-phy.h: At global scope:
mac/wireless-phy.h:132: error: no matching function for call to 
‘Sleep_Timer::Sleep_Timer()’
mac/wireless-phy.h:58: note: candidates are: 
Sleep_Timer::Sleep_Timer(WirelessPhy*)
mac/wireless-phy.h:56: note: Sleep_Timer::Sleep_Timer(const 
Sleep_Timer)
mac/wireless-phy.h:135: error: expected unqualified-id before ‘private’
mac/wireless-phy.h: In function ‘EnergyModel* em()’:
mac/wireless-phy.h:143: error: ‘node’ was not declared in this scope
mac/wireless-phy.h: At global scope:
mac/wireless-phy.h:143: error: ‘friend’ used outside of class
mac/wireless-phy.h:147: error: expected declaration before ‘}’ token
make: *** [mac/mac802_11p.o] Error 1


best regards,

Chadi
  


[ns] [very urgent] need IEEE 802.11p package

2011-05-14 Thread chadi jabroun


hi 

can any body provides me by the IEEE 802.11p package developed by sherbrook 
university


thanks for your help, it will be very appreciated.

best regards,

Chadi


  


[ns] [very urgent] download an IEEE 802.11p package‏

2011-05-12 Thread chadi jabroun


hi
 
I'm working on creating a L2 handover scenario using the IEEE 802.11p protocole.
 
The IEEE 802.11p protocole integrated in ns2.34 doesn't support handover layer 
2.
 
 
could any body provide me by the IEEE 802.11p package or a link to download it.
 
please I need help it is very urgent
 
 
thank you very much, your help will be very appreciated.
 
 
best regards,
 
Chadi Jabroun
  


[ns] [very urgent] download an IEEE 802.11p package

2011-05-11 Thread chadi jabroun


Hi

I want to install the IEEE 802.11p in ns2.

Can any body help me, and send me the IEEE 802.11p package or a link to 
download the package.

Please I need help it is very urgent

thank you,

Best regards,

Chadi Jabroun

  


[ns] [urgent] download an IEEE802.11p package

2011-05-06 Thread chadi jabroun


Hi

I want to install the IEEE 802.11p in ns2.

Can any body help me, and give me a link to download the package.

Please I need help it is very urgent

thank you,

Best regards,

Chadi Jabroun





  


[ns] patch for HMIPv6

2011-05-04 Thread chadi jabroun


hi 
 
I'm looking for a patch to install HMIPv6 in ns2.34.
 
can any body provides me by a link from which i can download the patch?
 
please I need help, it is urgent
 
thank you very much 
 
 
Chadi Jabroun
  


[ns] [urgent] mac-802_11pExt

2011-04-26 Thread chadi jabroun


Hi

does mac-802_11pExt.cc support handover between two base stations

thank you very much 
  


[ns] install NIST mobility package

2011-04-21 Thread chadi jabroun


Hi 

I'm using ns2.34, do i need a specific version of NIST package?
could any body give me a link to download the mobility nist package. 

thank you very much for your help

best regards, 


[ns] define a base sation

2011-04-20 Thread chadi jabroun


hi 

any body can tell how i can define a base station. I'm using IEEE 802.11Ext 
(ieee 802.11p)

thanks for your help


  


[ns] mac handoff between 2 base stations

2011-04-19 Thread chadi jabroun


hi all
 
I want to create a scenario where a mobile node will do a mac handoff between 2 
base stations using 802.11.
yet, the conection will be lost when the mobile node move out from the range of 
the first base station. It can not connect to the second base station.
 
I take a look of the implementation of 802.11 and i found that it doesn't 
support a mac handoff.
am i right? and how i can find a solution for my problem?
 
please I need help, it is urgent 
 
thank you very much. 
 
best regards,
 
  


[ns] urgent: creating a handover scenario between two base station

2011-04-18 Thread chadi jabroun
   [new Topography]

$topo load_flatgrid $val(x) $val(y)



 
#God (General Operations Director) is the object that is used to store global 
information about the state of the environment, network or nodes

create-god [expr $val(nn) + $num_bs_nodes]

 
# Create channel

set chan_ [new $val(chan)]

# create wired nodes
  set temp {0.0.0 0.1.0}
#  for {set i 0} {$i  $num_wired_nodes} {incr i} {
# set W($i) [$ns node [lindex $temp $i]]
#  } 

set W(0) [$ns node 0.0.0]
set W(1) [$ns node 0.1.0]
 
# configure for base-station node
# nodes configuration

$ns node-config -adhocRouting $val(rp) \

 -llType $val(ll) \

 -macType $val(mac) \

 -ifqType $val(ifq) \

 -ifqLen $val(ifqlen) \

 -antType $val(ant) \

 -propType $val(prop) \

 -phyType $val(netif) \

 -channel $chan_ \

 -topoInstance $topo \
 -wiredRouting ON \

 -agentTrace OFF \

 -routerTrace OFF \

 -macTrace ON 

# -movementTrace OFF \

# -phyTrace OFF

#create base-station node

set BS(0) [$ns node 1.0.0]
$BS(0) random-motion 0   ;# disable random motion
set BS(1) [$ns node 2.0.0]
$BS(1) random-motion 0   ;# disable random motion

 
# Provide initial location of mobile nodes

$BS(0) set X_ 200.0

$BS(0) set Y_ 400.0

$BS(0) set Z_ 0.0

 
$BS(1) set X_ 400.0

$BS(1) set Y_ 400.0

$BS(1) set Z_ 0.0

 

#configure for mobilenodes
$ns node-config  -wiredRouting OFF
 

# now create mobilenodes

set node(0) [ $ns node 1.0.1 ]

$node(0) base-station [AddrParams addr2id \ [$BS(0) node-addr]]   ;# provide 
each mobilenode with hier address of its base-station

$node(0) set X_ 40.0

$node(0) set Y_ 330.0

$node(0) set Z_ 0.0



# create links between wired and BaseStation nodes
  $ns duplex-link $W(0) $W(1) 5Mb 200ms DropTail
  $ns duplex-link $W(1) $BS(0) 5Mb 200ms DropTail
  $ns duplex-link $W(1) $BS(1) 5Mb 200ms DropTail
  $ns duplex-link-op $W(0) $W(1) orient down
  $ns duplex-link-op $W(1) $BS(0) orient left-down
  $ns duplex-link-op $W(1) $BS(1) orient right-down

# setup TCP connections between a wired node and the Mobilenode

set tcp1 [new Agent/TCP]
$tcp1 set class_ 2  
set sink1 [new Agent/TCPSink]
$ns attach-agent $W(0) $tcp1
$ns attach-agent $node(0) $sink1
$ns connect $tcp1 $sink1
set ftp1 [new Application/FTP]
$ftp1 attach-agent $tcp1
$ns at 6.0 $ftp1 start


# Generation of movements

$ns at 10 $node(0) setdest 500.0 330.0 20.0

 
# Define node initial position in nam

 

$ns initial_node_pos $node(0) 20


# Telling nodes when the simulation ends

 
$ns at $val(stop).010 $BS(0) reset;

$ns at $val(stop).010 $BS(1) reset;
$ns at $val(stop).010 $node(0) reset;
 
# ending nam and the simulation 

#$ns at $val(stop).0010 $ns nam-end-wireless $val(stop)

$ns at $val(stop).1 puts \end simulation\ ; $ns halt

proc finish {} {

global ns tracefd namtrace

$ns flush-trace

close $tracefd

close $namtrace

exec nam out.nam 

}

$ns at 150 finish

$ns run





my problem is while the mobile node is moving out of the range of BS0, it can 
not connect to BS1.





hoping that you have any idea about my problem.





thank you very much



best regards,



Chadi Jabroun



  


[ns] beacon transmission in 802.11Ext

2011-04-18 Thread chadi jabroun


hi

does the implementation of  the mac extension (mac 802_11Ext) support a beacon 
transmission? 
Can a base station transmit a periodic beacon?

thanks for your help 

best regards,
  
  


[ns] urgent: creating handover process using mac802.11Ext

2011-04-16 Thread chadi jabroun


hi 
 
I want to create a handover scenario, between 2 base station, using an 
extension of the mac 802.11 : Mac/802_11Ext

i have created the scenario, but  the mobile  node can not connect to the 
second base station during the handover process.

my tcl script is the following: 

#802.11p default parameters

 
Phy/WirelessPhyExt set CSThresh_3.162e-12   ;#-85 dBm Wireless 
interface sensitivity (sensitivity defined in the standard)

Phy/WirelessPhyExt set Pt_  0.001 

Phy/WirelessPhyExt set freq_5.9e+9

Phy/WirelessPhyExt set noise_floor_ 1.26e-13;#-99 dBm for 10MHz 
bandwidth

Phy/WirelessPhyExt set L_   1.0 ;#default radio 
circuit gain/loss

Phy/WirelessPhyExt set PowerMonitorThresh_  6.310e-14   ;#-102dBm power 
monitor  sensitivity

Phy/WirelessPhyExt set HeaderDuration_  0.40;#40 us

Phy/WirelessPhyExt set BasicModulationScheme_   0

Phy/WirelessPhyExt set PreambleCaptureSwitch_   1

Phy/WirelessPhyExt set DataCaptureSwitch_   0

Phy/WirelessPhyExt set SINR_PreambleCapture_2.5118; ;# 4 dB

Phy/WirelessPhyExt set SINR_DataCapture_100.0;  ;# 10 dB

Phy/WirelessPhyExt set trace_dist_  1e6 ;# PHY trace until 
distance of 1 Mio. km (infinty)

Phy/WirelessPhyExt set PHY_DBG_ 0

 
Mac/802_11Ext set CWMin_15

Mac/802_11Ext set CWMax_1023

Mac/802_11Ext set SlotTime_ 0.13

Mac/802_11Ext set SIFS_ 0.32

Mac/802_11Ext set ShortRetryLimit_  7

Mac/802_11Ext set LongRetryLimit_   4

Mac/802_11Ext set HeaderDuration_   0.40

Mac/802_11Ext set SymbolDuration_   0.08

Mac/802_11Ext set BasicModulationScheme_0

Mac/802_11Ext set use_802_11a_flag_ true

Mac/802_11Ext set RTSThreshold_ 2346

Mac/802_11Ext set MAC_DBG   0

 
#=

 
#configure RF model parameters

Antenna/OmniAntenna set Gt_ 1.0

Antenna/OmniAntenna set Gr_ 1.0

 
Propagation/Nakagami set use_nakagami_dist_ false

Propagation/Nakagami set gamma0_ 2.0

Propagation/Nakagami set gamma1_ 2.0

Propagation/Nakagami set gamma2_ 2.0

 
Propagation/Nakagami set d0_gamma_ 200

Propagation/Nakagami set d1_gamma_ 500

 
Propagation/Nakagami set m0_  1.0

Propagation/Nakagami set m1_  1.0

Propagation/Nakagami set m2_  1.0

 
Propagation/Nakagami set d0_m_ 80

Propagation/Nakagami set d1_m_ 200

 
#===

 
set val(chan)   Channel/WirelessChannel

set val(prop)   Propagation/TwoRayGround

 
set val(netif)  Phy/WirelessPhyExt

set val(mac)Mac/802_11Ext

set val(ifq)Queue/DropTail/PriQueue

set val(ll) LL

set val(ant)Antenna/OmniAntenna

set val(x)  700   ;# X dimension of the topography

set val(y)  600   ;# Y dimension of the topography

set val(ifqlen) 50   ;# max packet in ifq

set val(nn) 2 ;# how many Mobile nodes are simulated
set val(rp) DSDV

set val(stop)   250   ;# simulation time
set num_wired_nodes  2
set num_bs_nodes 2

# =

 
set ns   [new Simulator]

# set up for hierarchical routing
  $ns node-config -addressType hierarchical
  AddrParams set domain_num_ 3 ;# number of domains   
  lappend cluster_num 2 1 1;# number of clusters in 
each domain
  AddrParams set cluster_num_ $cluster_num
  lappend eilastlevel 1 1 2 2  ;# number of nodes in each 
cluster for each domain
  AddrParams set nodes_num_ $eilastlevel
 
set tracefd  [open trace.tr w]

set namtrace  [open out.nam w]

 
$ns trace-all $tracefd

$ns namtrace-all-wireless $namtrace $val(x) $val(y)

$ns namtrace-all $namtrace 

 
# set up topography object

set topo   [new Topography]

$topo load_flatgrid $val(x) $val(y)



 
#God (General Operations Director) is the object that is used to store global 
information about the state of the environment, network or nodes

create-god [expr $val(nn) + $num_bs_nodes]

 
# Create channel

set chan_ [new $val(chan)]

# create wired nodes
  set temp {0.0.0 0.1.0}
#  for {set i 0} {$i  $num_wired_nodes} {incr i} {
# set W($i) [$ns node [lindex $temp $i]]
#  } 

set W(0) [$ns node 0.0.0]
set W(1) [$ns node 0.1.0]
 
# configure for base-station node
# nodes configuration

$ns node-config -adhocRouting $val(rp) \

 -llType $val(ll) \

 -macType $val(mac) \

 -ifqType $val(ifq) \

 -ifqLen $val(ifqlen) \

 -antType $val(ant) \

 -propType $val(prop) \

   

[ns] create a base station

2011-04-13 Thread chadi jabroun


hi
 
I need to know how to create a base station in ns2, using the protocol IEEE 
802.11p.
 
best regards,
 
 
 
  


[ns] FW: creating an access point in IEEE 802.11p

2011-04-11 Thread chadi jabroun




From: chad...@hotmail.com
To: ns-users@isi.edu
Subject: creating an access point in IEEE 802.11p
Date: Mon, 11 Apr 2011 06:49:22 +








hi

I'm working on ns2.34 under ubuntu8.10 and I'm trying to create a handover 
scenario using the IEEE802.11p
I get an error invoked from within while I'm creating the access point.

My TCL script is the following:
#-
#802.11p default parameters 
 
Phy/WirelessPhyExt set CSThresh_3.162e-12   ;#-85 dBm Wireless 
interface sensitivity (sensitivity defined in the standard) 
Phy/WirelessPhyExt set Pt_  0.001  
Phy/WirelessPhyExt set freq_5.9e+9 
Phy/WirelessPhyExt set noise_floor_ 1.26e-13;#-99 dBm for 10MHz 
bandwidth 
Phy/WirelessPhyExt set L_   1.0 ;#default radio 
circuit gain/loss 
Phy/WirelessPhyExt set PowerMonitorThresh_  6.310e-14   ;#-102dBm power 
monitor  sensitivity 
Phy/WirelessPhyExt set HeaderDuration_  0.40;#40 us 
Phy/WirelessPhyExt set BasicModulationScheme_   0 
Phy/WirelessPhyExt set PreambleCaptureSwitch_   1 
Phy/WirelessPhyExt set DataCaptureSwitch_   0 
Phy/WirelessPhyExt set SINR_PreambleCapture_2.5118; ;# 4 dB 
Phy/WirelessPhyExt set SINR_DataCapture_100.0;  ;# 10 dB 
Phy/WirelessPhyExt set trace_dist_  1e6 ;# PHY trace until 
distance of 1 Mio. km (infinty) 
Phy/WirelessPhyExt set PHY_DBG_ 0 
 
Mac/802_11Ext set CWMin_15 
Mac/802_11Ext set CWMax_1023 
Mac/802_11Ext set SlotTime_ 0.13 
Mac/802_11Ext set SIFS_ 0.32 
Mac/802_11Ext set ShortRetryLimit_  7 
Mac/802_11Ext set LongRetryLimit_   4 
Mac/802_11Ext set HeaderDuration_   0.40 
Mac/802_11Ext set SymbolDuration_   0.08 
Mac/802_11Ext set BasicModulationScheme_0 
Mac/802_11Ext set use_802_11a_flag_ true 
Mac/802_11Ext set RTSThreshold_ 2346 
Mac/802_11Ext set MAC_DBG   0 
 
#= 
 
#configure RF model parameters 
Antenna/OmniAntenna set Gt_ 1.0 
Antenna/OmniAntenna set Gr_ 1.0 
 
Propagation/Nakagami set use_nakagami_dist_ false 
Propagation/Nakagami set gamma0_ 2.0 
Propagation/Nakagami set gamma1_ 2.0 
Propagation/Nakagami set gamma2_ 2.0 
 
Propagation/Nakagami set d0_gamma_ 200 
Propagation/Nakagami set d1_gamma_ 500 
 
Propagation/Nakagami set m0_  1.0 
Propagation/Nakagami set m1_  1.0 
Propagation/Nakagami set m2_  1.0 
 
Propagation/Nakagami set d0_m_ 80 
Propagation/Nakagami set d1_m_ 200 
 
#=== 
 
set val(chan)   Channel/WirelessChannel 
set val(prop)   Propagation/TwoRayGround 
 
set val(netif)  Phy/WirelessPhyExt 
set val(mac)Mac/802_11Ext 
set val(ifq)Queue/DropTail/PriQueue 
set val(ll) LL 
set val(ant)Antenna/OmniAntenna 
set val(x)  1000   ;# X dimension of the topography 
set val(y)  1000   ;# Y dimension of the topography 
set val(ifqlen) 50   ;# max packet in ifq 
set val(nn) 3 ;# how many nodes are simulated 
set val(rp) DumbAgent 
set val(stop)   150   ;# simulation time 
# = 
 
set ns   [new Simulator] 
set tracefd  [open trace.tr w] 
set namtrace  [open out.nam w] 
 
$ns trace-all $tracefd 
$ns namtrace-all-wireless $namtrace $val(x) $val(y) 
$ns namtrace-all $namtrace  
 
# set up topography object 
set topo   [new Topography] 
$topo load_flatgrid $val(x) $val(y) 
 
#God (General Operations Director) is the object that is used to store global 
information about the state of the environment, network or nodes 
create-god $val(nn) 
 
# Create channel 
set chan_ [new $val(chan)] 
 
# nodes configuration 
$ns node-config -adhocRouting $val(rp) \ 
 -llType $val(ll) \ 
 -macType $val(mac) \ 
 -ifqType $val(ifq) \ 
 -ifqLen $val(ifqlen) \ 
 -antType $val(ant) \ 
 -propType $val(prop) \ 
 -phyType $val(netif) \ 
 -channel $chan_ \ 
 -topoInstance $topo \ 
 -agentTrace OFF \ 
 -routerTrace OFF \ 
 -macTrace ON \ 
 -movementTrace ON \ 
 -phyTrace OFF 
 
#Create nodes  
for {set i 0} {$i  $val(nn) } { incr i } { 
set node_($i) [$ns node] 
$node_($i) random-motion 0;# disable random motion 
set mac_($i) [$node_($i) getMac 0] 
} 
 
#Set node_(0) and node_(1) as the APs 
 
 set AP_ADDR1 [$mac_(0) id] 
 $mac_(0) ap $AP_ADDR1 
 $mac_(0) 

[ns] creating an access point in IEEE802.11p

2011-04-11 Thread chadi jabroun


hi

I'm working on ns2.34 under ubuntu8.10 and I'm trying to create a handover 
scenario using the IEEE802.11p
I get an error invoked from within while I'm creating the access point.

My TCL script is the following:
#-
#802.11p default parameters 
 
Phy/WirelessPhyExt set CSThresh_3.162e-12   ;#-85 dBm Wireless 
interface sensitivity (sensitivity defined in the standard) 
Phy/WirelessPhyExt set Pt_  0.001  
Phy/WirelessPhyExt set freq_5.9e+9 
Phy/WirelessPhyExt set noise_floor_ 1.26e-13;#-99 dBm for 10MHz 
bandwidth 
Phy/WirelessPhyExt set L_   1.0 ;#default radio 
circuit gain/loss 
Phy/WirelessPhyExt set PowerMonitorThresh_  6.310e-14   ;#-102dBm power 
monitor  sensitivity 
Phy/WirelessPhyExt set HeaderDuration_  0.40;#40 us 
Phy/WirelessPhyExt set BasicModulationScheme_   0 
Phy/WirelessPhyExt set PreambleCaptureSwitch_   1 
Phy/WirelessPhyExt set DataCaptureSwitch_   0 
Phy/WirelessPhyExt set SINR_PreambleCapture_2.5118; ;# 4 dB 
Phy/WirelessPhyExt set SINR_DataCapture_100.0;  ;# 10 dB 
Phy/WirelessPhyExt set trace_dist_  1e6 ;# PHY trace until 
distance of 1 Mio. km (infinty) 
Phy/WirelessPhyExt set PHY_DBG_ 0 
 
Mac/802_11Ext set CWMin_15 
Mac/802_11Ext set CWMax_1023 
Mac/802_11Ext set SlotTime_ 0.13 
Mac/802_11Ext set SIFS_ 0.32 
Mac/802_11Ext set ShortRetryLimit_  7 
Mac/802_11Ext set LongRetryLimit_   4 
Mac/802_11Ext set HeaderDuration_   0.40 
Mac/802_11Ext set SymbolDuration_   0.08 
Mac/802_11Ext set BasicModulationScheme_0 
Mac/802_11Ext set use_802_11a_flag_ true 
Mac/802_11Ext set RTSThreshold_ 2346 
Mac/802_11Ext set MAC_DBG   0 
 
#= 
 
#configure RF model parameters 
Antenna/OmniAntenna set Gt_ 1.0 
Antenna/OmniAntenna set Gr_ 1.0 
 
Propagation/Nakagami set use_nakagami_dist_ false 
Propagation/Nakagami set gamma0_ 2.0 
Propagation/Nakagami set gamma1_ 2.0 
Propagation/Nakagami set gamma2_ 2.0 
 
Propagation/Nakagami set d0_gamma_ 200 
Propagation/Nakagami set d1_gamma_ 500 
 
Propagation/Nakagami set m0_  1.0 
Propagation/Nakagami set m1_  1.0 
Propagation/Nakagami set m2_  1.0 
 
Propagation/Nakagami set d0_m_ 80 
Propagation/Nakagami set d1_m_ 200 
 
#=== 
 
set val(chan)   Channel/WirelessChannel 
set val(prop)   Propagation/TwoRayGround 
 
set val(netif)  Phy/WirelessPhyExt 
set val(mac)Mac/802_11Ext 
set val(ifq)Queue/DropTail/PriQueue 
set val(ll) LL 
set val(ant)Antenna/OmniAntenna 
set val(x)  1000   ;# X dimension of the topography 
set val(y)  1000   ;# Y dimension of the topography 
set val(ifqlen) 50   ;# max packet in ifq 
set val(nn) 3 ;# how many nodes are simulated 
set val(rp) DumbAgent 
set val(stop)   150   ;# simulation time 
# = 
 
set ns   [new Simulator] 
set tracefd  [open trace.tr w] 
set namtrace  [open out.nam w] 
 
$ns trace-all $tracefd 
$ns namtrace-all-wireless $namtrace $val(x) $val(y) 
$ns namtrace-all $namtrace  
 
# set up topography object 
set topo   [new Topography] 
$topo load_flatgrid $val(x) $val(y) 
 
#God (General Operations Director) is the object that is used to store global 
information about the state of the environment, network or nodes 
create-god $val(nn) 
 
# Create channel 
set chan_ [new $val(chan)] 
 
# nodes configuration 
$ns node-config -adhocRouting $val(rp) \ 
 -llType $val(ll) \ 
 -macType $val(mac) \ 
 -ifqType $val(ifq) \ 
 -ifqLen $val(ifqlen) \ 
 -antType $val(ant) \ 
 -propType $val(prop) \ 
 -phyType $val(netif) \ 
 -channel $chan_ \ 
 -topoInstance $topo \ 
 -agentTrace OFF \ 
 -routerTrace OFF \ 
 -macTrace ON \ 
 -movementTrace ON \ 
 -phyTrace OFF 
 
#Create nodes  
for {set i 0} {$i  $val(nn) } { incr i } { 
set node_($i) [$ns node] 
$node_($i) random-motion 0;# disable random motion 
set mac_($i) [$node_($i) getMac 0] 
} 
 
#Set node_(0) and node_(1) as the APs 
 
 set AP_ADDR1 [$mac_(0) id] 
 $mac_(0) ap $AP_ADDR1 
 $mac_(0) ScanType PASSIVE 
 
 set AP_ADDR2 [$mac_(1) id] 
 $mac_(1) ap $AP_ADDR2 
 $mac_(1) ScanType PASSIVE 
 
 #$ns at 4.0 $mac_(2) ScanType ACTIVE 
 
#