Comparison of TCP Reno and TCP Vegas
via Fluid Approximation

T. Bonald

(INRIA - CNET)


The following C program simulates the window evolution of K TCP connections (here K=3) sharing the same bottleneck router of speed MU and buffer size B, by using the fluid approximation described in the research report RR-3563. Each connection uses either TCP Reno or TCP Vegas. The propagation delays and the initial windows of the connections may be different.

  • Source file (tcp.c)
  • Example 1
  • Example 2
  • Contact

    C program

    #include [stdio.h]
    #include [math.h]

    #define MAX 2000
    #define INC 0.01
    #define PRECISION 20

    #define RENO 0
    #define VEGAS 1

    #define ALPHA 1
    #define GAMMA 0.5

    #define TCP1 0
    #define TCP2 0
    #define TCP3 0
    #define TAU1 0.01
    #define TAU2 0.02
    #define TAU3 0.5
    #define BUFFER 100
    #define MU 1000

    float w1=0,w2=40,w3=150;
    float t1,t2,t3;

    float buffer()
    {

    float inf,sup,result,test;
    int i;

    inf=0;
    sup=BUFFER;
    if (w1/TAU1+w2/TAU2+w3/TAU3 < MU) return(inf);
    else
    {
    result=w1/(sup/MU+TAU1)+w2/(sup/MU+TAU2)+w3/(sup/MU+TAU3);
    if (result < MU)
    for (i=0;i < PRECISION;i++)
    {
    test=(inf+sup)/2;
    result=w1/(test/MU+TAU1)+w2/(test/MU+TAU2)+w3/(test/MU+TAU3);
    if (result < MU) sup=test;
    else inf=test;
    }
    return(sup);
    }
    }

    window(float x)
    {

    float rtt;

    rtt=TAU1+x/MU;
    if ((TCP1)&&(w1*(1-TAU1/rtt) > ALPHA))
    {
    w1=w1-INC/rtt;
    if (w1 < 0) w1=0;
    }
    else
    w1=w1+INC/rtt;
    rtt=TAU2+x/MU;
    if ((TCP2)&&(w2*(1-TAU2/rtt) > ALPHA))
    {
    w2=w2-INC/rtt;
    if (w2 < 0) w2=0;
    }
    else
    w2=w2+INC/rtt;
    rtt=TAU3+x/MU;
    if ((TCP3)&&(w3*(1-TAU3/rtt) > ALPHA))
    {
    w3=w3-INC/rtt;
    if (w3 < 0) w3=0;
    }
    else
    w3=w3+INC/rtt;
    }

    main()
    {


    float x;
    int i;

    for (i=1;i < MAX;i++)
    {

    /* Buffer Occupation */

    x=buffer();
    while (x >= BUFFER)
    {
    w1=w1*GAMMA;
    w2=w2*GAMMA;
    w3=w3*GAMMA;
    x=buffer();
    }

    /* Window Dynamics */

    t1=w1/(TAU1+x/MU);
    t2=w2/(TAU2+x/MU);
    t3=w3/(TAU3+x/MU);
    printf("%f %f %f %f %f %f %f\n",(float) i*INC,w1,w2,w3,t1,t2,t3);
    window(x);
    }
    }

    Example 1


    Consider the case of 3 TCP Reno connections with propagation delays TAU1 =10 ms, TAU2 =20 ms, TAU3 =500 ms and starting from initial window sizes W1 = 0, W2 = 40 and W3 = 150.

    The speed of the bottleneck is MU = 1000 packets/s and the buffer size B = 100 packets. The simulation results (see below) show that TCP Reno significantly discriminates against connections with large propagation delays.



    Example 2


    Consider the case of

  • 2 TCP Reno connections starting from initial window sizes W1 = 0, W2 = 40;
  • 1 TCP Vegas connection starting from initial window size W3 = 150.

    The speed of the bottleneck is MU = 1000 packets/s and the buffer size B = 100 packets. The propagation delays are the same for the three connections and equal to TAU = 100 ms. The simulation results (see below) show that the TCP Vegas user is severely disadvantaged compared to the TCP Reno users.



    Contact


  • T. Bonald
  • Mistral research group
  • INRIA