Tuesday, April 16, 2013

Error while adding new protocol in NS2 - 3

One more common error is as follows:

invalid command name "Agent/MyAgentOtcl"
    while executing
"Agent/MyAgentOtcl set seqNo_ $opt(seqNo)"



This is due to one of the below listed reason:

1. The spelling mistake in "Agent/MyAgentOtcl" of TCL script and .cc file. In .cc file code will be as follows:

MyAgentClass() : TclClass("Agent/MyAgentOtcl") {}
TclObject* create(int, const char*const*) {
return(new MyAgent());
}


2. Once protocol is added, then updating makefile is also important. In makefile give the path for creating object file. If path is not give, then TCL scripts cannot access the C++ codes.

3. After modifying the makefile and ./configure, sometimes makefile will not be having the path information. You may get ./configure as successfully completed but TCL scripts fails to access. So updating is also important.

25 comments:

  1. Hai...

    Can i open and run broadcast protocol from old version ns2 2.29 in new version ns2 2.35...i have edit and follow the instruction to open and run the protocol, but stay have a problem.....

    ReplyDelete
  2. Ok, after make some changes follow the instruction and run the broadcast protocol... it have some error as follow.. can u help me, what is error about...



    noises car 5 src node 399
    num_nodes is set 400
    INITIALIZE THE LIST xListHead
    invalid command name "Agent/Broadcastbase"
    while executing
    "Agent/Broadcastbase create _o30 "
    invoked from within
    "catch "$className create $o $args" msg"
    invoked from within
    "if [catch "$className create $o $args" msg] {
    if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
    delete $o
    return ""
    }
    global errorInfo
    error "class $..."
    (procedure "new" line 3)
    invoked from within
    "new Agent/Broadcastbase"
    (procedure "create_nodes" line 13)
    invoked from within
    "create_nodes"
    (file "broadcast.tcl" line 133

    ReplyDelete
    Replies
    1. HI,

      Compile the .cc file and run again.

      Delete
    2. sorry, how to compile .cc file....?

      Delete
    3. when i using command make depend...following error is appear...what is all about, can u help me?

      emulate/net-pcap.cc:64:18: fatal error: pcap.h: No such file or directory
      compilation terminated.

      Delete
  3. when i compile using make depend, following error is appear... can u explains ...TQ

    emulate/net-pcap.cc:64:18: fatal error: pcap.h: No such file or directory
    compilation terminated.

    ReplyDelete
  4. can give ur email address...

    ReplyDelete
  5. I installed evalvid successfully but now I run command "ns be.tcl":

    invalid command name "Agent/myUDP"
    while executing
    "Agent/myUDP create _o82 "
    invoked from within
    "catch "$className create $o $args" msg"
    invoked from within
    "if [catch "$className create $o $args" msg] {
    if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
    delete $o
    return ""
    }
    global errorInfo
    error "class $..."
    (procedure "new" line 3)
    invoked from within
    "new Agent/myUDP"
    invoked from within
    "set udp1 [new Agent/myUDP]"
    (file "be.tcl" line 24)
    thank for advance !!!

    ReplyDelete
  6. i have a same error like you... and has not been solved yet ....
    please Mr. Rama give some solution for this problem...TQ

    ReplyDelete
  7. hai...

    i trying to run my new broadcast protocol and after i
    make clean
    make depend
    make

    error below was appear...actually i added (foreach prot Broadcastbase) in tcl/lib/ns-packet.tcl as mention in readme_install guide for that broadcast protocol...
    Can u give me advice...TQ

    [code omitted because of length]
    : wrong # args: should be "foreach varList list ?varList list ...? command"
    while executing
    "foreach prot {
    BroadcastBase
    }"

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. num_nodes is set 2
    Wrong node routing agent!

    what is the solution for this warning sir?

    ReplyDelete
    Replies
    1. @muragesh: which version you are using?

      Delete
  10. Hai..

    went i do make depend to run new broadcast protocol, error below was appear.... so, what is the solution for this warning sir?...help me....

    emulate/net-pcap.cc:64:18: fatal error: pcap.h: No such file or directory

    ReplyDelete
    Replies
    1. Hi,

      Check the header file declaration in net-pcap.cc and make sure that the file is exists.

      Delete
  11. Hi,
    I am running simme.tcl of wsn . Then, I have an error :
    num_nodes is set 62
    Wrong node routing agent!
    Could you show me some advice ?? Thank you :D

    ReplyDelete
    Replies
    1. Hi,

      Check the source for the routing protocol you are using as routing protocol.

      Delete
  12. hi Rama,
    I define a new protocol in NS name Buddy. I create 3 files Buddy.cpp, Buddy.h and Buddy_packet.h
    after run make command, i get some errors for i.e
    Buddy.h: error: ip.h: No such file or directory
    i use ip.h header file in Buddy.h
    although ip.h is not missing, this error happen.
    is it possible to help me?

    ReplyDelete
  13. Dear sir,
    I'm using ns2 2.34..I added a patch file ns2_cdn_extension of version ns2 2.33 for load balancing .. When i tried executing a sample file the following error occured:

    invalid command name "Agent/CdnAgent"
    while executing
    "Agent/CdnAgent create _o260 "
    invoked from within
    "catch "$className create $o $args" msg"
    invoked from within
    "if [catch "$className create $o $args" msg] {
    if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
    delete $o
    return ""
    }
    global errorInfo
    error "class $..."
    (procedure "new" line 3)
    invoked from within
    "new Agent/CdnAgent"
    invoked from within
    "set S0 [new Agent/CdnAgent]"
    (file "agent.tcl" line 68)

    Can u please help me...?

    ReplyDelete