[Sumover-dev] [svn commit] r4812 - vic/branches/cc/cc
sumover-dev at cs.ucl.ac.uk
sumover-dev at cs.ucl.ac.uk
Mon May 10 01:05:41 BST 2010
Author: soohyunc
Date: Mon May 10 01:05:41 2010
New Revision: 4812
Modified:
vic/branches/cc/cc/cc_common.h
vic/branches/cc/cc/tfrc_sndr.cpp
vic/branches/cc/cc/tfrc_sndr.h
vic/branches/cc/cc/tfwc_sndr.cpp
Log:
-- TFWC's initial window size (in bytes) is set to 1460 bytes
-- TFRC also has a mechanism to calculate the average packet size
-- added some debug statements in TfrcSndr
Modified: vic/branches/cc/cc/cc_common.h
==============================================================================
--- vic/branches/cc/cc/cc_common.h (original)
+++ vic/branches/cc/cc/cc_common.h Mon May 10 01:05:41 2010
@@ -56,4 +56,6 @@
// (approximately 10 usec)
#define SKEW 0.000010
+#define MAX_RTP 1460
+
#endif /* vic_cc_common_h */
Modified: vic/branches/cc/cc/tfrc_sndr.cpp
==============================================================================
--- vic/branches/cc/cc/tfrc_sndr.cpp (original)
+++ vic/branches/cc/cc/tfrc_sndr.cpp Mon May 10 01:05:41 2010
@@ -104,6 +104,9 @@
t_srtt_ = int(srtt_init_/tcp_tick_) << T_SRTT_BITS;
t_rttvar_ = int(rttvar_init_/tcp_tick_) << T_RTTVAR_BITS;
+ // record packet size in bytes
+ record_ = (u_int16_t *)malloc(sizeof(u_int16_t) * PSR);
+ clear_record(PSR);
// EWMA packet size
asize_ = 0;
pcnt_ = 0;
@@ -140,9 +143,13 @@
asize_ = 0; pcnt_ = 0;
}
+ // number of *estimated* bytes for this packet
+ record_[seqno_%PSR] = psize_;
+ //print_psize(now_, psize_, pb->len);
// timestamp vector for loss history update
tsvec_[seqno_%TSZ] = now_-SKEW;
+ //print_packet_tsvec();
// sequence number must be greater than zero
assert (seqno_ > 0);
Modified: vic/branches/cc/cc/tfrc_sndr.h
==============================================================================
--- vic/branches/cc/cc/tfrc_sndr.h (original)
+++ vic/branches/cc/cc/tfrc_sndr.h Mon May 10 01:05:41 2010
@@ -139,6 +139,11 @@
for (int i = 0; i < n; i++)
refvec_[i] = 0;
}
+ // clear record for packet size in bytes
+ inline void clear_record (int n) {
+ for (int i = 0; i < n; i++)
+ record_[i] = 0;
+ }
int ndtp_; // number of data packet sent
int nakp_; // number of ackvec packet received
@@ -193,6 +198,10 @@
int num_elm_; // number of ackvec elements
int num_vec_; // number of ackvec chunks
+ // record packet size in bytes
+ u_int16_t *record_;
+
+
// print vec
inline void print_vec(const char* str, u_int32_t *vec, int c) {
fprintf(stderr, "\t%s: (", str);
@@ -221,6 +230,15 @@
inline void print_psize(double now, int size, int len) {
fprintf(stderr, "\tnow: %f psize: %d actual: %d\n", now, size, len);
}
+ // print the actual packet size and EWMA estimated one
+ inline void print_psize(double now, int size, int len) {
+ fprintf(stderr, "\tnow: %f psize: %d actual: %d\n", now, size, len);
+ }
+ // print packet's timestamp record
+ inline void print_packet_tsvec() {
+ fprintf(stderr, "\t>> now: %f tsvec_[%d]: %f\n",
+ now_, seqno_%TSZ, tsvec_[seqno_%TSZ]);
+ }
};
#endif
Modified: vic/branches/cc/cc/tfwc_sndr.cpp
==============================================================================
--- vic/branches/cc/cc/tfwc_sndr.cpp (original)
+++ vic/branches/cc/cc/tfwc_sndr.cpp Mon May 10 01:05:41 2010
@@ -60,7 +60,7 @@
TfwcSndr::TfwcSndr() :
seqno_(0),
cwnd_(1), // initial cwnd in packet
- bcwnd_(1500), // initial cwnd in byte
+ bcwnd_(MAX_RTP),// initial cwnd in byte
rtx_timer_(this),
aoa_(0),
now_(0),
More information about the Sumover-dev
mailing list