- ›
- Forums ›
- Get Help to do your B.E., and M.E., M.Tech., & M.S., Project in Ns2 ›
- Error with new agent
It is a very common error any one will face during developing a new agent or protocol for ns2.
It means you somewhere did a mistake in while patching ns2 files.
First, Understand the basic tutorials of ns2 for creating a new agent for ns2.
Start with “chapter VII -A new protocol for ns” of Marc Greis’ Tutorial
Hi Charles,
I have made the following changes in ns-default.tcl, ns-packet.tcl, packet.h, ns-agent.tcl, Makefile.in
Makefile.in
VanetCR/vanetcr.o VanetCR/vanetcr_accdb.o VanetCR/vanetcr_myheard.o
VanetCR/vanetcr_nghbdb.o VanetCR/vanetcr_sspdb.o
ns-default.tcl
Agent/VanetCR set packetSize_ 1000 ;# for VANETCR added May 5th, 2009
Agent/VanetCR set jitterFactorRBC_ 0.0001
Agent/VanetCR set jitterFactorRev_ 0.0002
Agent/VanetCR set sig_delay_ 0.003255
Agent/VanetCR set verif_delay_ 0.00762
Agent/VanetCR set lastheard_interval_ 1
Agent/VanetCR set statinterval_ 0.01
ns-packet.tcl
# Wireless:
ARP # Address Resolution Protocol, network wireless stack
GAF # Geographic Adaptive Delity, for ad-hoc networks
LL # network wireless stack
LRWPAN # zheng, wpan/p802_15_4mac.cc
Mac # network wireless stack
VanetCR # Added for Vanet on May 5th, 2009
packet.h
name_[PT_VANETCR]= “VanetCR”; //Added for VANETCR on May 5th, 2009
static const packet_t PT_VANETCR = 61; //for VANETCR May 5th, 2009
After Modifications
I execute the following commands to recompile
touch common/packet.cc
./configure
make clean
make
But Still I am getting the error I posted
[root@localhost usman-practice]# ns abc.tcl 14 10 25
num_nodes is set 150
INITIALIZE THE LIST xListHead
SORTING LISTS …DONE!
ns: _o2415 start-statdump:
(_o2415 cmd line 1)
invoked from within
“_o2415 cmd start-statdump”
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 “_o2415” line 2)
(SplitObject unknown line 2)
invoked from within
“_o2415 start-statdump”
Something I noticed is that even when I comment out the ns-default.tcl definitions I did, I get the same error. So my definitions are having no effect.
So maybe that is the place I am doing something wrong.
Can you please have a look at it?
Regrds
While compiling NS2-2.28 does not give any error, but when I use antsense under tcl as protocol it stops with the following error.
INITIALIZE THE LIST xListHead
(_o17 cmd line 1)
invoked from within
“_o17 cmd if-queue _o20”
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 “_o17” line 2)
(SplitObject unknown line 2)
invoked from within
“$agent if-queue [$self set ifq_(0)] “
(procedure “_o14” line 24)
(Node/MobileNode add-target line 24)
invoked from within
“$self add-target $agent $port”
(procedure “_o14” line 15)
(Node attach line 15)
invoked from within
“$node attach $ragent [Node set rtagent_port_]”
(procedure “_o3” line 71)
(Simulator create-wireless-node line 71)
invoked from within
“_o3 create-wireless-node”
(“eval” body line 1)
invoked from within
“eval $self create-wireless-node $args”
(procedure “_o3” line 14)
(Simulator node line 14)
invoked from within
“$ns_ node”
(“for” body line 2)
invoked from within
“for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
# $node_($i) random-motion 0 ;# disable random motion
}”
(file “wpan_demo1.tcl” line 109)
I’ll be grateful and thankful if can help me.
Discuss Through WhatsApp