Calculation formula for TCP throughput

Source: Internet
Author: User

Valve Game company Open source Gamenetworkingsockets[1], both support reliable data transmission, but also support unreliable data transmission, its data transmission is based on UDP, the implementation of TCP-friendly congestion control mechanism to ensure the fairness of bandwidth occupancy. [2] Its rate-control formula is based on a famous paper. Now, record its bandwidth calculation program here for a rainy time:

Const Int64 k_nmillion = 1000000;
int tfrccalcx (int s, Int64 RTT, float p)
{
    //TFRC throughput equation
    ////                                s
    //   x_bps =-- --------------------------------------------------------
    //           r*sqrt (2*B*P/3) + (T_rto * (3*sqrt (3*B*P/8) *p* (1+32*p^2)))
    //b is TCP acknowlege packet rate, assumed to be 1 for this implementation

    float R = (double) Rtt/k_nmillio n;
    float T_rto = MAX (4 * R, 1.0f);

    return static_cast< int > (static_cast<float> (s)/
        (R * sqrt (2 * p/3) + (T_rto * (3 * sqrt (3 * P/8) * p * (1 + * (p * p)))));
}

[1]gamenetworkingsockets
[2]padhye J, Firoiu V, Towsley D, et al. Modeling TCP throughput:a simple model and its Empirical Validation[j]. ACM Sigcomm Computer Communication Review, 1998, 4:303-314

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.