[Sumover-dev] [svn commit] r4814 - vic/branches/cc/rtp

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Mon May 10 19:14:49 BST 2010


Author: soohyunc
Date: Mon May 10 19:14:49 2010
New Revision: 4814

Modified:
   vic/branches/cc/rtp/session.cpp
   vic/branches/cc/rtp/session.h
   vic/branches/cc/rtp/transmitter.cpp
   vic/branches/cc/rtp/transmitter.h

Log:
When TFWC is being operated by byte-mode cwnd, Vic should be able to send more
packets as Ack comes in - note: Vic checks if Ack is arrived every time it sends
a data packet. When checking the Ack reception, Vic should be able to add that
many bytes to determine if this data packet can be sent or not.

So, it would look like:
"current_data <= cwnd + acked - sent" (all in bytes)



Modified: vic/branches/cc/rtp/session.cpp
==============================================================================
--- vic/branches/cc/rtp/session.cpp	(original)
+++ vic/branches/cc/rtp/session.cpp	Mon May 10 19:14:49 2010
@@ -222,7 +222,8 @@
 confid_(-1),
 seqno_(0),		// RTP data packet seqno (from RTP header)
 lastseq_(0),	// last received packet's seqno
-ackvec_(0)		// bit vector (AckVec)
+ackvec_(0),		// bit vector (AckVec)
+new_ack_(0)
 {
 	/*XXX For adios() to send bye*/
 	manager = this;

Modified: vic/branches/cc/rtp/session.h
==============================================================================
--- vic/branches/cc/rtp/session.h	(original)
+++ vic/branches/cc/rtp/session.h	Mon May 10 19:14:49 2010
@@ -157,6 +157,9 @@
 
 	// am i a data sender?
 	inline bool am_i_sender() { return is_sender_; }
+	// was there a new ack?
+	inline virtual bool new_ack() { return new_ack_; }
+	inline virtual void set_new_ack() { new_ack_ = false; }
 
 protected:
 //	void demux(rtphdr* rh, u_char* bp, int cc, Address & addr, int layer);
@@ -236,6 +239,8 @@
 	u_int16_t ackvec_;	// this is a bit vector
 	// timestamp
 	double recv_ts_;	// receive timestamp
+	// was there a new ack?
+	bool new_ack_;
 
 private:
 	// print RTP data packet's seqno

Modified: vic/branches/cc/rtp/transmitter.cpp
==============================================================================
--- vic/branches/cc/rtp/transmitter.cpp	(original)
+++ vic/branches/cc/rtp/transmitter.cpp	Mon May 10 19:14:49 2010
@@ -329,12 +329,21 @@
 	case BYM:
 	{
 	  int len = 0;
-	  if(pb->len < tfwc_sndr_.b_magic() - len) {
+	  int num_acked = 0;
+	  set_new_ack();
+
+	  if(pb->len < tfwc_sndr_.b_magic() + num_acked - len) {
 		len += pb->len;
 		// move head pointer
 		head_ = pb->next;
 		// call Transmitter::output_data_only w/ XR reception
 		output_data_only(pb, XR_RECV);
+
+		// number of acked bytes
+		if (new_ack())
+		num_acked += tfwc_sndr_.b_jacked();
+		// and, reset status
+		set_new_ack();
 	  }
 	}
 	break;
@@ -381,13 +390,21 @@
 	case BYM:
 	{
 	  int len = 0;
-	  while(pb->len < tfwc_sndr_.b_magic() - len) {
+	  int num_acked = 0;
+
+	  while(pb->len < tfwc_sndr_.b_magic() + num_acked - len) {
 		len += pb->len;
 		// move head pointer
 		head_ = pb->next;
 		// call Transmitter::output(pb)
 		output(pb, recv_by_ch);
 
+		// number of acked bytes
+		if (new_ack())
+		num_acked += tfwc_sndr_.b_jacked();
+		// and, reset status
+		set_new_ack();
+
 		if (head_ != 0)
 			pb = head_;
 		else

Modified: vic/branches/cc/rtp/transmitter.h
==============================================================================
--- vic/branches/cc/rtp/transmitter.h	(original)
+++ vic/branches/cc/rtp/transmitter.h	Mon May 10 19:14:49 2010
@@ -143,6 +143,10 @@
 	double gettimeofday_secs() const;
 	double txtime(pktbuf* pb);
 
+	// new ack arrived?
+	virtual bool new_ack() = 0;
+	virtual void set_new_ack() = 0;
+
 	int mtu_;		/* mtu of wire (as seen by application) */
 	msghdr mh_;
 



More information about the Sumover-dev mailing list