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

Bugs in errmodel.cc



Hi!

	I found two bugs in errormodel.cc :

	1) The variables errPkt_, errByte_ and errTime must be initialized
	to 0. Otherwise, they can start with very high values. Therefore,
many simulations will not experience any loss. That is what I observed on 
many simulations. Despite a high error rate, no loss happened. I suggest
to add the initialization in errmodel.cc (marked with ^^^)

	ErrorModel::ErrorModel() : Connector(), unit_(EU_PKT), ranvar_(0),
        onlink_(0), enable_(1), firstTime_(1), 
	errPkt_(0), errByte_(0),errTime_(0) // Bug 1 : omission
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
{
        bind("rate_", &rate_);
        bind("errPkt_", &errByte_);  // Bug 2 : typo
	      ^^^^^^^^^^^^^^^^^^^
        bind("errByte_", &errByte_);
        bind("errTime_", &errTime_);
        bind("onlink_", &onlink_);
        bind("enable_", &onlink_);
        bind("off_mac_", &off_mac_);
}

	2) There is a typo, we should have : bind("errPkt_", &errPkt_);


___________________________________________________________________
Saad Biaz				Abou Youssef
Graduate Research Assistant		Office : (409) 845 50 07
Department of Computer Science		Home   : (409) 862 91 35
College Station, TX, 77843-3112
___________________________________________________________________