[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tc syntax for data rates





On Tue, 13 Jun 2000, Christopher E. Brown wrote:

> ------------------------------------------------------------------------
> > 
> > 	I am wondering about TCs treatment of kbps, mbps, kbit, mbit.
> > 
> > bps     =       bits/sec
> > kbps    =       bytes/sec * 1024
> > mbps    =       bytes/sec * 1024 * 1024
> > 
> > kbit    =       bits/sec * 1024
> > mbit    =       bits/sec * 1024 * 1024
> > 
> > 
> > 	I understand that tc treats everything as bytes/octets internally,
> > but the input vars are confusing.
> > 
> > 	Are we dealing with data rates or line rates?
> > 
> > 
> > 	For example, most scripts (including the examples) set a
> > 10Mbit ether as '10Mbit' and a 100Mbit ether as '100Mbit'.  However
> > internally tc treats 10Mbit as 10 * 1024 * 1024 / 8, giving a rate of
> > 1310720 bytes per second.  The correct rate for a 10Mbit is 10 million
> > bits per second, 10 * 1000 * 1000 / 8 or 1250000 bytes per second.
> > 
> > 
> > 	Could this be clarified?


This is true. I suppose its the opposite of what hard-disk manufacturers
tell you  when you buy a disk from them ;->

If you are asking if its wrong, i dont know.

One way to work around it is to enter the correct value that will come out
to be computed as  1250000 bytes per second; the other way is to
introduce a new extension "MBIT"? that will do this for you.


cheers,
jamal