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

[ns] new command in TCP agent (reinitialize the agent)



Hi,
I have implemented a new command for a TCP agent that
should reset the TCP agent to the initial state (e.g. this command
can be executed in the done procedure after the statistics of the
closed connection have been made).

But it doesn't work correctly. Something with the seqnos and the
seqno counters (t_seqno_, seqno_, highest_ack_, ...) is wrong.
Except for the cancel_timers method I have only used the commands
of the constructor.
Have I forgotten some commands that are necessary for a complete
reinitialization of the agent? Thank you for your help.

Here is the code:

* in command(...) of tcp.cc:
----------------------------

  if (argc == 2)
  {
    if (strcmp(argv[1], "do_reset") == 0)
    {
      t_seqno_ = 0;
      t_rtt_ = 0;
      t_srtt_ = 0;
      t_rttvar_ = 0;
      t_backoff_ = 0;
      ts_peer_ = 0;

      cancel_timers();

      dupacks_ = 0;
      curseq_ = 0;
      highest_ack_ = 0;
      cwnd_ = 0;
      ssthresh_ = 0;
      count_ = 0;
      fcnt_ = 0;
      rtt_active_ = 0;
      rtt_seq_ = -1;
      rtt_ts_ = 0.0;
      maxseq_ = 0;
      cong_action_ = 0;
      ecn_burst_ = 0;
      ecn_backoff_ = 0;
      ect_ = 0;
      restart_bugfix_ = 1;
      closed_ = 0;
      nrexmit_ = 0;
      first_decrease_ = 1;
      et_ = 0;

      reset();

      return(TCL_OK);
    }
  }


* in ../tcl/lib/ns-default.tcl:
-------------------------------
Agent/TCP instproc do_reset {} {
  $self cmd do_reset
}


Best regards,
Michael Savoric

======================================================
E-Mail:		[email protected]

Phone:	 	(030)314-23840

Postal address:	Technical University Berlin
		Telecommunication Networks Group (TKN)
		Einsteinufer 25, 10587 Berlin
======================================================