Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

Posts

Showing posts from 2018

How to add a Protocol in ns2 - NS2 Tutorial #13

How to add a new protocol in ns2 I am going to use the version ns-2.35 protoname was one of the best unicast routing protocol for ns2. Agent/SIMP Protoname -| Simp PROTONAME -| SIMP protoname -| simp you can download teh source code from https://www.nsnam.com There are totally 5 files in the source code protoname.cc converted to simp.cc protoname.h -| simp.h protoname_pkt.h -| simp_pkt.h protoname_rtable.cc -| simp_rtable.cc protoname_rtable.h -| simp_rtable.h In this new protocol, we have to 1. Add the source code (the 5 files given above) 2. existing code modification (within ns2) 3. Make an entry in the Makefile.in 4. Recompile ns2 5. Test the protocol using a TCL file. Addition of source code is done. Existing code modification - Very important. in ns2, inforamtion about compilation is scattered... we need to make modifications at multiple locations. What are the files that are needed for modification. all the file locations are here. To add a packet data ~ns-allinone-2.35/ns

Simple Screen Recorder for Linux

Recording the screen in Linux OS is always a tedious task, as either the video/audio malfunctions or support may not be there. There is a tools called simple screen recorder for Linux. Its a very simple tool that is recorded and processed in no time. For example, if you record an 1 hour video, the processing may take another 20 to 50 minutes. But this software does the “On the fly recording and processing” This software has a straight forward interface and its incomparable to other softwares in the market. Its faster than VLC It never takes more amount of RAM like VLC do. Its multithreaded, if you have more than one core, then the processing happens at all the cores. it can do live streaming also, but it is under experimental setting. it supports many different codecs. Here is the simple screenshot. Simple Screen Recorder A 42 minute video is recorded using this software and it takes just 42minute only. no extra time for processing. Please see the youtube video attached below. Moodle Q

Wormhole Attack in ns2 with full source code

Wormhole attack in ns2 - with full source code. OS Used: Ubuntu 18.04 LTS Ns2 version - 2.35 Just three files are to be modified arp.cc ll.h ll.cc Download link for all the files .cc, .h and .tcl files https://drive.google.com/open?id=1l2Fc43lirb3J008czDAhb_A8hvAPCdbH All these files are located in the ~ns-2.35/mac/ How to do? Copy all the above three files in the mac/ folder and open the terminal $] cd ns-allinone-2.35/ns-2.35 $] make  You should not get any error. Once done, open the tcl files given in the folder ex-wormhole and run the examples and predict the performance as per the video given above. What is wormhole? How to download the files. I will give the copy of the above three files in my website https://www.nsnam.com Very soon, I will move to github. Subscribe to my youtube channel and share. Explanation of Wormhole Attack Hope you would have enjoyed this worm hole attack in ns2. Please download the full source code from my website

How to add a Protocol in ns2 - NS2 Tutorial #13

How to add a new protocol in ns2 I am going to use the version ns-2.35 protoname was one of the best unicast routing protocol for ns2. Agent/SIMP Protoname -> Simp PROTONAME -> SIMP protoname -> simp you can download the  source code from https://www.nsnam.com There are totally 5 files in the source code protoname.cc converted to simp.cc  protoname.h -> simp.h  protoname_pkt.h -> simp_pkt.h  protoname_rtable.cc -> simp_rtable.cc  protoname_rtable.h -> simp_rtable.h New Protocol Implementation In this new protocol,  we have to 1. Add the source code (the 5 files given above) 2. existing code modification (within ns2) 3. Make an entry in the Makefile.in 4. Recompile ns2 5. Test the protocol using a TCL file. Addition of source code is done. Existing code modification - Very important. in ns2, inforamtion about compilation is scattered... we need to make modifications at multiple locations. What are the files that ar

Blackhole attack in ns2 - NS2 Tutorial # 12

How to add a black hole attack in AODV protocol in ns2. https://www.nsnam.com  You can download the source code here: https://drive.google.com/open?id=1LFRrmJM3YXiQT3X1HMSFyS9T9d8oWlIx Black hole is the basic attack in a network, here we are going mitigate this attack in ns2. Trust value, based on the trust value, if the value is less, then we can make it as an attacker node. High trust, medium trust and low trust (integer) Trusted or not (boolean) To make a node attacker node (preferanly a black hole attack, how to do that?) AODV protocol as it is easy to implement in ns2. Step 1: Declare the attacker variable We will two files aodv.h and aodv.cc files  in aodv.h file,  create a variable name as given below in the protected scope bool attacker; Step 2: initialise the attacker variable as false. In aodv.cc file, initialise the attacker to be false inside the constructor. Step 3: if a node is a blackhole, what happens to a

Finding Energy, node position and speed in AODV - NS2 Tutorial # 11.1

AODV - Part 2 Finding the node position, energy and speed of the node while it is forwarding a packet. By default, these codes are not there in AODV, so we are going to modify or append in AODV protocol.. Steps Step 1: Open aodv.h and aodv.cc, these two files will be modified Step 2: Declare variables in aodv.h file in protected mode double xpos,ypos,zpos,energy_t; int n_speed; MobileNode *t_node; FILE *fp; Step 3: initialize these values inside the constrctor of aodv.cc file xpos=ypos=zpos=0.0; n_speed=0; energy_t=0.0; fp=fopen("runtime.dat","w"); Step 4: add the following statements to the forward() function of aodv.cc fprintf(fp,"Position is X, Y, Z, Node Speed,Energy\n"); t_node=(MobileNode*)(Node::get_node_by_address(index)); ((MobileNode*) t_node)->getLoc(&xpos,&ypos,&zpos); fprintf(fp,"%d %f %f %f",index,xpos,ypos,zpos); t_node=(MobileNode*)(Node::get_node_by_address(inde

AODV simulation in NS2 (Part 1) - NS2 Tutorial # 11

Lecture 11 - AODV - Part 1 Todays topic on AODV protocol AODV - Adhoc Ondemand Distance Vector the location of the source code for Aodv is in the folder ~ns-2.35/aodv/ My suggestion is Always try to understand the header file first.. later you can move on to source file (.cc files) I will go through aodv.h file first and then aodv.cc file next.... let me explain.... I should know where my work is residing, for example in AODV should I work on Routing Table Energy Management Quality oif Service Link Failure Logs or tracing Neighbour management Attacks (Black hole, gray hole, etc...) Security so prefer to stay at the header files first... Now the action begins. how do i modify the AODV protocol as per my small piece of algorithm... I would like to print the nodes that are forwarding the packets. Two information will be recorded in a text file separately.. Name of the file: aodv_output.dat data recorded will be: forwarded packet, node index (node numbe

Creation of a New Agent in ns2 - NS2 Tutorial # 10

To create an new Agent in NS2 that describes the OTcl and C++ linkages We know that the file is stored in the folder ~ns-2.35/pradeep/tspagent.cc Open the file ns-2.35/Makefile.in and make an entry of your own file (in this case, it is tspagent.cc Find a vairable inside the Makefile.in called OBJ_CC= and make an entry there as shown below pradeep/tspagent.o \ Save the file and open a terminal, go to the folder ~ns-2.35/ and execute the command one by one $] ./configure $] make Correct any mistakes or errors in your .cc file and run the above commands. Successful OTcl and C++ linkages.... Thank you and Stay tuned for more lectures Next lecture will be on AODV protocol and its modification. Refer my website nsnam.com for downloading the source code and refer my videos at https://www.youtube.com/tspradeepkumar Share and Subscribe. Thank you...... Download the files here https://drive.google.com/open?id=1kaIrYn91xl2NUNNK64cjHrEHyiSJCIiY T S Pradee

Comparison of AODV, DSR and DSDV in ns2 - NS2 Tutorial # 9

Performance Evaluation of Adhoc Routing Protocols using NS2 Very old Project as well as a topic, but this will give an idea of how to compare multiple protocols or agents. 1 hour Project* See the video for the full project * - you should know ns2 already should know how to write AWK scripts Should know about energy model Should know about wireless networks and protocols To know the above concepts, check my Ns2 Lecture series videos in Youtube and come back to this video Youtube.com/tspradeepkumar AODV, DSDV and DSR AODV - Adhoc On Demand Distance Vector DSDV - Destination Sequenced Distance Vector DSR - Dynamic Source Routing Lcture 8 - AWK Scripts Average throughput Instant throughput Residual Energy Packet Delivery ratio To download the source codes, visit https://www.nsnam.com Going inside the project Step 1: Use the same network and same disntace, energy, etc when you compare multiple protocols Step 2: Generate Scenario, You need not write th

AWK Scripts for NS2 - NS2 Tutorial # 8

This is one of the important in ns2 as we are going to analyse the performance metrics of the network In this session, we are going to see the following metrics. 1. Average Throughput 2. instant Throughput 3. Packet Delivery Ratio 4. Residual Energy of the nodes. A - Aho W - Weinberger K - Keninghan Easy to implement and process. BEGIN { } { } END { } In ns2, new trace format, there could be as many as 52 columns. Each column specify some parameters. Viewers are requested to go through these parameters through the documentation. in aAWK, $1 refers 1st column $2 refers 2nd column and so on... awk can be run using either of these commands $] awk -f filename.awk filename.tr or $] gawk -f filename.awk filename.tr Average throughput is done You can download this source code in https://www.nsnam.com Instant Throughput with two values to plot the characteristics. Residual Energy of the individual nodes AND ALSO THE AVERAGE RESIDUAL EN

Energy Model in ns2 - NS2 Tutorial # 6

LEcture 6 - Ns2 Energy Model Wireless NEtworking in ns2 By default, nodes have infinite energy, to make it finite, we need to implement energy model. in the node config we need to include the following lines -energyModel "EnergyModel" \ -initialEnergy 3.0 \ -txPower 0.9 \ -rxPower 0.5 \ -idlePower 0.45 \ -sleepPower 0.05 \ Energy (joules) = Power (Watts) * Time (sec) www.nsnam.com for downloading the source codes Also subscribe to my youtube channel www.youtube.com/tspradeepkumar Thanks for watching. Stay Tuned for more Lectures... Subscribe and Share. Copy the Source Code here #Lecture 6  #Example of Wireless networks #Step 1 initialize variables #Step 2 - Create a Simulator object #step 3 - Create Tracing and animation file #step 4 - topography #step 5 - GOD - General Operations Director #step 6 - Create nodes #Step 7 - Create Channel (Communication PATH) #step 8 - Position of the nodes

Wireless network Coding in ns2 - NS2 Tutorial # 5

This post shows you how to write TCL code for Wireless simulations in ns2. It also explains the various aspects of wireless network. It is part of a lecture series in network simulator 2. The following image is shown for explanation Wireless Networks Download the Source code for Wireless Networks #Example of Wireless networks #Step 1 initialize variables #Step 2 - Create a Simulator object #step 3 - Create Tracing and animation file #step 4 - topography #step 5 - GOD - General Operations Director #step 6 - Create nodes #Step 7 - Create Channel (Communication PATH) #step 8 - Position of the nodes (Wireless nodes needs a location) #step 9 - Any mobility codes (if the nodes are moving) #step 10 - TCP, UDP Traffic #run the simulation #initialize the variables set val(chan)           Channel/WirelessChannel    ;#Channel Type set val(prop)           Propagation/TwoRayGround   ;# radio-propagation model set val(netif)          Phy/WirelessPhy            ;# network