NS2: Getting node position and energy

It has been really long time since my last post my and I am back. Finally, I could make little time to write this post. I believe such information is available in elsewhere. But, I also believe explaining simple method of obtaining node position and current remaining energy would help a lot of people. I strongly suggest scanning the code of WFRP before reading the post further. Alright, lets get […]

NS2: How to add new routing protocol

Writing routing protocol is fairly easy in NS2, but for beginners it seems very difficult. Therefore, if you are new to NS2 and want to write your own routing protocol, I would strongly recommend to revise AODV source code. Because, I believe AODV source code is straightforward and fairly easy to understand due to the simplicity of the AODV protocol. Before you begin reading this post, I assume that you […]

NS2: simple method to analyze traces

Today I am going to show a simple perl code to analyze NS2 trace file as an example of AODV routing protocol. As you know when you run simulation, NS2 generates a trace file like sometrace.tr. It will give a lot of information about your simulation result. Not knowing how to analyze this file it is useless to run NS2 simulator. In this topic we will learn how to compute […]

NS2: Adding Malicious Node to AODV

Many people have asked me how to implement malicious drop in AODV. I have decided to write simple code for adding malicious node in AODV ( or in any routing protocol). First you need to modify aodv.cc and aodv.h files. In aodv.h after add following line With this variable we are trying to define if the node is malicious or not. In aodv.cc after add following line The above code […]