[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error Model



>Hello:

>I am using the ErrorModel to insert errors on a link.
>There seems to be some problem with the initialization
>of errPkt_ variable.
>Although ns-default.tcl does include the initialization


>ErrorModel set errPkt_ 0

>the value seems to be inadvertently overwritten by another
>number once in a while.

>Two unintended effects of this are that

>(a) adding a comment to ns-default.tcl changes behavior - without
>the comment, no errors are introduced; with the comments,
>errors are correctly introduced.

>(b) same tcl script produces different results on two machines.
>No errors introduced on one machine, while errors correctly
>introduced on another one.

>Seems like a memory management problem.
>I can fix this by adding

>ErrorModel set errPkt_ 0

>to my tcl script. However, I do not like this fix too much.
>How do I know what other initializations are getting messed up?

>Any suggestions would be appreciated.

>- nitin
----------------->

Nitin, 

I was checking the errmodel.cc files when i came across this piece of code:

        bind("rate_", &rate_);
!!!     bind("errPkt_", &errByte_); !!!
        bind("errByte_", &errByte_);
        bind("errTime_", &errTime_);
        bind("onlink_", &onlink_);
!!!     bind("enable_", &onlink_); !!!
        bind("off_mac_", &off_mac_);

I wonder if the 2nd and the 2nd to last lines are really what they are
supposed
to be?
Let me know if you fixed the bug and if this was the cause.

I am also interested in passing a few new variables from my tcl scripts to
the 
errmodel.cc file.... what is the right way to do it? 
Will just binding as illustrated above do it? 
What are the other places to make changes if any?

thanks,
-Parag

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Parag Manihar
Master of Science in Information Networking (MSIN),
Carnegie Mellon University (CMU) .