LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-24-2016, 12:15 AM   #1
uttam khawas
LQ Newbie
 
Registered: Nov 2016
Location: sikkim
Posts: 2

Rep: Reputation: Disabled
I m getting an error while running a tcl script on wireless aodv routing protocol in ns2.35.


"this is the error i am getting running in tcl script on wireless ad hoc routing protocol in ns2.35 in ubuntu 15.10. The script was running and giving the output and the same code is giving error now."
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
Segmentation fault (core dumped)

"how to attach a file?"
"I would be greatful if you could kindly help me ."
"Thanking you"
 
Old 11-24-2016, 06:55 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,071

Rep: Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887
Quote:
Originally Posted by uttam khawas View Post
"this is the error i am getting running in tcl script on wireless ad hoc routing protocol in ns2.35 in ubuntu 15.10. The script was running and giving the output and the same code is giving error now."
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
Segmentation fault (core dumped)
Think about what you posted: it WAS working and now it's NOT. The obvious question is What changed??? SOMETHING modified the code/script to change the results. Also, the error seems pretty clear...it's telling you "use -channel". Did you DO SO?
Quote:
"how to attach a file?" "I would be greatful if you could kindly help me ."
Look at the icons on top of the posting window. Click the paper clip, or hover over it, and you'll see it come up as "Attachments".
 
1 members found this post helpful.
Old 11-29-2016, 12:54 AM   #3
uttam khawas
LQ Newbie
 
Registered: Nov 2016
Location: sikkim
Posts: 2

Original Poster
Rep: Reputation: Disabled
tcl code error for aodv simulation in ns2.35

Quote:
Originally Posted by TB0ne View Post
Think about what you posted: it WAS working and now it's NOT. The obvious question is What changed??? SOMETHING modified the code/script to change the results. Also, the error seems pretty clear...it's telling you "use -channel". Did you DO SO?

Look at the icons on top of the posting window. Click the paper clip, or hover over it, and you'll see it come up as "Attachments".
thank you for your reply..

this is the code from which i m getting error:
"warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl"

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) 3 ;# number of mobilenodes
set val(rp) AODV ;# routing protocol
set val(x) 500 ;# X dimension of topography
set val(y) 400 ;# Y dimension of topography
set val(stop) 150 ;# time of simulation end

set ns [new Simulator]
set tracefd [open happy.tr w]
set windowVsTime2 [open lost.tr w]
set namtrace [open happy.nam w]
#$ns aodv.tcl.txt

$ns trace-all $tracefd
$ns namtrace-all-wireless $namtrace $val(x) $val(y)


# set up topography object
set topo [new Topography]

$topo load_flatgrid $val(x) $val(y)

create-god $val(nn)

#
# Create nn mobilenodes [$val(nn)] and attach them to the channel.
#

# configure the nodes
$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) \
-channelType $val(chan) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace ON

for {set i 0} {$i < $val(nn) } { incr i } {
set node_($i) [$ns node]
}

# Provide initial location of mobilenodes
$node_(0) set X_ 5.0
$node_(0) set Y_ 5.0
$node_(0) set Z_ 0.0

$node_(1) set X_ 490.0
$node_(1) set Y_ 285.0
$node_(1) set Z_ 0.0

$node_(2) set X_ 150.0
$node_(2) set Y_ 240.0
$node_(2) set Z_ 0.0

# Generation of movements
$ns at 10.0 "$node_(0) setdest 250.0 250.0 3.0"
$ns at 15.0 "$node_(1) setdest 45.0 285.0 5.0"
$ns at 110.0 "$node_(0) setdest 480.0 300.0 5.0"

# Set a TCP connection between node_(0) and node_(1)
set tcp [new Agent/TCP/Newreno]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns attach-agent $node_(0) $tcp
$ns attach-agent $node_(1) $sink
$ns connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns at 10.0 "$ftp start"

# Printing the window size
proc plotWindow {tcpSource file} {
global ns
set time 0.01
set now [$ns now]
set cwnd [$tcpSource set cwnd_]
puts $file "$now $cwnd"
$ns at [expr $now+$time] "plotWindow $tcpSource $file" }
$ns at 10.1 "plotWindow $tcp $windowVsTime2"

# Define node initial position in nam
for {set i 0} {$i < $val(nn)} { incr i } {
# 30 defines the node size for nam
$ns initial_node_pos $node_($i) 30
}

# Telling nodes when the simulation ends
for {set i 0} {$i < $val(nn) } { incr i } {
$ns at $val(stop) "$node_($i) reset";
}

# ending nam and the simulation
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "stop"
$ns at 150.01 "puts "end simulation" ; $ns halt"
proc stop {} {
global ns tracefd namtrace
$ns flush-trace
close $tracefd
close $namtrace
}

$ns run
 
Old 11-29-2016, 08:12 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,071

Rep: Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887Reputation: 5887
Quote:
Originally Posted by uttam khawas View Post
thank you for your reply..
this is the code from which i m getting error: "warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl"
Right...which is the exact same thing you posted before. Again, did you THINK about that error, and LOOK at this code???

AGAIN...it is plain telling you to use "-channel"...YOU ARE NOT DOING IT, so why are you surprised by that message? Can you see ANYWHERE in this code where you have specified the "-channel" parameter? Are you putting it on the command line???? And please use CODE tags when posting code.
Code:
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)             3                         ;# number of mobilenodes
set val(rp)             AODV                       ;# routing protocol
set val(x)              500                  ;# X dimension of topography
set val(y)              400                  ;# Y dimension of topography
set val(stop)        150               ;# time of simulation end

set ns          [new Simulator]
set tracefd       [open happy.tr w]
set windowVsTime2 [open lost.tr w]
set namtrace      [open happy.nam w]
#$ns aodv.tcl.txt

$ns trace-all $tracefd
$ns namtrace-all-wireless $namtrace $val(x) $val(y)


# set up topography object
set topo       [new Topography]

$topo load_flatgrid $val(x) $val(y)

create-god $val(nn)

#
#  Create nn mobilenodes [$val(nn)] and attach them to the channel.
#

# configure the nodes
        $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) \
             -channelType $val(chan) \
             -topoInstance $topo \
             -agentTrace ON \
             -routerTrace ON \
             -macTrace OFF \
             -movementTrace ON

    for {set i 0} {$i < $val(nn) } { incr i } {
        set node_($i) [$ns node]
    }

# Provide initial location of mobilenodes
$node_(0) set X_ 5.0
$node_(0) set Y_ 5.0
$node_(0) set Z_ 0.0

$node_(1) set X_ 490.0
$node_(1) set Y_ 285.0
$node_(1) set Z_ 0.0

$node_(2) set X_ 150.0
$node_(2) set Y_ 240.0
$node_(2) set Z_ 0.0

# Generation of movements
$ns at 10.0 "$node_(0) setdest 250.0 250.0 3.0"
$ns at 15.0 "$node_(1) setdest 45.0 285.0 5.0"
$ns at 110.0 "$node_(0) setdest 480.0 300.0 5.0"

# Set a TCP connection between node_(0) and node_(1)
set tcp [new Agent/TCP/Newreno]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns attach-agent $node_(0) $tcp
$ns attach-agent $node_(1) $sink
$ns connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns at 10.0 "$ftp start"

# Printing the window size
proc plotWindow {tcpSource file} {
global ns
set time 0.01
set now [$ns now]
set cwnd [$tcpSource set cwnd_]
puts $file "$now $cwnd"
$ns at [expr $now+$time] "plotWindow $tcpSource $file" }
$ns at 10.1 "plotWindow $tcp $windowVsTime2"

# Define node initial position in nam
for {set i 0} {$i < $val(nn)} { incr i } {
# 30 defines the node size for nam
$ns initial_node_pos $node_($i) 30
}

# Telling nodes when the simulation ends
for {set i 0} {$i < $val(nn) } { incr i } {
    $ns at $val(stop) "$node_($i) reset";
}

# ending nam and the simulation
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "stop"
$ns at 150.01 "puts "end simulation" ; $ns halt"
proc stop {} {
    global ns tracefd namtrace
    $ns flush-trace
    close $tracefd
    close $namtrace
}

$ns run
[/QUOTE]
 
1 members found this post helpful.
  


Reply


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
how to add node clone in the tcl script in ns2 using aodv deepali_19 Linux - Wireless Networking 0 03-27-2015 02:45 PM
How to implement aodv routing protocol in leach in ns2.34 bayefalle Linux - Software 4 11-10-2014 10:52 AM
Modifying the RREQ paquet of AODV routing protocol in ns2 info_mimi Linux - Software 0 09-23-2013 11:45 PM
Error on Tcl when add misbehavior node in aodv ns2 D4SH_SI4 Linux - Networking 5 06-28-2013 01:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:23 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration