LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 03-28-2012, 01:18 PM   #1
NimeshaK
LQ Newbie
 
Registered: Mar 2012
Posts: 8

Rep: Reputation: Disabled
How to run DSR protocol in ns-2


I get this error when i am running my coding regarding DSR protocol,

num_nodes is set 2
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
what can i do?
 
Old 03-28-2012, 01:32 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
Quote:
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
A warning is not an error : Is information.

And : Several other default ns2 tcl programs will display the same warning.
 
Old 03-28-2012, 03:44 PM   #3
NimeshaK
LQ Newbie
 
Registered: Mar 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
How to run DSR protocol in ns-2

Ya.Agree with it.But what is this "INITIALIZE THE LIST xListHead"?
 
Old 03-28-2012, 04:16 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
Quote:
what is this "INITIALIZE THE LIST xListHead" ?
Don't know, but it is a sentence often seen, when you run a tcl file.
Usually appears when everything is OK.
 
Old 03-29-2012, 01:03 AM   #5
NimeshaK
LQ Newbie
 
Registered: Mar 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
How to run DSR protocol in ns-2

It is not ok.because i couldn't get the output.Here is my 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) DSR ;# 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 dsr.tr w]
set windowVsTime2 [open win.tr w]
set namtrace [open dsr.nam w]

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


set topo [new Topography]

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

create-god $val(nn)


$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]
}

$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


$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 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"


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"


for {set i 0} {$i < $val(nn)} { incr i } {

$ns initial_node_pos $node_($i) 30
}

for {set i 0} {$i < $val(nn) } { incr i } {
$ns at $val(stop) "$node_($i) reset";
}


$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
exec nam dsr.nam &
exit 0
}

$ns run


I saved this file as "dsr.tcl" & run it as "ns dsr.tcl"

Then i get this error.
"num_nodes is set 2
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead"

I did everything in this webpage"http://wpage.unina.it/marcello.caleffi/ns2/tora.html" to overcome it.
But still get the same error.If you can help me,I am really appreciating it
 
Old 03-29-2012, 07:52 AM   #6
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Nimesh,

Please use quotes, code and url tags to make your post easy to understand and meaningful.
 
  


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
i can not run LEACH protocol on ns-2.29 what steps should i take? norisknolife Linux - Wireless Networking 2 01-08-2011 12:57 AM
AODV and DSR armelle Linux - Networking 0 03-27-2010 04:11 AM
I had two errors while i was trying to run the l2tp protocol kasa Linux - General 2 09-13-2007 10:11 AM
cannot install dsr-uu wahaha Linux - Software 7 12-19-2006 03:43 AM
Dsr-uu wahaha Linux - Networking 3 12-11-2006 05:17 AM


All times are GMT -5. The time now is 11:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration