[Sumover-dev] [svn commit] r4269 - in vic/branches/cc: rtp

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Thu Aug 14 03:43:52 BST 2008


Author: soohyunc
Date: Thu Aug 14 03:43:50 2008
New Revision: 4269

Modified:
   vic/branches/cc/cc/tfwc_rcvr.cpp
   vic/branches/cc/cc/tfwc_rcvr.h
   vic/branches/cc/cc/tfwc_sndr.cpp
   vic/branches/cc/rtp/session.cpp

Log:
o  likewise in the revision 4267, TfwcRcvr also needs to be able to specify if
   it is seqno/aoa XR or timestamp XR, hence "rtp/session.cpp" changed
   accordingly.

o  added AckVec trim in TfwcRcvr


Modified: vic/branches/cc/cc/tfwc_rcvr.cpp
==============================================================================
--- vic/branches/cc/cc/tfwc_rcvr.cpp	(original)
+++ vic/branches/cc/cc/tfwc_rcvr.cpp	Thu Aug 14 03:43:50 2008
@@ -46,35 +46,44 @@
 
 TfwcRcvr::TfwcRcvr() :
 	currseq_(0),
-	prevseq_(0)
+	prevseq_(0),
+	ackofack_(0)
 {}
 
-void TfwcRcvr::tfwc_rcvr_recv(u_int16_t seqno, 
+void TfwcRcvr::tfwc_rcvr_recv(u_int16_t type, u_int16_t seqno, 
 				u_int16_t ackofack, u_int32_t ts) 
 {
 	debug_msg("received seqno:  %d\n", seqno);
 
-	// parse the current received seqno, ackofack, and timestamp
-	currseq_ = seqno;
-	ackofack_ = ackofack;
-	ts_echo_ = ts;		
-
-	// there is no packet loss
-	if (currseq_ == prevseq_ + 1) {
-		// set next bit to 1
-		SET_BIT_VEC(tfwcAV, 1);
-	} 
-	// we have one or more packet loss
-	else {
-		// number of packet loss
-		int cnt = currseq_ - prevseq_ - 1;
-
-		// set next bit to 0
-		for (int i = 0; i < cnt; i++) {
-			SET_BIT_VEC(tfwcAV, 0);
+	// parse the received seqno and ackofack
+	if (type == XR_BT_1) {
+		currseq_ = seqno;
+		ackofack_ = ackofack;
+
+		// there is no packet loss
+		if (currseq_ == prevseq_ + 1) {
+			// set next bit to 1
+			SET_BIT_VEC(tfwcAV, 1);
+		} 
+		// we have one or more packet loss
+		else {
+			// number of packet loss
+			int cnt = currseq_ - prevseq_ - 1;
+
+			// set next bit to 0
+			for (int i = 0; i < cnt; i++) {
+				SET_BIT_VEC(tfwcAV, 0);
+			}
 		}
-	}
 
-	// set this seqno to the prevseq before exit
-	prevseq_ = currseq_;
+		// set this seqno to the prevseq before exit
+		prevseq_ = currseq_;
+
+		// trim ackvec
+		trimvec(tfwcAV);
+	}
+	// parse timestamp
+	else if (type == XR_BT_3) {
+		ts_echo_ = ts;
+	}
 }

Modified: vic/branches/cc/cc/tfwc_rcvr.h
==============================================================================
--- vic/branches/cc/cc/tfwc_rcvr.h	(original)
+++ vic/branches/cc/cc/tfwc_rcvr.h	Thu Aug 14 03:43:50 2008
@@ -38,16 +38,11 @@
 
 #include "tfwc_sndr.h"
 
-// set AckVec bitmap
-//#define SET_BIT_VEC(ackvec_, bit) (ackvec_ = ((ackvec_ << 1) | bit))
-
-// see AckVec bitmap
-//#define SEE_BIT_VEC(ackvec_, ix, seqno) ((1 << (seqno - ix)) & ackvec_)
-
 class TfwcRcvr {
 public:
 	TfwcRcvr();
-	void tfwc_rcvr_recv(u_int16_t seqno, u_int16_t ackofack, u_int32_t ts);
+	void tfwc_rcvr_recv(u_int16_t type, u_int16_t seqno, 
+			u_int16_t ackofack, u_int32_t ts);
 
 protected:
 	inline u_int32_t tfwc_rcvr_getvec() { return tfwcAV; }
@@ -57,6 +52,15 @@
 	u_int16_t prevseq_;	// previous sequence number
 	u_int16_t ackofack_;	// ackofack
 private:
+	// trim ackvec
+	inline void trimvec(u_int32_t ackvec) {
+		int n = ackofack_ - 1;
+		if (currseq_ > ackofack_)
+			tfwcAV = ackvec >> n << n;
+		else
+			tfwcAV = ackvec << n >> n;
+	}
+
 	u_int32_t ts_echo_;	// for time stamp echoing
 };
 

Modified: vic/branches/cc/cc/tfwc_sndr.cpp
==============================================================================
--- vic/branches/cc/cc/tfwc_sndr.cpp	(original)
+++ vic/branches/cc/cc/tfwc_sndr.cpp	Thu Aug 14 03:43:50 2008
@@ -95,9 +95,12 @@
 		marginvec(ackv_);
 		ackv_ |= mvec_;		// masking ackvec
 
+		// detect loss
+
+		// congestion window control 
+
 		// set ackofack (real number)
 		aoa_ = ackofack(mvec_) * epoch_;
-
 	}
 	// retrieve ts echo
 	else if (type == XR_BT_3) {
@@ -106,5 +109,8 @@
 
 		tao_ = now_ - ts_echo_;
 		debug_msg(" ts echo:	%d\n", ts_echo_);
+		
+		// update RTT
+		// update_rtt(tao);
 	}
 }

Modified: vic/branches/cc/rtp/session.cpp
==============================================================================
--- vic/branches/cc/rtp/session.cpp	(original)
+++ vic/branches/cc/rtp/session.cpp	Thu Aug 14 03:43:50 2008
@@ -1172,13 +1172,16 @@
 		if(flags == XR_BT_1) {
 			ackofack_ = ackofack;
 			seqno_ = seqno;
+
+			// this is XR conveys seqno and ackofack
+			tfwc_rcvr_recv(flags, seqno_, ackofack_, 0);
 		}
 		else if(flags == XR_BT_3) {
 			ts_ = ntohl(xr->chunk);
-		}
 
-		// parse seqno, ackofack, and timestamp to TfwcRcvr
-		tfwc_rcvr_recv(seqno_, ackofack_, ts_);
+			// this is XR conveys timestamp
+			tfwc_rcvr_recv(flags, 0, 0, ts_);
+		}
 
 		// send receiver side XR report
 		ch_[0].send_ackv(xr);
@@ -1191,7 +1194,7 @@
 		if(flags == XR_BT_1) {
 			ackvec_ = ntohl(xr->chunk);
 
-			//this XR conveys ackvec, hence parse it
+			// this XR conveys ackvec, hence parse it
 			tfwc_sndr_recv(flags, ackvec_, 0);
 		}
 		else if(flags == XR_BT_3) {



More information about the Sumover-dev mailing list