[Sumover-dev] [svn commit] r4347 - in vic/branches/cc: rtp
sumover-dev at cs.ucl.ac.uk
sumover-dev at cs.ucl.ac.uk
Fri Jan 16 18:34:22 GMT 2009
Author: soohyunc
Date: Fri Jan 16 18:34:21 2009
New Revision: 4347
Modified:
vic/branches/cc/cc/tfwc_rcvr.h
vic/branches/cc/cc/tfwc_sndr.cpp
vic/branches/cc/cc/tfwc_sndr.h
vic/branches/cc/rtp/rtp.h
vic/branches/cc/rtp/session.cpp
vic/branches/cc/rtp/session.h
Log:
(work-in-progress)
o changing RTCP XR header format more compliable to the standard (RFC 3611)
again, this commit is still work-in-progress
1) need to finish rtp/session.cpp +1169
2) need to have a mean to bit flipping on XR chunk (MSB)
if MSB = 1, then it is AckVec
if MSB = 0, then it is Ack of Ack
Modified: vic/branches/cc/cc/tfwc_rcvr.h
==============================================================================
--- vic/branches/cc/cc/tfwc_rcvr.h (original)
+++ vic/branches/cc/cc/tfwc_rcvr.h Fri Jan 16 18:34:21 2009
@@ -45,15 +45,15 @@
u_int16_t ackofack, u_int32_t ts);
protected:
- inline u_int32_t tfwc_rcvr_getvec() { return tfwcAV; }
+ inline u_int16_t tfwc_rcvr_getvec() { return tfwcAV; }
inline u_int32_t tfwc_rcvr_ts_echo() { return ts_echo_; }
- u_int32_t tfwcAV; // AckVec (bit vector)
+ u_int16_t tfwcAV; // AckVec (bit vector)
u_int16_t currseq_; // current sequence number
u_int16_t prevseq_; // previous sequence number
u_int16_t ackofack_; // ackofack
private:
// trim ackvec
- inline void trimvec(u_int32_t vec, int offset) {
+ inline void trimvec(u_int16_t vec, int offset) {
tfwcAV = vec >> offset;
}
Modified: vic/branches/cc/cc/tfwc_sndr.cpp
==============================================================================
--- vic/branches/cc/cc/tfwc_sndr.cpp (original)
+++ vic/branches/cc/cc/tfwc_sndr.cpp Fri Jan 16 18:34:21 2009
@@ -116,7 +116,7 @@
/*
* main TFWC reception path
*/
-void TfwcSndr::tfwc_sndr_recv(u_int16_t type, u_int32_t ackv, u_int32_t ts_echo)
+void TfwcSndr::tfwc_sndr_recv(u_int16_t type, u_int16_t ackv, u_int32_t ts_echo)
{
// retrieve ackvec
if (type == XR_BT_1) {
Modified: vic/branches/cc/cc/tfwc_sndr.h
==============================================================================
--- vic/branches/cc/cc/tfwc_sndr.h (original)
+++ vic/branches/cc/cc/tfwc_sndr.h Fri Jan 16 18:34:21 2009
@@ -52,6 +52,8 @@
#define T_RTTVAR_BITS 2 // XXX not used
#define T_SRTT_BITS 3 // XXX not used
+#define LEN 16
+
class TfwcSndr {
public:
TfwcSndr();
@@ -59,7 +61,7 @@
void tfwc_sndr_send(pktbuf*);
// main reception path (XR packet)
- void tfwc_sndr_recv(u_int16_t type, u_int32_t ackv, u_int32_t ts_echo);
+ void tfwc_sndr_recv(u_int16_t type, u_int16_t ackv, u_int32_t ts_echo);
// return current data packet's seqno
inline u_int16_t tfwc_sndr_get_seqno() { return seqno_; }
@@ -96,25 +98,25 @@
protected:
// get the first position in ackvec where 1 is marked
- inline u_int32_t get_head_pos(u_int32_t ackvec) {
+ inline u_int16_t get_head_pos(u_int16_t ackvec) {
int l;
- for (l = 0; l < 32; l++) {
+ for (l = 0; l < LEN; l++) {
if(GET_HEAD_VEC(ackvec, l))
break;
}
- return (32 - l);
+ return (LEN - l);
}
// get the last position in ackvec where 1 is marked
- inline u_int32_t get_tail_pos(u_int32_t ackvec) {
+ inline u_int16_t get_tail_pos(u_int16_t ackvec) {
int l;
- for (l = 0; l < 32; l++) {
+ for (l = 0; l < LEN; l++) {
if(GET_TAIL_VEC(ackvec, l))
break;
}
return (l + 1);
}
// generate margin vector
- inline void marginvec(u_int32_t vec) {
+ inline void marginvec(u_int16_t vec) {
int hseq = get_head_pos(vec) + aoa_; // ackvec head seqno
for (int i = 0; i < DUPACKS; i++)
@@ -122,7 +124,7 @@
mvec_[i] = ((hseq - i) < 0) ? 0 : (hseq - i);
}
// generate seqno vector (interpret ackvec to real sequence numbers)
- inline void gen_seqvec(u_int32_t vec) {
+ inline void gen_seqvec(u_int16_t vec) {
int hseq = get_head_pos(vec) + aoa_; // ackvec head seqno
int cnt = hseq - aoa_; // number of packets in ackvec
int offset = 0; // if the bit is zero, then increment
@@ -156,7 +158,7 @@
}
int mvec_[DUPACKS]; // margin vec (simulatinmg TCP 3 dupacks)
- u_int32_t ackv_; // received AckVec (from TfwcRcvr)
+ u_int16_t ackv_; // received AckVec (from TfwcRcvr)
u_int32_t pvec_; // sent packet list
u_int16_t aoa_; // ack of ack
u_int32_t t_now_; // the time when the data packet sent
Modified: vic/branches/cc/rtp/rtp.h
==============================================================================
--- vic/branches/cc/rtp/rtp.h (original)
+++ vic/branches/cc/rtp/rtp.h Fri Jan 16 18:34:21 2009
@@ -148,7 +148,7 @@
u_int32_t ssrc; /* ssrc of the RTP data pkt being reported upon by this */
u_int16_t begin_seq; /* first seqno that this block report */
u_int16_t end_seq; /* last seqno that this block report plus 1 */
- u_int32_t chunk; /* extended report chunks */
+ u_int16_t chunk; /* extended report chunks */
};
#define RTCP_PT_SR 200 /* sender report */
Modified: vic/branches/cc/rtp/session.cpp
==============================================================================
--- vic/branches/cc/rtp/session.cpp (original)
+++ vic/branches/cc/rtp/session.cpp Fri Jan 16 18:34:21 2009
@@ -661,10 +661,11 @@
xr->xr_flags = htons(XR_BT_1 << 8);
// get current RTP data packet seqno from TfwcSndr
- xr->end_seq = htons(tfwc_sndr_get_seqno());
+ xr->begin_seq = htons(tfwc_sndr_get_seqno());
+ xr->end_seq = htons(tfwc_sndr_get_seqno() + 1);
- // get ackofack from TfwcSndr
- xr->begin_seq = htons(tfwc_sndr_get_aoa());
+ // set ack of ack
+ xr->chunk = htons(tfwc_sndr_get_aoa());
//debug_msg(" SeqNo: %d\n", tfwc_sndr_get_seqno());
}
@@ -1166,12 +1167,16 @@
u_int16_t flags = xr->xr_flags;
// ackofack and seqno
- ackofack_ = ntohs(xr->begin_seq);
- seqno_ = ntohs(xr->end_seq);
+ //ackofack_ = ntohs(xr->begin_seq);
+ //seqno_ = ntohs(xr->end_seq);
+
+ // parse XR information (begin, end, chunk)
+ u_int16_t begin = ntohs(xr->begin_seq);
+ u_int16_t end = ntohs(xr->end_seq);
+ u_int16_t chunk = ntohs(xr->chunk);
// we received seqno/ackofack, so do receiver stuffs here
if (seqno_ != ackofack_) {
- //printf("RECEIVER RECEIVER!!\n");
// parse seqno, ackofack, and timestamp from XR report block
if(flags == XR_BT_1) {
// this is XR conveys seqno and ackofack
@@ -1190,7 +1195,6 @@
}
// we received ackvec, so do sender stuffs here
else {
- //printf("SENDER SENDER!!\n");
// parse ackvec and timestamp echo from XR report block
if(flags == XR_BT_1) {
ackvec_ = ntohl(xr->chunk);
@@ -1312,7 +1316,7 @@
xr->end_seq = htons(seqno_);
// get ackvec from TfwcRcvr
- xr->chunk = htonl(tfwc_rcvr_getvec());
+ xr->chunk = htons(tfwc_rcvr_getvec());
}
// this block is used for giving timiestamp echo
else if (bt == XR_BT_3) {
Modified: vic/branches/cc/rtp/session.h
==============================================================================
--- vic/branches/cc/rtp/session.h (original)
+++ vic/branches/cc/rtp/session.h Fri Jan 16 18:34:21 2009
@@ -209,7 +209,7 @@
u_int16_t ackofack_; // Ack of ack
// AckVector
- u_int32_t ackvec_; // this is a bit vector
+ u_int16_t ackvec_; // this is a bit vector
u_int32_t ts_; // timestamp
u_int32_t ts_echo_; // timestamp echo
};
More information about the Sumover-dev
mailing list