Hi all, I am just trying to learn the basic of NS2 so that I can later use these characteristics on my simulation. Here, I wanted to achieve a few things. I want to define that 2 of the nodes are Access points and 8 are normal sensors. Also, I want node 2,3,4,5 to communicate with node 0(the access point) and node 6, 7,8,9 to communicate with node 1(another access point). So, it is 2 star topology existing together (same radio space) but I want to seperate communication. Also, I want to define different node characteristics for the access point and the sensor node (especially tx/rx range).
The issues: 1) Below is the script of the program that I think is most relevent of what I want to achieve. If somebody could help me, I would be very grateful. $ns_ node-config -adhocRouting AODV \ -llType ll \ -macType mac/802_15_4 \ -ifqType $val(ifq) \ -ifqLen $val(ifqlen) \ -antType $val(ant) \ -propType $val(prop) \ -phyType $val(netif) \ -topoInstance $topo \ -agentTrace OFF \ -routerTrace OFF \ -macTrace ON \ -movementTrace OFF \ #-energyModel "EnergyModel" \ #-initialEnergy 1 \ #-rxPower 0.3 \ #-txPower 0.3 \ -channel $chan_1_ for {set i 0} {$i < 2 } {incr i} { set app_ [new Application/SensorBaseApp/CommonNodeApp] set node_($i) [$ns_ node] $node_($i) random-motion 0 ;# disable random motion } Phy/WirelessPhy set CSThresh_ $dist(20m) Phy/WirelessPhy set RXThresh_ $dist(20m) $ns_ node-config -adhocRouting AODV \ -ifqLen 200 \ for {set i 2} {$i < 6 } {incr i} { set app_ [new Application/AccessPointApp] $app_ set destination_id_ 0 set node_($i) [$ns_ node] $node_($i) random-motion 0 ;# disable random motion } for {set i 6} {$i < $val(nn) } {incr i} { set app_ [new Application/AccessPointApp] $app_ set destination_id_ 1 set node_($i) [$ns_ node] $node_($i) random-motion 0 ;# disable random motion $ns_ at 0.0 "$node_(0) NodeLabel PAN Coor1" $ns_ at 0.0 "$node_(0) sscs startPANCoord 1" ;# startPANCoord <txBeacon=1> <BO=3> <SO=3> $ns_ at 0.5 "$node_(2) sscs startDevice 1 0" ;# startDevice <isFFD=1> <assoPermit=1> <txBeacon=0> <BO=3> <SO=3> $ns_ at 1.5 "$node_(3) sscs startDevice 1 0" $ns_ at 2.5 "$node_(4) sscs startDevice 1 0" $ns_ at 3.5 "$node_(5) sscs startDevice 1 0" $ns_ at 0.0 "$node_(1) NodeLabel PAN Coor2" $ns_ at 0.1 "$node_(1) sscs startPANCoord 1" ;# startPANCoord <txBeacon=1> <BO=3> <SO=3> $ns_ at 0.5 "$node_(6) sscs startDevice 1 0" ;# startDevice <isFFD=1> <assoPermit=1> <txBeacon=0> <BO=3> <SO=3> $ns_ at 1.5 "$node_(7) sscs startDevice 1 0" $ns_ at 2.5 "$node_(8) sscs startDevice 1 0" $ns_ at 3.5 "$node_(9) sscs startDevice 1 0" ////////////////////////////////////////////////////////////// Please do go through and provide me with the possible guidance. As of now, the program isnt giving any error but the sensor node is attaching itself the the PAN co-ordinator randomly and the one that I want it to attach to. If my method is incorrect or some1 can guide me to another method, I would be glad to hear it. 2) Another issue also exist. I get error "recvTimer1:Invalid MAC Control Subtype 7" when I use -macType mac/802_11. I am using ns2.29 on ubuntu 9.04 with mannasim extension. 3) I also want to program sleeping pattern for the sensor nodes. I am not sure if there already exist, if yes, can some1 point me in the right direction. Also, the use of superframe order (SO) and beacon order (BO) is also a bit confusing to me. I have referred to Zheng's FAQ ( http://www-ee.ccny.cuny.edu/zheng/pub/Pages/wpan-ns2-faq.htm) where he discussed it. Quote, "BO determines the length of the whole superframe and SO determines the length of the active part of the superframe. So you need to set the SO to a value smaller than BO -- opposite to what you have done." I tried upto very high setting such as "$node_(0) sscs startPANCoord 1 1 1000" and still the association to the PAN co-ordination takes equal time as if it was not sleeping at all. I would like to know how to check whether a node is sleeping or awake. Is there some trace or some method to check that? 4) I would like to send very small packets of data (4 bytes). But when I use cbr, I get packet size of 31 on tranmitting side and 24 on receiving( I believe after removal of MAC header) and for FTP, i get tcp packet of 60, 64, 67, 71 bytes which means 71 and 64 bytes including all headers. I would like to know if there is a way to reduce this overhead in any way? maybe some other selection of transport, routing or even MAC protocol?? Its been a long mail with many questions and if some1 could help me even in some part, I would be very grateful. Thanks. -Ravit