[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding a new TCP subclass
It was just a name incongruency:
In tcp-rfc793edu, the name for the TCP agent was defined:
RFC793eduTcpClass() : TclClass("Agent/TCP/RFC793edu")
So in ns-default.tcl:
Agent/TCP/RFC793eduTcp set add793expbackoff_ 0
Should be:
Agent/TCP/RFC793edu set add793expbackoff_ 0
I'm sorry if I had confused anyone with my previous emails. I apologize
for the inconvenience.
/FCD
----------------------------------------------------------------------
Fernando Cela
email: [email protected] phone: +46 31 772 1709
On Sat, 21 Aug 1999, Fernando Cela Diaz wrote:
>
> Hi all,
>
> I'm trying to add a new TCP class to NS (a RFC793 TCP with some flags that
> allow to switch on and off mechanisms implemented in Tahoe and Reno over
> the plain RFC793 TCP, intended just for undergraduate education).
>
> I have written some test code in a file called tcp-rfc793edu.cc and added
> a header for it in tcp.h. In the class constructor I have done a test
> bind, as in Marc Greiss turorial:
>
> RFC793eduTcpAgent::RFC793eduTcpAgent() : TcpAgent()
> {
> bind_bool("add793expbackoff_", &add793expbackoff_);
> ...
>
>
> And I have set the inicialization value for add793expbackoff_ in
> ns-default.tcl, as in MG Tutorial:
>
> Agent/TCP/RFC793eduTcp set add793expbackoff_ 0
>
>
> This yields to the following error after compiling and executing:
>
> : invalid command name "Agent/TCP/RFC793eduTcp"
> while executing "Agent/TCP/RFC793eduTcp set add793expbackoff_ 0"
>
>
> If I change that line in ns-default.tcl in this way:
>
> if [TclObject is-class Agent/TCP/RFC793eduTcp] {
> Agent/TCP/RFC793eduTcp set add793expbackoff_ 0
> }
>
> Then I get:
>
> warning: no class variable Agent/TCP/RFC793edu::add793expbackoff_
>
> plus a nice core dump, BUT it works, with add793expbackoff_ set to 0.
>
> Can someone help me?
>
> ----------
>
> Here you have the header for the class:
>
>
> class RFC793eduTcpAgent : public virtual TcpAgent {
> public:
> RFC793eduTcpAgent();
> virtual void rtt_backoff();
> void reset();
>
> protected:
> int add793expbackoff_; /* Add Karn's exp. backoff to rfc793 tcp
> */
> };
>
>