[Sumover-dev] [svn commit] r4653 - vic/branches/cc/cc
sumover-dev at cs.ucl.ac.uk
sumover-dev at cs.ucl.ac.uk
Sat Feb 27 01:20:45 GMT 2010
Author: soohyunc
Date: Sat Feb 27 01:20:45 2010
New Revision: 4653
Modified:
vic/branches/cc/cc/tfwc_sndr.cpp
vic/branches/cc/cc/tfwc_sndr.h
Log:
-- changed TfwcSndr's XR reception path
TFWC sender can now parse SO_TIMESTAMP to calculate more accurate RTT
"so_recv_" represents the SO_TIMESTAMP.
SO_TIMESTAMP is important when we need RTT (seen by Vic) closer to the real network RTT
(see - http://nms.csail.mit.edu/software/CM/doc/cmappnotes.html)
Modified: vic/branches/cc/cc/tfwc_sndr.cpp
==============================================================================
--- vic/branches/cc/cc/tfwc_sndr.cpp (original)
+++ vic/branches/cc/cc/tfwc_sndr.cpp Sat Feb 27 01:20:45 2010
@@ -51,6 +51,7 @@
t_ts_(0),
t_ts_echo_(0),
now_(0),
+ so_recv_(0),
ndtp_(0),
nakp_(0),
ntep_(0),
@@ -130,7 +131,7 @@
* main TFWC reception path
*/
void TfwcSndr::tfwc_sndr_recv(u_int16_t type, u_int16_t begin, u_int16_t end,
- u_int16_t *chunk)
+ u_int16_t *chunk, double so_rtime)
{
// number of ack received
//nakp_++;
@@ -139,6 +140,9 @@
begins_ = begin; // lowest packet seqno
ends_ = end; // highest packet seqno plus one
+ // so_timestamp (timestamp for packet reception)
+ so_recv_ = so_rtime;
+
// get the number of AckVec chunks
// use seqno space to work out the num chunks
// (add one to num unless exactly divisible by BITLEN
@@ -191,16 +195,16 @@
else {
control();
}
- fprintf(stderr, "\tnow: %f\tcwnd: %d\n", now(), cwnd_);
+ fprintf(stderr, "\tnow: %f\tcwnd: %d\n", so_recv_, cwnd_);
// set ackofack (real number)
aoa_ = ackofack();
// update RTT with the sampled RTT
- tao_ = now() - tsvec_[jacked_%TSZ];
+ tao_ = so_recv_ - tsvec_[jacked_%TSZ];
update_rtt(tao_);
- //fprintf(stderr, "\t<< now_: %f tsvec_[%d]: %f rtt: %f srtt: %f\n",
- // now(), jacked_%TSZ, tsvec_[jacked_%TSZ], tao_, srtt_);
+ fprintf(stderr, "\t<< now_: %f tsvec_[%d]: %f rtt: %f srtt: %f\n",
+ so_recv_, jacked_%TSZ, tsvec_[jacked_%TSZ], tao_, srtt_);
// initialize variables for the next pkt reception
free(ackv_);
Modified: vic/branches/cc/cc/tfwc_sndr.h
==============================================================================
--- vic/branches/cc/cc/tfwc_sndr.h (original)
+++ vic/branches/cc/cc/tfwc_sndr.h Sat Feb 27 01:20:45 2010
@@ -61,7 +61,7 @@
// main reception path (XR packet)
void tfwc_sndr_recv(u_int16_t type, u_int16_t begin, u_int16_t end,
- u_int16_t *chunk);
+ u_int16_t *chunk, double so_rtime);
// return ackofack
inline u_int16_t tfwc_sndr_get_aoa() { return aoa_; }
@@ -160,6 +160,7 @@
double ts_; // time stamp (double type)
double ts_echo_; // time stamp echo (double type)
double now_; // real-time now
+ double so_recv_; // SO_TIMESTAMP (XR packet reception)
double tao_; // sampled RTT
private:
// update RTT
More information about the Sumover-dev
mailing list