Bug 118006 - ifconfig: Mb and MiB are diffrent beasts and should be handled so
Summary: ifconfig: Mb and MiB are diffrent beasts and should be handled so
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: net-tools   
(Show other bugs)
Version: rawhide
Hardware: All Linux
high
medium
Target Milestone: ---
Assignee: Radek Vokal
QA Contact: Ben Levenson
URL:
Whiteboard:
Keywords: EasyFix, Patch
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-03-10 23:13 UTC by Petri T. Koistinen
Modified: 2009-04-28 01:54 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-30 09:33:01 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Fix units to be SI standard (2.50 KB, patch)
2004-03-14 18:30 UTC, Tom "spot" Callaway
no flags Details | Diff

Description Petri T. Koistinen 2004-03-10 23:13:26 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040122 Debian/1.6-1

Description of problem:
eth0      Link encap:Ethernet  HWaddr 00:02:B3:63:DA:BE
          inet addr:80.222.51.178  Bcast:80.222.63.255 Mask:255.255.240.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4643429 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4407272 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:463857499 (442.3 Mb)  TX bytes:2823718271 (2692.9 Mb)

I think Mb (megabit = 1,000,000 bits) should be MiB (megabyte =
1,048,576 bytes).

Version-Release number of selected component (if applicable):
net-tools-1.60-22

How reproducible:
Always

Steps to Reproduce:
1. Use calculator: 2823718271 / 1024 / 1024 = 2692,90759182... MiB.
   1048576 * 2692,90759182 = 2823718271,00024832

Additional info:

Comment 1 Juha Merikallio 2004-03-10 23:33:07 UTC
debian uses [KMG]iB

eth0      Link encap:Ethernet  HWaddr 00:50:04:6A:F7:3C  
          inet addr:10.0.0.10  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::250:4ff:fe6a:f73c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2478006 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2866712 errors:0 dropped:0 overruns:0 carrier:0
          collisions:1706 txqueuelen:1000 
          RX bytes:795139352 (758.3 MiB)  TX bytes:3036864587 (2.8 GiB)

Comment 2 Petri T. Koistinen 2004-03-14 18:03:38 UTC
man 7 units

Comment 3 Tom "spot" Callaway 2004-03-14 18:30:56 UTC
Created attachment 98528 [details]
Fix units to be SI standard

This fixes the unit issues, and adds support for units from KiB to EiB.

Comment 4 Alan Cox 2004-06-18 18:01:59 UTC
KiB and MiB are geekspeek, it would IMHO be far better simply to
divide by 1000, 1000000 et and use KB MB. MiB etc are also don't seem
to be SI approved units but a proposal.



Comment 5 Radek Vokal 2004-08-30 09:33:01 UTC
Tom's patch is applied to net-tools-1.60-33. I agree with Alan that
"i" units are quite strange, but according to SI and that some other
free software started to using them I've included this patch.

Comment 6 David Woodhouse 2006-01-08 01:12:54 UTC
To correct the misinformation in comment #4 above: 

The prefixes for binary multiples are not just 'geekspeek', and neither are they
merely 'a proposal'. They have been an IEC standard since 1998.

See http://physics.nist.gov/cuu/Units/binary.html for further background.

Comment 7 Alexander Pas 2009-04-28 01:54:05 UTC
some more information:

The SI prefixes should only be used in the decimal sense: kilobyte and megabyte denote one thousand bytes and one million bytes respectively, while kibibyte and mebibyte denote 1024 bytes and 1,048,576 bytes respectively. This recommendation has been adopted by SI, IEEE, CIPM, NIST, ISO/IEC and some other leading national and international standards, which now state that the prefixes k, M and G should always refer to powers of ten, even in the context of information technology.
(reference: ISO/IEC IEC 80000-13:2008 )

reduced timeline:
1998:
IEC introduces unambigous prefixes for binary multiples (KiB, MiB, GiB etc.), reserving kB, MB, GB and so on for their decimal sense.

2005:
IEC prefixes are adopted by the IEEE after a two-year trial period.

2008:
NIST guidelines require use of IEC prefixes KiB, MiB ... (and not kB, MB) for binary byte multiples

“The names and symbols for the prefixes corresponding to 2 10 , 2 20 , 2 30 , 2 40 , 2 50 , and 2 60 are, respectively: kibi, Ki; mebi, Mi; gibi, Gi; tebi, Ti; pebi, Pi; and exbi, Ei. Thus, for example, one kibibyte would be written: 1 KiB = 2 10 B = 1024 B, where B denotes a byte.
Although these prefixes are not part of the SI, they should be used in the field of information technology to avoid the incorrect usage of the SI prefixes.”

also remember this:
decimal value 	binary value 	difference 	
1000^1 = 10^3   1024^1 = 2^10   2.4%
1000^2 = 10^6   1024^2 = 2^20   4.9%
1000^3 = 10^9   1024^3 = 2^30   7.4%
1000^4 = 10^12  1024^4 = 2^40   10.0%
1000^5 = 10^15  1024^5 = 2^50   12.6%
1000^6 = 10^18  1024^6 = 2^60   15.3%
1000^7 = 10^21  1024^7 = 2^70   18.1%
1000^8 = 10^24  1024^8 = 2^80   20.9%

also, this has a usability impact, since using the same wording with two different meanings is JUST PLAIN WRONG, and should end RIGHT NOW,
Regular users don't know that the units have dual meanings, and we shouldn't continue confusing them in this way.


Note You need to log in before you can comment on or make changes to this bug.