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 04-01-2013, 08:08 AM   #1
dipc
LQ Newbie
 
Registered: Apr 2013
Posts: 3

Rep: Reputation: Disabled
Question an error says that nam graph cannot be gernerated


i am currently working in ns2.34 in fedora 9 and i am completely new to it. while running the nam file, i just got an error that says " you have used a tracefile format older than 1.0a and so namgraph could not be generated ". a trace file with extension .tr and a nam file with .nam extension were created in the location of my file but the trace file was empty. i dont understand what is the prob wid it. i would be grateful if i come to know the solution.
 
Old 04-01-2013, 08:25 AM   #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: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Welcome to LQ.

Which command was used to generate "out.nam" ?
Like $ ns file.tcl
 
Old 04-01-2013, 08:42 AM   #3
dipc
LQ Newbie
 
Registered: Apr 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Unhappy nam graph error

Quote:
Originally Posted by knudfl View Post
Welcome to LQ.

Which command was used to generate "out.nam" ?
Like $ ns file.tcl
i gave $ nam file.nam.
this is the general format i use to generate the nam file. it always worked but i don't know whats the problem suddenly with it.
 
Old 04-01-2013, 08:53 AM   #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: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
# 3.
Quote:
$ nam file.nam
You cannot generate 'file.nam' from nothing.

Please tell how 'file.nam' was created.
And show the real file names instead of "file".

.
 
Old 04-01-2013, 09:02 AM   #5
dipc
LQ Newbie
 
Registered: Apr 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Post

Quote:
Originally Posted by knudfl View Post
# 3.

You cannot generate 'file.nam' from nothing.

Please tell how 'file.nam' was created.
And show the real file names instead of "file".

.
I gave the command $ vi d_t_r_without_mob_node.tcl
The tcl file got created and i typed my program.
Then i gave $ ns d_t_r_without_mob_node.tcl to run the program and it was successful.
Then i gave $ nam d_t_r_without_mob_node.nam to view the animated result but i got that error saying nam graph can't be generated. My program is as follows :

#NODE GENERATION

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/Simple ;# 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) 100 ;# max packet in ifq
set val(nn) 50 ;# number of mobilenodes
set val(x) 1000
set val(y) 1000
set val(rp) DumbAgent

# setting simulation

set ns [new Simulator]

# creating trace file

set tf [open d_t_r_without_mob_node.tr w]
$ns trace-all $tf

# creating nam file

set nt [open d_t_r_without_mob_node.nam w]
$ns namtrace-all-wireless $nt $val(x) $val(y)

# setting a new topology

set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)

# god file - store an array of shortest no of hops reqd to reach from 1 node to the other

create-god $val(nn)

# channel declaration

set chann [new $val(chan)]

# node parameters declaration

$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 [new $val(chan)] \
-topoInstance $topo \
-wiredRouting OFF \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace ON \
-channel $chann

# node generation

for {set i 0} {$i < 5} {incr i} {
set n($i) [$ns node]
$n($i) random-motion 0
}

# transmission range

Phy/WirelessPhy set CSThresh_ 6.97078e-10 ;#200m
Phy/WirelessPhy set RXThresh_ 2.78831e-9 ;#100m
Phy/WirelessPhy set Pt_ 0.2818

# initial position for all nodes

for { set i 0 } { $i < 5 } { incr i } {
$ns initial_node_pos $n($i) 30
$n($i) random-motion 0
}

# node positions

$n(0) set X_ 678.98710000000005
$n(0) set Y_ 791.18420000000003
$n(0) set Z_ 0.000000000000
$n(1) set X_ 206.3167
$n(1) set Y_ 672.99800000000005
$n(1) set Z_ 0.000000000000
$n(2) set X_ 326.80539999999996
$n(2) set Y_ 887.31880000000001
$n(2) set Z_ 0.000000000000
$n(3) set X_ 133.04805999999999
$n(3) set Y_ 675.02179999999998
$n(3) set Z_ 0.000000000000
$n(4) set X_ 888.75609999999995
$n(4) set Y_ 504.45119999999997
$n(4) set Z_ 0.000000000000

# packet transmission - tcp, sink to be added

set tcp [new Agent/TCP]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns attach-agent $n(0) $tcp
$ns attach-agent $n(1) $sink
$ns connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns at 0.5 "$ftp start"

# reset the transmission

for {set i 0} {$i < 5 } {incr i} {
$ns at 6.0 "$n($i) reset";
}

$ns at 6.0 "stop"
$ns at 6.01 "puts \"NS EXITING...\" ; $ns halt"

# close all the files

proc stop {} {
global ns tf nt
$ns flush-trace
close $tf
close $nt
}
 
  


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
[SOLVED] nam error: node 5 not defined rmanish04 Programming 0 03-29-2012 09:26 AM
error in nam humairaafzal73 Linux - Software 1 02-20-2012 12:55 PM
Finding for Nam graph in NS2 Madhu S H Linux - Software 1 01-17-2012 05:16 AM
Nam error nam1.16 ghani143 Linux - Newbie 1 11-19-2010 01:10 AM
nam error in ns-2.29 due to mannsim kuberninad Linux - Newbie 7 02-12-2010 08:02 AM


All times are GMT -5. The time now is 12:31 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