LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-05-2014, 06:21 PM   #1
badisachandu
LQ Newbie
 
Registered: Apr 2014
Posts: 2

Rep: Reputation: Disabled
can anyone help me in fixing the error while executing ospf10.tcl in 20-ospf4ns file


(_o3 cmd line 1)
invoked from within
"_o3 cmd init-links-cost"
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 "_o3" line 2)
(SplitObject unknown line 2)
invoked from within
"$ns init-links-cost"
(file "ospf.tcl" line 85)
 
Old 04-05-2014, 06:24 PM   #2
badisachandu
LQ Newbie
 
Registered: Apr 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
source code for above file is here:

gent/TCP set delay_growth_ false

# In preparation for changing the default values for syn_ and delay_growth_.

remove-all-packet-headers ; # removes all except common
add-packet-header Flags IP TCP rtProtoOSPF ; # hdrs reqd for validation test

puts "(TCL) Creating simulator & trace files..."
set dir "./out_ospf9"

set ns [new Simulator]
set vj_ss true

set f [eval open $dir/ospf9.tr w]
set nf [open $dir/ospf9.nam w]
$ns trace-all $f
$ns namtrace-all $nf

proc finish {} {
global ns f nf dir
$ns flush-trace
close $f
close $nf
eval exec nam $dir/ospf9.nam
puts "(TCL) Finishing..."
exit 0
}

# Enable multiPath routing
Node set multiPath_ 1
# Enable mtrouting
Node set mtRouting_ 1


#################################################
# NODES
#################################################
puts "(TCL) Setting up nodes and links..."
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
set n6 [$ns node]

$n0 shape circle
$n1 shape circle
$n2 shape hexagon
$n3 shape hexagon
$n4 shape circle
$n5 shape hexagon
$n6 shape hexagon

$n0 color red
$n1 color red
$n2 color blue
$n3 color blue
$n4 color red
$n5 color blue
$n6 color blue

#################################################
# LINKS
#################################################

$ns duplex-link $n0 $n2 10Mb 2ms DropTail
$ns duplex-link $n1 $n2 10Mb 2ms DropTail

$ns duplex-link $n2 $n3 1.5Mb 10ms DropTail
$ns duplex-link $n3 $n6 1.5Mb 10ms DropTail
$ns duplex-link $n6 $n4 1.5Mb 10ms DropTail
$ns queue-limit $n2 $n3 5
$ns duplex-link-op $n2 $n3 queuePos 0


$ns duplex-link $n2 $n5 1.5Mb 10ms DropTail
$ns duplex-link $n5 $n4 1.5Mb 10ms DropTail
$ns queue-limit $n2 $n5 5
$ns duplex-link-op $n2 $n5 queuePos 0
$ns duplex-link-op $n5 $n4 queuePos 0

#set initial costs
$ns init-links-cost

#################################################
# Configuring TRAFFIC objects
#################################################
puts "(TCL) Configuring traffic objects..."

set tcp1 [new Agent/TCP]
$ns attach-agent $n0 $tcp1
$n0 label "agent TCP"
set snk1 [new Agent/TCPSink]
$ns attach-agent $n4 $snk1
$n4 label "agent TCPSink"
$ns connect $tcp1 $snk1

set cbr1 [new Application/Traffic/CBR]
$cbr1 attach-agent $tcp1
$cbr1 set packetSize_ 60
$cbr1 set interval_ 0.02
$tcp1 set fid_ 1
$ns color 1 magenta


set tcp2 [new Agent/TCP]
$ns attach-agent $n1 $tcp2
$n1 label "agent TCP"
set snk2 [new Agent/TCPSink]
$ns attach-agent $n4 $snk2
$ns connect $tcp2 $snk2

set cbr2 [new Application/Traffic/CBR]
$cbr2 attach-agent $tcp2
$cbr2 set packetSize_ 60
$cbr2 set interval_ 0.02
$tcp2 set fid_ 2
$ns color 2 cyan

# configure mtid in packets
$ns configure-mtid $tcp1 0
$ns configure-mtid $snk1 0
$ns configure-mtid $tcp2 1
$ns configure-mtid $snk2 1

#################################################
# Configuring ROUTING objects
#################################################
puts "(TCL) Configuring routing protocol..."

# set OSPF paremeters
Agent/rtProto/OSPF set helloInterval 1
Agent/rtProto/OSPF set routerDeadInterval 4


# set number of MT ids
Simulator set numMtIds 2

# set OSPF's packets colours
$ns setup-ospf-colors
# Set the routing protocol to OSPF
$ns rtproto OSPF[list $n0 $n1 $n2 $n3 $n4 $n6]

#################################################
# Scheduling simulation
#################################################
puts "(TCL) Configuring routing protocol..."

$ns at 0.8 "$cbr1 start"
$ns at 0.8 "$cbr2 start"
$ns at 20 "$cbr1 stop"
$ns at 20 "$cbr2 stop"
$ns at 20 "finish"


puts "(TCL) Starting simulation..."
puts ""
$ns run
 
Old 04-05-2014, 06:35 PM   #3
BenCollver
Rogue Class
 
Registered: Sep 2006
Location: OR, USA
Distribution: Slackware 14.1
Posts: 201
Blog Entries: 3

Rep: Reputation: 78
This could be a question for the ns-users mailing list.

http://www.isi.edu/nsnam/ns/index.html
 
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
error while executing blackholeAODV tcl k_kimo Linux - Wireless Networking 5 06-27-2013 03:07 AM
Floating point exception error while executing tcl with ns2 ines8989 Linux - Software 2 04-22-2013 05:31 PM
Floating point exception error while executing tcl with ns2 ines8989 Linux - Software 0 04-09-2013 01:44 PM
I am getting the following error while executing the drop1.tcl program. Plz help me t divya84 Linux - Newbie 1 10-10-2012 09:57 AM

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

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