wormhole attack error

261 views
Skip to first unread message

Ade Lutfi

unread,
Jan 16, 2020, 10:08:58 AM1/16/20
to Network Simulator 2 (NS2)
hi everyone
I want to ask some help about wormhole attack. after replace files arp.cc ll.cc and ll.h to patch the wormhole but I still get this error
 (_o176 cmd line 1)
    invoked from within
"_o176 cmd wormhole_peer _o198"
    invoked from within
"catch "$self cmd $args" ret"
    invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
    (procedure "_o176" line 2)
    (SplitObject unknown line 2)
    invoked from within
"[$node_(7) set ll_(0)] wormhole_peer [$node_(8) set ll_(0)]"
    (file "node11.tcl" line 107)

can anyone help me? please. I really need this for my research. thank you.

knudfl

unread,
Jan 16, 2020, 12:09:27 PM1/16/20
to Network Simulator 2 (NS2)
Hi.

"node11.tcl" :  Unknown file.  Please attach the file to a new post.

? Where did you get the idea that replacing arp.cc ll.cc, ll.h will do for wormhole ? 
A link, please.

Ade Lutfi

unread,
Jan 17, 2020, 4:35:51 AM1/17/20
to Network Simulator 2 (NS2)
This is the link https://www.nsnam.com/2018/09/wormhole-attack-in-ns2-with-full-source.html?m=1

Can you show me how to patch wormhole attack please?

Ade Lutfi

unread,
Jan 17, 2020, 6:21:04 AM1/17/20
to Network Simulator 2 (NS2)
this is my tcl file
node11.tcl

knudfl

unread,
Jan 17, 2020, 8:19:52 AM1/17/20
to Network Simulator 2 (NS2)
Well, you could run and read the examples ...
... where the "wormhole peer" lines are not commented out :
→ wormhole-Mellia.tcl, originally  #18 https://www.linuxquestions.org/questions/showthread.php?p=5343173#post5343173 → #18 @Mellia
... to know that the setting / command is not wormhole_peer.
I.e. no "underscore" ( _ ) but a hyphen ( - ) :  wormhole-peer

[$node_(7) set ll_(0)] wormhole-peer [$node_(8) set ll_(0)]
[$node_(8) set ll_(0)] wormhole-peer [$node_(7) set ll_(0)]

Your file then runs OK :
[ex-wormhole-1]$ ns235-wormhole64 node11.tcl
num_nodes is set 11
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
(007) - LL::command - added 8 to wormhole peer list
(008) - LL::command - added 7 to wormhole peer list
Starting Simulation...
SORTING LISTS ...DONE!
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 0.2,  distCST_ = 763.1
NS EXITING...
... I used the mobility file "mobil-11" :  Attached.

mobil-11
Lutfi_node11-2.tcl

Ade Lutfi

unread,
Jan 17, 2020, 11:48:57 AM1/17/20
to Network Simulator 2 (NS2)
I'm sorry I still don't understand, where I can install command ns235-wormhole64? I try to install
sudo gdebi Downloads/byzantine-attacks-ns_2.29-ubuntu16_amd64.deb

but the output is this
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Building data structures... Done
This package is uninstallable
Wrong architecture 'amd64'

knudfl

unread,
Jan 17, 2020, 12:55:10 PM1/17/20
to Network Simulator 2 (NS2)
I have hundreds of different patched ns2. As they are different, the 'ns' commands are different too.
Hence "/usr/local/bin/ns235-wormhole64".   See the list  "usr.local.bin-17Jan2020.txt".

So 'ns235-wormhole64' is a copy of the 'ns' from my build of ns-2.35 + wormhole.
I.e. ns-allinone-2.35_gcc5.tar.gz + the three mac/ files {arp.cc,  ll.cc,  ll.h}.
https://drive.google.com/file/d/0B7S255p3kFXNVVlxR0ZNRGVORjQ/view?usp=sharing

The ns-2.29 + Byzantine-attacks is the original "wormhole-peer" application, based on the old ns-2.27 code https://web.njit.edu/~crix/software/wormhole.html

But as the ns-2.35 code works identically so far concerns wormhole, you don't need "Byzantine-attacks".
.....  Unless you want to write new simulation files for the 2008 Byzantine code.
( black hole, Byzantine wormhole, and Byzantine overlay network wormhole attack.)

Seems you have a 32bits OS :  64bits packages cannot be installed.
The Byzantine-attacks packages were built as 64bits only https://drive.google.com/drive/folders/0B7S255p3kFXNcEpiMmRyNTVndFE?usp=sharing
I don't remember why my `Byzantine-attacks´ builds all are 64bits.
The thing is, most people are using a 64bits OS ... which can also run all the old ns2 code for 32bits only.
( When a protocol works with 32bits only, the result was built here at  my CentOS5 or 6 - i386  (or Ubuntu 10.10 - i386) OS´s ... and repacked to both Debian packages.deb and Redhat packages.rpm ).
usr.local.bin-17Jan2020.txt
ns2-INFO.txt

Ade Lutfi

unread,
Jan 18, 2020, 9:14:43 AM1/18/20
to Network Simulator 2 (NS2)
Can you tell me how to install ns235-wormhole64 so J can run my tcl files?
I already install ns2 from your link you sent above but still error.
Message has been deleted
Message has been deleted

knudfl

unread,
Jan 18, 2020, 10:30:59 AM1/18/20
to Network Simulator 2 (NS2)
1.  The simple way: Replace / overwrite mac/{ arp.cc  ll.cc  ll.h }.
Delete  { arp.o,  ll.o }  if they are present in mac/,
and delete ns-2.35/ns, if present.

.... And run 'make' in ns-2.35/ :   A new 'ns'  is created.
Or run `./install´  in ns-allinone-2.35/.

2.  Build example, ns-2.35 + wormhole, with e.g. Ubuntu 18.04 :
sudo apt install g++-4.8
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 < wormhole_ns235.patch          
https
://drive.google.com/file/d/1YErI9TdsZjjgIRDjoRgZMLi0u-zM1WWy/view?usp=sharing
export CC=gcc-4.8 CXX=g++-4.8 && ./install
cd ns
-2.35/
cp ns ns235
-wormhole
sudo cp ns235
-wormhole /usr/local/bin/
----------- Simulation ------------
ns235
-wormhole 2worm14.tcl
.... The patch adds the three mac/ files, and the directory wormhole-ex/.
( where wormhole-ex/ has the latest simulation examples with "wormhole peer" ).
wormhole-ex-2.tar.gz

Ade Lutfi

unread,
Jan 18, 2020, 2:22:53 PM1/18/20
to Network Simulator 2 (NS2)
Thank you so much I can finally run my wormhole tcl file. thank you!

but then I have another problem. I'm trying to analys the tcl using gawk in any awk file (trhoughput, e2edelay, pearl, etc) the output is still the same
gawk: node11.tr:26072: M 20.70000 0 (485.30, 570.81, 0.00), (486.50, 568.31), 27.66
gawk: node11.tr:26072:                                    ^ syntax error
gawk: node11.tr:26072: M 20.70000 0 (485.30, 570.81, 0.00), (486.50, 568.31), 27.66
gawk: node11.tr:26072:                                                      ^ syntax error
gawk: node11.tr:26073: M 20.70000 0 (485.30, 570.81, 0.00), (486.50, 568.31), 27.66
gawk: node11.tr:26073:                                                             ^ unexpected newline or end of string
gawk: node11.tr:26073: M 20.70000 3 (191.38, 1057.69, 0.00), (193.18, 1055.51), 27.78
gawk: node11.tr:26073:                                     ^ syntax error
gawk: node11.tr:26073: M 20.70000 3 (191.38, 1057.69, 0.00), (193.18, 1055.51), 27.78
gawk: node11.tr:26073:                                                        ^ syntax error
gawk: node11.tr:26074: M 20.70000 3 (191.38, 1057.69, 0.00), (193.18, 1055.51), 27.78
gawk: node11.tr:26074:                                                               ^ unexpected newline or end of string
gawk: node11.tr:26074: M 20.70000 7 (146.65, 1111.83, 0.00), (148.14, 1110.01), 23.22
gawk: node11.tr:26074:   ^ memory exhausted

can you help me again?

knudfl

unread,
Jan 18, 2020, 3:37:21 PM1/18/20
to Network Simulator 2 (NS2)
»» .. using gawk in any awk file ... perl ... «« :  All 240 scripts ?

I can get some results ....
E.g. with the dash script `Metrics_Performance_Extractor.sh´ →
→ To be used in an empty folder with {Metrics_Performance_Extractor.sh and node11.tr} only.
I.e. a lot of output is generated. The GUI is dialog : $ sudo apt install dialog

The six results are attached ....
Lutfi_answer-analyze.txt

Ade Lutfi

unread,
Jan 19, 2020, 11:11:57 AM1/19/20
to Network Simulator 2 (NS2)
Wow, once again thank you kudfl. thank you so much. God bless you!
Reply all
Reply to author
Forward
0 new messages