Subject: Bandwidth encoding in draft-ietf-mpls-generalized-signaling-00.tx t

From: "Arvind, K" <[email-masked]>
Date: Fri, 27 Oct 2000 10:55:13 -0400

According to the draft, bandwidth encodings "are carried in 32 bit number in
IEEE floating point format (the unit is bytes per second)". However, the
encodings provided in Section 3.1.4 appear to be for bits per sec rather
than bytes per sec. Would someone be kind enough to double check the numbers
and correct any "binary blindness" on my part? :-) Thanks.

Regards,
Arvind.

As per RFC1832, a floating point number is represented as follows (if the
following appears garbled, please use a fixed width font such as courier)
The standard defines the floating-point data type "float" (32 bits or 4
bytes). The encoding used is the IEEE standard for normalized
single-precision floating-point numbers [3]. The following three fields
describe the single-precision floating-point number: 
S: The sign of the number. Values 0 and 1 represent positive and negative,
respectively. One bit. 
E: The exponent of the number, base 2. 8 bits are devoted to this field. The
exponent is biased by 127. 
F: The fractional part of the number's mantissa, base 2. 23 bits are devoted
to this field. 
Therefore, the floating-point number is described by:
 (-1)**S * 2**(E-Bias) * 1.F 
It is declared as follows: 
float identifier; 
+-------+-------+-------+-------+ 
|byte 0 |byte 1 |byte 2 |byte 3 | SINGLE-PRECISION 
S| E | F | FLOATING-POINT NUMBER 
+-------+-------+-------+-------+ 
1|<- 8 ->|<-------23 bits------>|
<------------32 bits------------>

A bit rate of DS0 = 0.064 Mbps = 64000 bps = 8000 Bytes per sec =
4096*1.953125
= (-1)**0 * 2**15 * 1.953125
= (-1)**0 * 2**(142-127) * 1.953125
(=> S=0, E=142, F=953125)
= 0 10001110 00011101000101100100101
= 0x470D8B25

A similar calculation using 64000 instead of 8000 yields 0x477A0000 (the
value provided in the draft for DS0). The same is true for DS1. The floating
point representation provided in the draft (0x49BC7A00) corresponds to 1.544
Mbps and not 193000 bytes/sec. Based on these 2 samples, it appears all the
numbers are off by a factor of 8 (i.e., bits per sec rather than bytes per
sec).