[Sumover-dev] [svn commit] r4372 - vic/branches/cc/cc

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Wed Jan 28 16:08:00 GMT 2009


Author: soohyunc
Date: Wed Jan 28 16:07:59 2009
New Revision: 4372

Modified:
   vic/branches/cc/cc/tfwc_sndr.cpp
   vic/branches/cc/cc/tfwc_sndr.h

Log:
o  TfwcSndr's detec_loss() method fixed
   ('begin' and 'end' should be 'aoa_' and 'mvec[2]-1', respectively)

o  at this stage, 'cwnd_' grows correctly.
   at this stage, AckVec builds correctly.



Modified: vic/branches/cc/cc/tfwc_sndr.cpp
==============================================================================
--- vic/branches/cc/cc/tfwc_sndr.cpp	(original)
+++ vic/branches/cc/cc/tfwc_sndr.cpp	Wed Jan 28 16:07:59 2009
@@ -136,13 +136,15 @@
 
 		// generate seqno vec
 		gen_seqvec(begins_, ends_, jacked_, ackv);
+		//print_seqvec(begins_, ends_);
 
 		// generate margin vector
 		marginvec(jacked_);
 
 		// detect loss
-		//int pt = mvec_[DUPACKS - 1] - 1;
-		is_loss_ = detect_loss(end, begin);
+		// 	@begin: aoa_
+		// 	@end: mvec_[DUPACKS] - 1
+		is_loss_ = detect_loss(mvec_[DUPACKS-1]-1, aoa_);
 
 		// TFWC is not turned on (i.e., no packet loss yet)
 		if(!is_tfwc_on_) {
@@ -186,7 +188,7 @@
  * detect packet loss in the received vector
  * @ret: true when there is a loss
  */
-bool TfwcSndr::detect_loss(u_int16_t end, u_int16_t begin) {
+bool TfwcSndr::detect_loss(int end, int begin) {
 	bool ret;	// 'true' when there is a loss
 	int lc = 0;	// loss counter
 
@@ -196,13 +198,19 @@
 	bool is_there = false;
 
 	// generate tempvec elements
+	//printf("\tcomparison numbers: (");
 	for (int i = 0; i < numvec; i++) {
 		tempvec[i] = (begin + 1) + i;
+	//	printf(" %d", tempvec[i]);
 	}
+	//printf(" )\n");
+
+	// number of seqvec element
+	int numseq = ends_ - begins_;
 
 	// compare tempvec and seqvec
 	for (int i = 0; i < numvec; i++) {
-		for (int j = 0; j < numvec; j++) {
+		for (int j = 0; j < numseq; j++) {
 			if (tempvec[i] == seqvec_[j]) {
 				is_there = true;
 				break;

Modified: vic/branches/cc/cc/tfwc_sndr.h
==============================================================================
--- vic/branches/cc/cc/tfwc_sndr.h	(original)
+++ vic/branches/cc/cc/tfwc_sndr.h	Wed Jan 28 16:07:59 2009
@@ -170,7 +170,7 @@
 	void update_rtt(double tao);
 
 	// detect packet loss
-	bool detect_loss(u_int16_t, u_int16_t);
+	bool detect_loss(int, int);
 
 	// control congestion window
 	void control();



More information about the Sumover-dev mailing list