Changeset 4787

Show
Ignore:
Timestamp:
04/28/10 20:16:25 (4 years ago)
Author:
soohyunc
Message:

EWMA packet size estimation has two coefficient

high coeff when frames have more than one packet
low coeff when frames have only one packet

this is because the packet size is extremly small when frames have only one
packet, making the whole EWMA process fluctuating too much.

So, we have two EWMA equation to estimate the packet size.

Location:
vic/branches/cc/cc
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • vic/branches/cc/cc/tfwc_sndr.cpp

    r4784 r4787  
    148148        pcnt_ = 0; 
    149149        psize_ = 0; 
    150         lambda_ = .75; 
     150        lambda1_ = .75; 
     151        lambda2_ = .15; 
    151152} 
    152153 
     
    164165        //print_psize(now_, record_[seqno_%PSR]); 
    165166 
    166         // arithmetic average 
     167        // arithmetic average packet size (per frame) 
    167168        asize_ += pb->len; 
    168         asize_ /= ++pcnt_; 
     169        pcnt_++; 
    169170 
    170171        // tag finished (end of frame) 
    171172        if (!(pb->tag)) { 
     173                asize_ /= pcnt_; 
    172174                // EWMA'd packet size 
    173                 psize_ = lambda_ * asize_ + (1 - lambda_) * psize_;      
    174                 pcnt_ = 0; 
    175         } 
     175                if (pcnt_ != 1) 
     176                psize_ = lambda1_ * asize_ + (1 - lambda1_) * psize_; 
     177                else 
     178                psize_ = lambda2_ * asize_ + (1 - lambda2_) * psize_; 
     179 
     180                asize_ = 0; pcnt_ = 0; 
     181        } 
     182        //print_psize(now_, psize_, pb->len); 
    176183 
    177184        // timestamp vector for loss history update 
  • vic/branches/cc/cc/tfwc_sndr.h

    r4784 r4787  
    179179        int pcnt_;              // packet counter per frame 
    180180        int psize_;             // EWMA packet size  
    181         double lambda_; // EWMA coeff 
     181        double lambda1_;        // EWMA coeff 
     182        double lambda2_;        // EWMA coeff 
    182183 
    183184private: 
     
    319320        } 
    320321 
     322        // print bcwnd for debugging 
     323        inline void print_bcwnd (double now, int w) { 
     324        fprintf(stderr, "\tnow: %f\tbcwnd: %d\n", now, w); 
     325        } 
     326 
    321327        // print received XR chunk info 
    322328        inline void print_xr_info(const char* str, const int i) { 
     
    369375 
    370376        // print packet size 
    371         inline void print_psize(double now, int size) { 
    372         fprintf(stderr, "\tnow: %f psize: %d\n", now, size); 
     377        inline void print_psize(double now, int size, int len) { 
     378        fprintf(stderr, "\tnow: %f psize: %d real: %d\n", now, size, len); 
    373379        } 
    374380