how to create a data set in ns-2

430 views
Skip to first unread message

Parminderjeet Kaur

unread,
Jun 23, 2021, 2:30:19 PM6/23/21
to Network Simulator 2 (NS2)
hello every one,
some one please help me how i create a dataset from trace file for machine learning
or any other way to create a dataset ?

abdusalam yahya

unread,
Jun 26, 2021, 5:12:29 AM6/26/21
to ns-u...@googlegroups.com
pls specify the application that you want to create dataset from


--
You received this message because you are subscribed to the Google Groups "Network Simulator 2 (NS2)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-users+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-users/057c56e4-0e2d-464a-9185-1d7222609cden%40googlegroups.com.

abdusalam yahya

unread,
Jun 26, 2021, 5:13:39 AM6/26/21
to ns-u...@googlegroups.com
you have to check if ns2 support the application or not

Parminderjeet Kaur

unread,
Jul 22, 2021, 3:17:44 PM7/22/21
to Network Simulator 2 (NS2)
i want to create a dataset from blackholeattack. tr  file 

knudfl

unread,
Jul 24, 2021, 3:30:15 AM7/24/21
to Network Simulator 2 (NS2)
@parmind ,    Hi.

If you have read about ns2, you will know there are numerous scripts, awk and perl to create data from trace files.tr
Please also read the overview text file ,  z10-scripts-overview-10.txt

Parminderjeet Kaur

unread,
Jul 24, 2021, 1:29:54 PM7/24/21
to ns-u...@googlegroups.com

thanku so much  "knudfl" sir , i will try  i want to create a database  from blackhole.tr  for apply machine learning


Parminderjeet Kaur

unread,
Jul 24, 2021, 1:35:19 PM7/24/21
to ns-u...@googlegroups.com
hello sir,
kindly send me a script for blackhole.tr  file

On Sat, 24 Jul 2021 at 13:00, 'knudfl' via Network Simulator 2 (NS2) <ns-u...@googlegroups.com> wrote:

knudfl

unread,
Jul 24, 2021, 5:00:43 PM7/24/21
to Network Simulator 2 (NS2)
Hi.

1.  blackhole.tr  can be the trace file from the @Mohit Tahiliani simple "blackhole.tcl"
     It is a very simple simulation which doesn't provide much information.
     Is similar to the old "aodv-malicious_ns235.patch"

The advanced setup is 'blackholeaodv2013-ns235_1.patch'
examples,  blackholeaodv2005-2013-examples-1119.tar.gz
https://drive.google.com/file/d/1yCVjXWBmnYA3QJYzgxzNGmzizZQTPlzb/view?usp=sharing

2.  You already got a link to the ~240 awk and perl scripts →
     ........ I don't write code.  If you want a new script, please write it yourself.

Parminderjeet Kaur

unread,
Jul 27, 2021, 7:56:01 AM7/27/21
to ns-u...@googlegroups.com
thankyou so much,  '@knudfl' sir, m create a database with send packet and received packed.
I have been confused with the trace file, on the internet, there are different types of trace files, can you please explain only the first row of this trace file, I generate it from @Mohit Tahiliani simple "blackhole.tcl". I will be thankful to you.
Screenshot from 2021-07-27 04-50-49.png

blackhole.tr

knudfl

unread,
Jul 29, 2021, 4:17:03 AM7/29/21
to Network Simulator 2 (NS2)
The official NS-2 Trace Formats documentation NS-2 Trace Formats - nsnam sometimes works.

In the first column s = sent or forwarded. r = received .... or an attempt to receive, I think. You can read about the other terms in https://drive.google.com/file/d/1S612MEjyRCaDr_kLS3qMs4bqRlAJwwCP/view?usp=sharing
The "M blackhole.tcl" is old trace.
# New trace :
set ns  [new Simulator]  ;# you can write $ns use-newtrace   below this line
$ns use-newtrace    ;# Use new trace format


.......  I guess you know how to copy-paste a text.

knudfl

unread,
Jul 29, 2021, 4:34:15 AM7/29/21
to Network Simulator 2 (NS2)

Parminderjeet Kaur

unread,
Jul 29, 2021, 9:27:47 AM7/29/21
to ns-u...@googlegroups.com
Thankyou 'Knudfl' sir.
 

Parminderjeet Kaur

unread,
Jul 30, 2021, 8:43:52 AM7/30/21
to ns-u...@googlegroups.com
hello, respected 'Knudfl' sir,
kindly send me @Mohit Tahiliani 'blackhole'  attack any detection or mitigate technique  code, urgently 
i will be very thankful to you.

knudfl

unread,
Jul 30, 2021, 11:18:16 AM7/30/21
to Network Simulator 2 (NS2)
As already said, the Mohit Tahiliani  aodvblackhole / aodvmalicious is simple, and leaves little or no information.
The advanced  (blackholeaodv2013-ns235_1.patch) can be handled with "idsAODV" https://www.google.dk/search?q=idsaodv
...... But success stories are few.
Patch : idsAODV-2-for-blackhole2013-patched_ns235.patch
https://drive.google.com/file/d/0B7S255p3kFXNT0FjUTBTR21sMzg/view?usp=sharing


tar xvf ns-allinone-2.35_gcc5.tar.gz
https://drive.google.com/file/d/0B7S255p3kFXNVVlxR0ZNRGVORjQ/view?usp=sharing
cd ns-allinone-2.35/
patch -p0 < blackholeaodv2013-ns235_1.patch
https://drive.google.com/file/d/0B7S255p3kFXNWWVDZzd2ZC14akE/view?usp=sharing
patch -p0 < idsAODV-2-for-blackhole2013-patched_ns235.patch
https://drive.google.com/file/d/0B7S255p3kFXNT0FjUTBTR21sMzg/view?usp=sharing
./install
cd ns-2.35/
cp ns ns235-blackhole+idsaodv
sudo cp ns235-blackhole+idsaodv /usr/local/bin/


------------- Simulation ----------
ns235-blackhole+idsaodv idsaodv2.tcl

Parminderjeet Kaur

unread,
Jul 30, 2021, 12:23:28 PM7/30/21
to ns-u...@googlegroups.com
Thanku sir , i will try this code, can i use mohit Tahiliani  blackhole tcl file , or will generate other tcl file

knudfl

unread,
Jul 30, 2021, 2:14:36 PM7/30/21
to Network Simulator 2 (NS2)
Please read my previous answer about  blackholeaodv2005-2013-examples-1119.tar.gz :
Is a different setup / a different blackhole definition, i.e. please read blackholeaodv2013-ns235_1.patch → it's a text file.

Parminderjeet Kaur

unread,
Jul 30, 2021, 2:26:34 PM7/30/21
to ns-u...@googlegroups.com
hello sir ,
what is the mean of this command ; "cp ns ns235-blackhole+idsaodv"
and "sudo cp ns235-blackhole+idsaodv /usr/local/bin/"

Parminderjeet Kaur

unread,
Jul 30, 2021, 2:50:54 PM7/30/21
to Network Simulator 2 (NS2)
hello ''knudfl" sir,  i configure   "blackholeaodv2013-ns235_1.patch"  how i check performance of blackhole? 

knudfl

unread,
Jul 30, 2021, 2:51:16 PM7/30/21
to Network Simulator 2 (NS2)
Hi.

You can have as many times ns-allinone-2.xx as you want, installed at the same time ....
.... but you can only have one executable ns . I have more than 300 different "ns", so they have different names

( There are ~300 patches from the 100 pieces of saved ns2 code, and some are for 3 .. 4 ns2 versions, and then some patches are for combined protocols https://drive.google.com/drive/folders/0B7S255p3kFXNZ2lWZDBRSW40Q00?resourcekey=0-eBw6mJFKhSVGultqaD2rDA&usp=sharing ).

Parminderjeet Kaur

unread,
Jul 30, 2021, 2:54:27 PM7/30/21
to Network Simulator 2 (NS2)
yes , sir i installed  "blackholeaodv2013-ns235_1.patch" as well as ids, 
now I want to simply check the blackhole network performance.

knudfl

unread,
Jul 30, 2021, 2:59:41 PM7/30/21
to Network Simulator 2 (NS2)
cp ns ns235-blackhole+idsaodv :    ns is copied to a new name = ns235-blackhole+idsaodv
This new copy is installed to a system PATH = /usr/local/bin   →
$ sudo cp ns235-blackhole+idsaodv /usr/local/bin/

»» i configure   "blackholeaodv2013-ns235_1.patch" «« :  When the patch is applied to a new ns-2.35, and everything is built, you can run all the examples to watch the behavior.  Performance ?  I don't know.

Parminderjeet Kaur

unread,
Jul 30, 2021, 3:10:01 PM7/30/21
to ns-u...@googlegroups.com
hello sir.
  i run this command "cd ns ns235-blackhole+idsaodv"  and got this error "bash: cd: ns: No such file or directory"


knudfl

unread,
Jul 30, 2021, 8:00:38 PM7/30/21
to Network Simulator 2 (NS2)
Copy is not 'cd' .    It is cp.
I.e. you are supposed to copy ns to a new file name = ns235-blackhole+idsaodv . (Or whatever name you decide.)
$ cd ns-2.35/  && cp ns [new name]

Parminderjeet Kaur

unread,
Jul 31, 2021, 4:42:02 AM7/31/21
to ns-u...@googlegroups.com
yes 'knudfl' sir , m successfully "cp ns ns235-blackhole+idsaodv" run this command , after that i "sudo cp ns235-blackhole+idsaodv /usr/local/bin/" run it ask me for password , after password nothing proceed, when i  run this "ns235-blackhole+idsaodv idsaodv2.tcl" got couldn't read file "idsaodv2.tcl": no such file or directory,

knudfl

unread,
Jul 31, 2021, 5:48:38 AM7/31/21
to Network Simulator 2 (NS2)
About   $ ns235-blackhole+idsaodv  idsaodv2.tcl

.... You must change directory = cd   .... to use the folder with idsaodv2.tcl

Like this :   cd ex_idsAODV-05.17/  &&  ns235-blackhole+idsaodv  idsaodv2.tcl

knudfl

unread,
Jul 31, 2021, 6:07:26 AM7/31/21
to Network Simulator 2 (NS2)
A couple of edits → new examples package :   idsAODV-examples-0721.tar.xz

Parminderjeet Kaur

unread,
Jul 31, 2021, 6:14:40 AM7/31/21
to ns-u...@googlegroups.com
yes sir, there are two tcl files in "idsaodv" folder  name is "idsaodv.tcl", and "idsaodv-1.tcl", there is no file named "idsaodv2.tcl" , and when i run "idsaodv.tcl",  getting this error mesage ----- invalid command name "Agent/rtProto/idsAODV"
    while executing
"Agent/rtProto/idsAODV instproc init args {
        $self next $args
}       "
    (file "idsaodv.tcl" line 19)
and when i run  "idsaodv-1.tcl" getting an error message is -------------invalid command name "Agent/rtProto/""
    while executing
"Agent/rtProto/" set dport_ 0"
    (file "idsaodv-1.tcl" line 24)

***** i insatalled the "idsAODV-2-for-blackhole2013-patched_ns235.patch" ***

Parminderjeet Kaur

unread,
Jul 31, 2021, 7:00:44 AM7/31/21
to ns-u...@googlegroups.com
yes  sir , m run "idsaodv2.tcl" file it show only one node name is blackhole  and "idsAODV_mohawad-blackh.tcl" it show only blackhole process only drop the packets

Parminderjeet Kaur

unread,
Aug 1, 2021, 6:48:08 PM8/1/21
to ns-u...@googlegroups.com
hello 'Knudfl' sir , i run "Clustering-moc_v1__idsAODV.tcl" and  "joseph4-blackh-idsaodv.tcl" successfully, kindly tell me how i check the blackhole attack performance without "ids" , i want to show the with blackhole and with "ids "  network. please tell me urgently ,  i will be thankful to you.
Clustering-moc_v1__idsAODV.tcl
joseph4-blackh-idsaodv.tcl

knudfl

unread,
Aug 2, 2021, 6:44:28 AM8/2/21
to Network Simulator 2 (NS2)
Hi.

»» check the blackhole attack performance without "ids"«« :
Run the file Clustering-moc_v1_blackh.tcl .
Edit a copy of joseph4-blackh-idsaodv.tcl to joseph4-blackh.tcl, edit line 18 (idsAODV) to AODV, and run.
.....  Then you should have the two trace.tr without ids influence.

You can also edit the name of the created trace files.tr .... to make it easier to compare results.

P.S.:  There have been no success stories measuring if IDS actually made any difference.
...... I hope you have better luck!

Parminderjeet Kaur

unread,
Aug 2, 2021, 11:08:39 AM8/2/21
to ns-u...@googlegroups.com
yes  sir , m tried  both files idsAODV changed  to AODV,  but nothing changed in trace files , both files output same 

Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

ihab jabor

unread,
May 12, 2024, 11:46:33 AM5/12/24
to Network Simulator 2 (NS2)
Dear Parmind..
how can I contact you please ? 

ihab jabor

unread,
May 19, 2024, 1:32:23 PM5/19/24
to Network Simulator 2 (NS2)
Dear Parmind, 
Hope you sound great, I need to contact you kindly. 
Regards 

Parminderjeet Kaur

unread,
May 19, 2024, 2:44:11 PM5/19/24
to ns-u...@googlegroups.com

ihab jabor

unread,
May 23, 2024, 4:09:16 PM5/23/24
to Network Simulator 2 (NS2)
Kindly Parmind, Sir I need to contact you urgently , 
can I have your email please ? 

Reply all
Reply to author
Forward
0 new messages