LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-08-2015, 02:05 PM   #1
um3
LQ Newbie
 
Registered: Sep 2015
Location: I m from India
Posts: 19

Rep: Reputation: Disabled
ns2 nam console empty with no nodes


Hello ns2 experts,

What may be possibly wrong with this program?? I am getting empty nam console without any nodes seen. Also while running the program, I am getting "node is not defined" for a million times on my unix console.
Trace and NAM trace files seems to be fine

Please look.

I am using NS2.35 on ubuntu 14.04, 64 bit OS

THank You


Code:
Mac/802_11 set RTSThreshold_ 3000
Mac/802_11 set dataRate_ 2.0e6

set ns_ [new Simulator]
set nt [open impatientns2.tr w]
set nm [open impatientns2.nam w]
$ns_ trace-all $nt
$ns_ namtrace-all-wireless $nm 100 100

proc finish {} {
	global ns_ nt nm
	$ns_ flush-trace
	close $nt
	close $nm
	exec nam impatientns2.nam
	exit 0
}


set topo [new Topography]
$topo load_flatgrid 100 100

$ns_ node-config 	-adhocRouting DumbAgent \
			-llType LL \
			-macType Mac/802_11 \
			-ifqType Queue/DropTail/PriQueue \
			-ifqLen 50 \
			-antType Antenna/OmniAntenna \
			-propType Propagation/FreeSpace \
			-phyType Phy/WirelessPhy \
			-channelType Channel/WirelessChannel \
			-topoInstance $topo \
			-agentTrace ON \
			-routerTrace ON \
			-macTrace ON \
			-movementTrace ON

create-god 2


set WT(1) [$ns_ node]
set WT(2) [$ns_ node]

$WT(1) set X_ 10.0
$WT(1) set Y_ 10.0
$WT(1) set Z_ 0.0

$WT(2) set X_ 20.0
$WT(2) set Y_ 20.0
$WT(2) set Z_ 0.0

set udp(1) [new Agent/UDP]
$ns_ attach-agent $WT(1) $udp(1)
set sink(1) [new Agent/Null]
$ns_ attach-agent $WT(2) $sink(1)
$ns_ connect $udp(1) $sink(1)

set cbr(1) [new Application/Traffic/CBR]
$cbr(1) set packetSize_ 1000
$cbr(1) set interval_ 0.005
$cbr(1) attach-agent $udp(1)
$ns_ at 2 "$cbr(1) start"
$ns_ at 5 "$cbr(1) stop"


$ns_ at 5.1 "finish"
$ns_ run
 
Old 09-08-2015, 09:51 PM   #2
um3
LQ Newbie
 
Registered: Sep 2015
Location: I m from India
Posts: 19

Original Poster
Rep: Reputation: Disabled
I someone fixed the issue.. I need to set
$ns_ initial_node_pos $WT(1) 30
$ns_ initial_node_pos $WT(2) 30
 
  


Reply

Tags
nam, 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
NS2 Nam and Trace Files are always empty RSM_smile Linux - Newbie 36 08-15-2017 03:50 PM
[SOLVED] nam file is empty rc49 Linux - Newbie 1 07-29-2015 06:40 AM
[SOLVED] ns2.29 -nam Ndia Linux - Software 1 05-26-2013 03:20 AM
[SOLVED] NS2 Nam Issue atb2010 Linux - Newbie 2 03-17-2011 09:52 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:54 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
Open Source Consulting | Domain Registration