top of page
Search
sstendovik1983

NS2 Tutorial for Wireless Sensor Networks: Everything You Need to Know (PDF Download)



Ns2 Tutorial for engineers.For Creating latest ad hoc network,wireless sensor network simulations using ns-2 contact us also for best implementation.Our staff helps in clearing all your doubts with best effort.Get guidance also for better implementation of ns-2 projects.


IMPORTANT: This tutorial chapter uses new node APIs which are notavailable in the ns2.1b5 version. So please download the daily snapshotunless a release is made for version ns2.1b6 or higher. The currentsnapshot version is updated daily, so please check the validationtest results for that day before downloading, as these snapshots cansometimes be unstable due to ongoing changes made by ns-developers.




ns2 tutorial for wireless sensor networks pdf download




The wireless simulation described in section IX,supports multi-hop ad-hocnetworks or wireless LANs. But we may need to simulate a topology ofmultiple LANs connected through wired nodes, or in other words we need tocreate a wired-cum-wireless topology.


Note that it is important for the base-station node to bein the same domain as the wireless nodes. This is so that all pktsoriginating from the wired domain, and destined for a wireless node willreach the base-station which then uses its adhoc routing protocol to routethe pkt to its correct destination. Thus in a mixed simulation involvingwired and wireless nodes its necessary : 1) to turn on hierarchical routing 2) to create separate domains for wired and wireless nodes. There maybe multiple wired and wireless domains to simulate multiple networks. 3) to have one base-station node in every wireless domain, thru whichthe wireless nodes may communicate with nodes outside their domain.


This would be followed by the remaining lines from wireless1.tcl (sourcing cpand sc files, telling mobilenodes when to stop andfinally running ns). It is possible that some lines of code in wireless2.tcl have not beendiscussed here. For a complete copy of script wireless2.tcl, download fromhere.


We shall edit wireless2.tcl createdin section X.1 to createthe wireless-mip script called wireless3.tcl. It may be possible thatthe whole of wireless3.tcl is not discussed here. So for convinience,you may download a copy of wireless3.tcl from here.


B.Parno et al. [24] were the first to propose two probabilistic algorithms Randomized Multicast (RM) and Line-Selected Multicast (LSM) for the full fledge detection of clones/replicas in wireless sensor networks which follow the claimer reporter witness approach. In RM, when a claimer node announces its location by locally broadcasting the signed location claim to its neighbors, each of its neighbor nodes (who is aware of its own position) become a reporter with probability p after verifying the plausibility of the location. Each reporter then selects O(n) random destinations in the network and forwards the authenticated location claim to the nodes close to those random locations that are called witness nodes. If there is a replica in the network and the reporters of that replicated node also select (n) random destinations then by exploiting the birthday paradox at least one common witness will receive two conflicting location claims with high probability. This witness node can immediately publicize the network with the evidence of incoherent location claims to discredit and revoke the clone/replica node. RM implies high communication cost as each neighbor has to send O(n) messages to achieve common witnesses. In LSM, when a claimer node announces its location, every neighbor becomes a reporter with probability p after locally checking the signature of the claim and then forwards it to randomly selected destinations. During the propagation of the location claim from a reporter node to a witness node it must pass through several intermediate nodes on the forwarding route which also store the location claim randomly drawing a line across the network and thus serve as additional witnesses. In case of a clone node, when a conflicting location claim by a clone node crosses the forwarded path for the legitimate node, the intermediate node at the intersection of the two paths will detect the conflict, further excluding the clone node. LSM was proposed to introduce an improvement in terms of detection probability and the network-wide communication cost reduced from n2toO(nn). But LSM suffers from uneven distribution of witnesses nodes as majority of witness nodes are selected from the center of the network, the energy of these nodes is depleted soon thus they become the point of interest for the adversary.


Hello Ankur,The trace script that you have posted is of wired network. AWK scripts provided on my blog are mainly for wireless networks. You need to modify them to support wired networks. For more information on how to work with AWK scripts and graphs, visit my blog named "Xgraph and AWK Scripts in NS-2" (uploaded today).Hope it helps.Regards,Mohit P. Tahiliani


@Irina - You can find the necessary information from the tutorial (Chapter 2, 3 & 4) given on the following link: -sop.inria.fr/maestro/personnel/Eitan.Altman/COURS-NS/n3.pdf@Pradeep - You can download the AWK script for delay from the following link and make necessary modifications if required: -more-awk-scripts-for-ns2.html@Ashok - Hello packets are sent at regular intervals by every node. This is done by implementing a timer in C++. For details refer to the AODV tutorial which I gave you earlier. Look for the following functions:1. In Section 5.2 - Hello Timer2. In Section 5.3.5 - sendHello()3. In Section 5.3.6 - recvHello(Packet *p)Hope it helps.Regards,Mohit P. Tahiliani


@Bahareh - AWK Scripts designed for wireless networks will not work on wired networks because the trace format of wireless simulation differs from the trace format of wired simulation.AWK scripts are mostly designed to be generic i.e. they can be used for UDP/TCP with any number of sources. However, if required, one might specifically design an AWK script which may need protocol information as well.Hope it helps.Regards,Mohit P. Tahiliani


@Vish - These errors are due to the newer versions of gcc that you may be using. I guess you have switched to NRLSensorSim for simulations which I think is a good move.@Ranjana - To know about simulations of AODV, I would suggest you to learn more about wireless network simulations in NS-2. There are many sample TCL scripts as well as AWK scripts available. You can also refer the tutorial on following link which gives a nice description of AODV simulation in NS-2: -npa.lip6.fr/rehmani/aodv_v2.pdf@Adamu - You may have to make some modifications in the AWK script according to your trace file/format. Example: check whether the transport protocol used in your simulation is same as the one mentioned in AWK script. If not, please replace it by the one which you are using in your simulations.Hope it helps.Regards,Mohit P. Tahiliani


hi i am ankit . I am doing a project on implementing network coding and calculating its throughput in wireless networks.i want to calculate throughput from a trace file using an awk code . can u tell me what command to use? in which directory the trace file and awk code must be stored?


hello sir,i am a student of telecom and networkingi am doing my final project on ns2 i.e analysis of queuing techniques in wireless networks. i found a module of 802.16 on the following website _ns2/ when i copied all in the files into ns2 and added the info into the make file, when i do ./configure, it gives me an error saying no .configure file found.can u help me fix this..


@Deepak - Yes you need to learn C++ if you want to modify the working of existing protocols in NS-2 or wish to write a new protocol in NS-2. For implementing Wireless security related scenarios please follow the links given below: qinwan/resources.htm =196@Legend Killer - Make sure you are giving ./configure in ns-allinone-2.xx/ns-2.xx directory.You can visualize packets flowing using NAM utility of NS-2 for wired as well as wireless networks.@Faran - Packet size is kept more than 512 as per our application requirement. You may modify it as per your requirements. However note that we are also ripping off the header data. If your application does not require such constraint you may remove that entire "if" condition itself.Hope it helps.Regards,Mohit P. Tahiliani


Hello Sir,Is it possible to simulate a wireless sensor network in NS2 with respect to days or months and also to apply different amount of energy to different nodes? As for my application I am working on a Zigbee based WSN. Please guide me the needful.Thank you


@Vineet - SAODV patch is available on the following link: -2292/@Mandar - Yes you can use the same AWK file for different protocols in wireless networks. For wired networks, you will have to use different AWK Scripts because trace file format for wired networks is different from that of trace file format for wireless.@Rabin - Directional antenna is not available in the default allinone package of ns2. You need to apply a patch for it. It is available on the following link: -directional-antenna-and-multiple-interface-support-to-ns-233/Hope it helps.Regards,Mohit P. Tahiliani


hello sir...........i m doing final year project in secure wireless sensor network using ns2..........would you tell us??how to retrieve energy for sensor nodes using ns2...????and how to generate key for sensor nodes using ns2..????


Hello Sir..Actually I am working on a project named enhancing the efficiency QOS of wireless networks and for that I wanted the awk script file for AOMDV..The AWK files on ur links are only for aodv..plz provide it ASAP..thnx a lot 2ff7e9595c


1 view0 comments

Recent Posts

See All

Encha a geladeira mod apk

Fill Up Fridge MOD APK: um jogo de quebra-cabeça divertido e desafiador Você adora jogos de quebra-cabeça que testam sua lógica e...

Comments


bottom of page