Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: [RPRWG] One problem about addrate calculation algorithm in RPR




I think you have miss understand the lpaddrate and normLocalFairRate. The
advertise rate is normlized by normCoef and lpaddrate is an internal
variable, so it is can be save in 32bits or more.
The follow is a simple c code can do the maximum addrate(1M - 10G)
simulator.

#include <stdlib.h>

int main(int argc, char* argv[])
{
 double ageCoef=4,lpCoef=64,normCoef=0;
 double lpaddrate=0,addrate=0,normfairrate=0;
 int i=0;
 int rate =(2500/8)*100;  //2.5G rate generate 31250bytes/100us

 if(argc !=2)
 {
  printf("normrate ***\n\t here *** is (Mbps)\n");
  exit(1);
 }
 rate = (atoi(argv[1])/8)*100;
 normCoef =ageCoef*1*1; //ageCOef*rateCoef*localweight.
 if(rate >2500)
  normCoef = ageCoef*4*1;
 for(i=0;i<10*20;i++)
 {
  addrate = (addrate+rate)*(ageCoef-1)/ageCoef;
  lpaddrate =((lpCoef-1)*lpaddrate+addrate)/lpCoef;
  normfairrate =lpaddrate/normCoef;
  printf("%d\t%f\n",i*100,normfairrate);
 }
 return 0;
}




Best Regards
Jiangzhou
zjiang@xxxxxxxxxxxxxxxxxxx
----- Original Message -----
From: "X.B.Zhou" <xbzhou@xxxxxxx>
To: <stds-802-17@xxxxxxxx>
Sent: Tuesday, June 10, 2003 1:00 PM
Subject: [RPRWG] One problem about addrate calculation algorithm in RPR


> Dear all,
>
> Recently I have studied the algorithm of the addrate calculation which was
described in the draft2.1. The aginginterval as a function of the link rate
of the ringlet,is set as 100usec under condition that the link rate is OC48.
The calculaition result of the lp_add_rate is shown in the accessories. One
of the problems is that the lp_add_rate is beyond 65536 which is the upper
limit of the 16-bit payload of the fairness frame. The next one puzzled me
is that the convergence time of the lp_add_rate is so slow(about 30ms).Could
you give me some suggestion of it?
>
>
>
>
>
> Best Regards,
> = = = = = = = = = = = = = = = = = = = =
> ----------------------
> XiaoBo Zhou, Ph.D. Candidate
> Dept. E.E., Tsinghua Univ., Beijing 100084, P.R.CHINA
> Phone: +86-10-6278-1409
> -----------------------------------------------------
> 2003-06-07
>