|
Bugzilla – Full Text Bug Listing |
| Summary: | DataRate: kBps and kB/s have wrong multipliers. | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | TimoB <timo.bingmann> |
| Component: | core | Assignee: | Tom Henderson <tomh> |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | craigdo, gjcarneiro, mathieu.lacage, raj.b, riley, tomh |
| Priority: | P1 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
data-rate.cc and data-rate.h patch
revised, cleaned-up patch for units tom's patch revised again |
||
|
Description
TimoB
2008-12-05 08:16:28 UTC
-1 I know this is confusing, but IMHO 1 kbit/s == 1000 bit/s, and 1 kB == 1024 byte. At least this is how traditionally network engineers deal with the unit prefixes; when dealing with bitrates, k means 1000, when dealing with information (bytes) k means 1024. It's ok, just needs a big highlighted doxygen note. Maybe even add the (strange) KiB/s MiB/s GiB/s variants with 2^x multipliers. I hope it is clear that the two multipliers for kBps and kB/s are still very wrong. Created attachment 327 [details] data-rate.cc and data-rate.h patch The attached patch tries to align it with: http://en.wikipedia.org/wiki/Mbit/s#.27k.27_vs_.27Ki.27 (I only revised the k/K/Ki units in this patch, but similar could be done for the other prefixes) Comments? Good. Don't forget G and Gi in the doxygen. Created attachment 329 [details] revised, cleaned-up patch for units this finishes off alignment with: http://en.wikipedia.org/wiki/Mbit/s#.27k.27_vs_.27Ki.27 Basically, there shouldn't be much change to users except a few more strings are supported, and the two errors that Timo pointed out are fixed, and doxygen is added. (In reply to comment #5) > Created an attachment (id=329) [details] > revised, cleaned-up patch for units > > this finishes off alignment with: > http://en.wikipedia.org/wiki/Mbit/s#.27k.27_vs_.27Ki.27 > > Basically, there shouldn't be much change to users except a few more strings > are supported, and the two errors that Timo pointed out are fixed, and doxygen > is added. > patch looks great modulo a set of spurious \n which are present in the API doc. The API doc looks great ! Created attachment 331 [details]
tom's patch revised again
Changes: MBps was duplicate. KiB/s, Kib/s etc. are the unit suffixes not "Kibyte/s".
(In reply to comment #7) > Created an attachment (id=331) [details] > tom's patch revised again > > Changes: MBps was duplicate. agreed, thanks. > KiB/s, Kib/s etc. are the unit suffixes not > "Kibyte/s". > I do not care strongly. Both are discussed in the wikipedia page I referenced and I just picked one. These units may never be used, so I think it is OK to just support one of the string formats. I'm fine with your revised patch, thanks. |