LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-06-2014, 02:43 PM   #1
mary1001
Member
 
Registered: Jul 2014
Location: Iran
Posts: 76

Rep: Reputation: Disabled
error in useing some malicious node in a scenario in ns2


hi
i use an instruction to add some malicious node to my scenario.now by running this scenario i have this error:


me@HP-PC ~/Desktop/ns-allinone-2.35/ns-2.35/tcl/ex $ ns smm.tcl
num_nodes is set 40
INITIALIZE THE LIST xListHead
ns: _o61 malicious :
(_o61 cmd line 1)
invoked from within
"_o61 cmd malicious"
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 "_o61" line 2)
(SplitObject unknown line 2)
invoked from within
"_o61 malicious "



i attach the instruction and my scenario.
Attached Files
File Type: txt instruction malicious.txt (1.9 KB, 105 views)
File Type: txt smm.tcl.txt (43.1 KB, 122 views)

Last edited by mary1001; 12-06-2014 at 11:34 PM.
 
Old 12-06-2014, 04:32 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,425

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
Now you have at least two files by name sm.txt .
http://www.linuxquestions.org/questi...s2-4175527446/

REPEAT : "A file.tcl must be attached as file.tcl.txt,
and a unique file name must be used .. "

Please edit your attachment to <unique-name>.tcl.txt

-
 
Old 12-06-2014, 11:27 PM   #3
mary1001
Member
 
Registered: Jul 2014
Location: Iran
Posts: 76

Original Poster
Rep: Reputation: Disabled
now i correct #1 , please answer my question.
 
Old 12-07-2014, 04:01 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,425

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
← #1 .

Seems you are using code like provided by `aodv-malicious_ns235.patch'.
``malicious´´ is defined as hacker.

Your smm.tcl was edited to "hacker" in order to show a fairly simulation:
Code:
294:$ns at 0.0 "[$node_(2) set ragent_] hacker "
295:$ns at 0.0 "[$node_(8) set ragent_] hacker "
296:$ns at 0.0 "[$node_(14) set ragent_] hacker "
297:$ns at 0.0 "[$node_(20) set ragent_] hacker "
298:$ns at 0.0 "[$node_(26) set ragent_] hacker "
299:$ns at 0.0 "[$node_(32) set ragent_] hacker "
300:$ns at 0.0 "[$node_(38) set ragent_] hacker "
.. The numbers are line numbers in the edited file.

Code:
$ ns235-malicious hacker_smm-06Dec2014.tcl
.
Direction for pkt-flow not specified; Sending pkt up the stack on default.
check_pktTx:Invalid MAC Control subtype
The simulation stopped at an early stage, caused by :
» check_pktTx:Invalid MAC Control subtype «
The files out.tr, 2.6 MB and out.nam, 2 MB were created.
The nam window didn't open, can be run manually : $ nam out.nam

» check_pktTx:Invalid MAC Control subtype « : I have no solution.


"instruction malicious.txt" :
Seems to be about another suggestion for the "malicious code".
-
Attached Files
File Type: txt _hacker_smm-06Dec2014.tcl.txt.bz2.txt (6.3 KB, 89 views)
 
Old 12-07-2014, 04:14 AM   #5
mary1001
Member
 
Registered: Jul 2014
Location: Iran
Posts: 76

Original Poster
Rep: Reputation: Disabled
sorry this txt file that you attach does not opened !!
 
Old 12-07-2014, 07:49 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,425

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
← #5 .

HOWTO unpack an attatchment.bz2(.txt) :

$ mv _hacker_smm-06Dec2014.tcl.txt.bz2.txt _hacker_smm-06Dec2014.tcl.txt.bz2
... then you can unpack the bzip2 compressed text file.

( $ bzip2 -d _hacker_smm-06Dec2014.tcl.txt.bz2 )
 
Old 12-07-2014, 08:43 AM   #7
mary1001
Member
 
Registered: Jul 2014
Location: Iran
Posts: 76

Original Poster
Rep: Reputation: Disabled
Unhappy

i had been run it as you say but it has the same error

me@HP-PC ~/Desktop/ns-allinone-2.35/ns-2.35/tcl/ex $ ns _hacker_smm-06Dec2014.tcl
num_nodes is set 40
INITIALIZE THE LIST xListHead
ns: _o61 hacker :
(_o61 cmd line 1)
invoked from within
"_o61 cmd hacker"
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 "_o61" line 2)
(SplitObject unknown line 2)
invoked from within
"_o61 hacker "

 
Old 12-07-2014, 08:53 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,425

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
← #7 .

So what have you done to ns-allinone-2.35/ns-2.35/ ?
? Which "malicious patch" have you added ? ?
 
Old 12-07-2014, 08:59 AM   #9
mary1001
Member
 
Registered: Jul 2014
Location: Iran
Posts: 76

Original Poster
Rep: Reputation: Disabled
instead adding this patch , i change the aodv.cc and aodv.h , like the patch. as the instruction had said. they are the same.
this patch = the instruction
 
Old 12-07-2014, 09:22 AM   #10
mary1001
Member
 
Registered: Jul 2014
Location: Iran
Posts: 76

Original Poster
Rep: Reputation: Disabled
ok i do as you say, and now i have the same error as you have.

me@HP-PC ~/Desktop/ns-allinone-2.35/ns-2.35/tcl/ex $ ns sm11.tcl
num_nodes is set 40
INITIALIZE THE LIST xListHead
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
Direction for pkt-flow not specified; Sending pkt up the stack on default.

Direction for pkt-flow not specified; Sending pkt up the stack on default.

Direction for pkt-flow not specified; Sending pkt up the stack on default.

Direction for pkt-flow not specified; Sending pkt up the stack on default.

Direction for pkt-flow not specified; Sending pkt up the stack on default.

Direction for pkt-flow not specified; Sending pkt up the stack on default.

Direction for pkt-flow not specified; Sending pkt up the stack on default.

Direction for pkt-flow not specified; Sending pkt up the stack on default.

Direction for pkt-flow not specified; Sending pkt up the stack on default.

check_pktTx:Invalid MAC Control subtype


what is your idea? is any thing in my scenario has a problem?
are the channel or antenna correct? or other thing in the tcl file

Last edited by mary1001; 12-07-2014 at 09:27 AM.
 
Old 12-07-2014, 10:49 AM   #11
mary1001
Member
 
Registered: Jul 2014
Location: Iran
Posts: 76

Original Poster
Rep: Reputation: Disabled
i add this code to my scenario :


Phy/WirelessPhy set Pt_ 0.031622777
Phy/WirelessPhy set bandwidth_ 11Mb
Mac/802_11 set dataRate_ 11Mb
Mac/802_11 set basicRate_ 1Mb

Phy/WirelessPhy set freq_ 2.472e9

Phy/WirelessPhy set CPThresh_ 5.011872e-12
Phy/WirelessPhy set CSThresh_ 5.011872e-12
Phy/WirelessPhy set L_ 1.0
Phy/WirelessPhy set RXThresh_ 5.82587e-09


i dont know what is this code for, but i think this parameters should be set for a scenario in wireless.
when i add this code, my scenario start to run but it does not finish at all. i think it is beacuse of the bad setting in this parameters.
the output after adding this code to sm.tcl :

me@HP-PC ~/Desktop/ns-allinone-2.35/ns-2.35/tcl/ex $ ns sm.tcl
num_nodes is set 40
INITIALIZE THE LIST xListHead
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 422.8
SORTING LISTS ...DONE!
highestAntennaZ_
^C
 
Old 04-04-2015, 02:39 AM   #12
Mellia
LQ Newbie
 
Registered: Mar 2015
Posts: 12

Rep: Reputation: Disabled
hi knudfl
i'm working on malicious node too but in zrp. i didnt use malicious patch as mary1001 did and just change zrp.h also zrp.cc.
I got error problem when i was running the tcl

Code:
agustus@agustus-Presario-CQ42-Notebook-PC:~/agustus/ns-allinone-2.35/latihan$ ns235-zrp malicious.tcl
num_nodes is set 7
INITIALIZE THE LIST xListHead
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 550.0
SORTING LISTS ...DONE!
ns: _o53 malicious: 
    (_o53 cmd line 1)
    invoked from within
"_o53 cmd malicious"
    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 "_o53" line 2)
    (SplitObject unknown line 2)
    invoked from within
"_o53 malicious"
the tcl code is
Code:
#===================================
#     Simulation parameters setup
#===================================
set val(chan)   Channel/WirelessChannel    ;# channel type
set val(prop)   Propagation/TwoRayGround   ;# radio-propagation model
set val(netif)  Phy/WirelessPhy            ;# network interface type
set val(mac)    Mac/802_11                 ;# MAC type
set val(ifq)    Queue/DropTail/PriQueue    ;# interface queue type
set val(ll)     LL                         ;# link layer type
set val(ant)    Antenna/OmniAntenna        ;# antenna model
set val(ifqlen) 50                         ;# max packet in ifq
set val(nn)     7                          ;# number of mobilenodes
set val(rp)     ZRP                       ;# routing protocol
set val(x)      800                        ;# X dimension of topography
set val(y)      541                        ;# Y dimension of topography
set val(stop)   100.0                      ;# time of simulation end
Agent/ZRP set radius_ 2 	;# Setting ZRP radius=2

#===================================
#        Initialization        
#===================================
#Create a ns simulator
set ns [new Simulator]

#Setup topography object
set topo       [new Topography]
$topo load_flatgrid $val(x) $val(y)
create-god $val(nn)

#Open the NS trace file
set tracefile [open blackhole.tr w]
$ns trace-all $tracefile

#Open the NAM trace file
set namfile [open blackhole.nam w]
$ns namtrace-all $namfile
$ns namtrace-all-wireless $namfile $val(x) $val(y)
set chan [new $val(chan)];#Create wireless channel

#===================================
#     Mobile node parameter setup
#===================================
$ns node-config -adhocRouting  $val(rp) \
                -llType        $val(ll) \
                -macType       $val(mac) \
                -ifqType       $val(ifq) \
                -ifqLen        $val(ifqlen) \
                -antType       $val(ant) \
                -propType      $val(prop) \
                -phyType       $val(netif) \
                -channel       $chan \
                -topoInstance  $topo \
                -agentTrace    ON \
                -routerTrace   ON \
                -macTrace      OFF \
                -movementTrace ON

#===================================
#        Nodes Definition        
#===================================
#Create 7 nodes
set n0 [$ns node]
$n0 set X_ 99
$n0 set Y_ 299
$n0 set Z_ 0.0
$ns initial_node_pos $n0 20
set n1 [$ns node]
$n1 set X_ 299
$n1 set Y_ 297
$n1 set Z_ 0.0
$ns initial_node_pos $n1 20
set n2 [$ns node]
$n2 set X_ 499
$n2 set Y_ 298
$n2 set Z_ 0.0
$ns initial_node_pos $n2 20
set n3 [$ns node]
$n3 set X_ 700
$n3 set Y_ 299
$n3 set Z_ 0.0
$ns initial_node_pos $n3 20
set n4 [$ns node]
$n4 set X_ 199
$n4 set Y_ 350
$n4 set Z_ 0.0
$ns initial_node_pos $n4 20
set n5 [$ns node]
$n5 set X_ 599
$n5 set Y_ 350
$n5 set Z_ 0.0
$ns initial_node_pos $n5 20
set n6 [$ns node]
$n6 set X_ 600
$n6 set Y_ 200
$n6 set Z_ 0.0
$ns initial_node_pos $n6 20


# Node 5 is given RED Color and a label- indicating it is a Blackhole Attacker
$n5 color red
$ns at 0.0 "$n5 color red"
$ns at 0.0 "$n5 label Attacker"

# Node 0 is given GREEN Color and a label - acts as a Source Node
$n0 color green
$ns at 0.0 "$n0 color green"
$ns at 0.0 "$n0 label Source"

# Node 3 is given BLUE Color and a label- acts as a Destination Node
$n3 color blue
$ns at 0.0 "$n3 color blue"
$ns at 0.0 "$n3 label Destination"

#===================================
#    	Set node 5 as attacker    	 
#===================================
$ns at 20.0 "[$n2 set ragent_] malicious"
$ns at 30.0 "[$n2 set ragent_] normal"

#===================================
#        Agents Definition        
#===================================
#Setup a UDP connection
set udp0 [new Agent/UDP]
$ns attach-agent $n0 $udp0
set null1 [new Agent/Null]
$ns attach-agent $n3 $null1
$ns connect $udp0 $null1
$udp0 set packetSize_ 1500

#===================================
#        Applications Definition        
#===================================
#Setup a CBR Application over UDP connection
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $udp0
$cbr0 set packetSize_ 1000
$cbr0 set rate_ 0.1Mb
$cbr0 set random_ null
$ns at 1.0 "$cbr0 start"
$ns at 100.0 "$cbr0 stop"

#===================================
#        Termination        
#===================================
#Define a 'finish' procedure
proc finish {} {
    global ns tracefile namfile
    $ns flush-trace
    close $tracefile
    close $namfile
    exec nam blackhole.nam &
    exit 0
}
for {set i 0} {$i < $val(nn) } { incr i } {
    $ns at $val(stop) "\$n$i reset"
}
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "finish"
$ns at $val(stop) "puts \"done\" ; $ns halt"
$ns run
can you help me solve this problem?
thank you very much for your helping

Last edited by Mellia; 04-04-2015 at 06:20 AM.
 
Old 04-04-2015, 03:06 AM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,425

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
Re #12, @Mellia.

Code must be presented in 'code tags'. You can watch how it looks: post #4.
CODE Tags : The ' # ' button in the 'Advanced Editor'.
Or simply type [/code] at code end, and [code] at code begin.
* Please edit post #12 : The 'Edit' button in post #12.

ZRP malicious : Don't know, if it will work.
Please attach your code : zrp.h and zrp.cc.
Must be attached as zrp.h.txt , zrp.cc.txt .

Attachments : The paper clip tool in the 'Advanced Editor'.


-
 
Old 04-04-2015, 03:21 AM   #14
Mellia
LQ Newbie
 
Registered: Mar 2015
Posts: 12

Rep: Reputation: Disabled
re #13 @knudfl
okay thank you for your correction here it is the error code

Code:
agustus@agustus-Presario-CQ42-Notebook-PC:~/agustus/ns-allinone-2.35/latihan$ ns235-zrp malicious.tcl
num_nodes is set 7
INITIALIZE THE LIST xListHead
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
ns: _o53 malicious:
(_o53 cmd line 1)
invoked from within
"_o53 cmd malicious"
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 "_o53" line 2)
(SplitObject unknown line 2)
invoked from within
"_o53 malicious"
and i attach the tcl code, zrp.cc and zrp.h too
thank you for your helping
Attached Files
File Type: txt zrp.cc.txt (109.7 KB, 62 views)
File Type: txt zrp.h.txt (28.5 KB, 43 views)
File Type: txt malicious.tcl.txt (5.0 KB, 64 views)
 
Old 04-04-2015, 04:07 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,425

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
Re #14.

REPEAT : Please edit post #12 : The 'Edit' button in post #12.
>>> Tcl code in code tags.
 
  


Reply

Tags
malicious, ns2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in NS2.35 when creating node srikanthchikka Linux - Newbie 4 07-07-2014 09:52 PM
getting error in .tcl while creating malicious node in aodv in ns2.35 saa-6611 Linux - Software 12 05-22-2014 06:00 AM
Error on Tcl when add misbehavior node in aodv ns2 D4SH_SI4 Linux - Networking 5 06-28-2013 12:57 AM
NS-2: Malicious node in AODV Error amissan Linux - Software 1 05-05-2013 10:28 AM
tunnel formation between two malicious node by modifying aodv ns2 indumit18 Linux - Newbie 0 10-28-2011 05:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration