Article View: news.software.readers
Article #163526Re: Approx conversion from bps to downloaded bytes
From: Curt Welch
Date: Wed, 09 Mar 2005 20:48
Date: Wed, 09 Mar 2005 20:48
126 lines
7636 bytes
7636 bytes
"Sarge" <not@home.com> wrote: > "MartinS" <me@my.place> wrote in message > news:4228f6e9$0$88270$892e0abb@auth.newsreader.octanews.com... > > Mozzy <dem_d@mail.com> wrote: > > > > > Is there an approximation I can use to convert a bps figure into > > > actual bytes downloaded from a newsserver? > > > > > > I used to say for every 10 bits (baud?) that I would get 8 bits > > > downloaded onto my hard drive (the other two being used for comms > > > work) but I am not so sure that is a good rule of thumb. > > > > > > What approximations do other people use? > > > > > > Does it make a difference to how the approximation is calculated if > > > the download is text or binary? > > > > 1 byte = 8 bits > > > > -- > > Martin S. > > On a serial stream such as DSL, every 8 bits also has a stop bit for the > receiving UART. So use 9 bits per byte in your calculation. The bad > part is when a DSL provider says 3Mbit download speed, they are trying to > make it look better than it really is. They consider one Mbit = 1,000, > 000 bits instead of the proper 1 Mbit = 1024 Kbit = 1,048,576 bits. > > --Sarge It's never been "proper" to call 1 Mbit 1,048,576 bits. Bandwidth when quoted in bits per second has always been measured in powers of 10. It comes from a 40 year old tradition of how bandwidth has been sold and measured in the telephone industry. A T1 is 1.544 Mbits and has been for 40 years. Thats _exactly_ 1544000 bits per second because it's 24 channels at 8 bits per sample and 8000 samples per second plus one extra bit per frame. Or, (24*8 + 1) * 8000 which is 1544000 bits per second. The same convention has been followed for all bandwidth quotes. One Mbit is 1,000,000 bits per second. 10 Mbit eithernet has a base frequency of exacty 10,000,000 bits per second. Same things for 100 Mbit eithernet and 1 Gbit eithernet. It's all quoted in powers of 10. Over all these high speed circuits, data bits are pushed with 8 bits per byte. These are syncronus circuits, not async. There are no stop bits for each byte like there are with slow async serial lines. So the correct conversion from bytes to bits is done by dividing by 8, not 9. However, all data on the internet is sent as packets typically holding a maximum of around 1500 bytes. And though there are no wasted bits for each byte, there are extra bits added to every packet. Calculating the number of bits wasted per packet is very complex and it all depends on which bytes you are counting. For example, if you are doing an article download from Usenet over the internet, your newsreader might be showing you how fast the transfer is going by couting the number of article bytes recieved. Many newsreaders (and other computer applications) will quite download speed in bytes per second. It it shows you downloading at 100 KBytes/sec, then it's only counting data bytes, and it's probably using the computer file size convention of 1 KByte = 1024 bytes per second. To convert that to bits per second, you just multiple by 8 and get 819200 bits per second. But that doesn't include the bandwidth wasted on the overhead bytes added to each packet. To start with, the TCP will add something like 24 bytes for each packet. That includes data such as the source port, the destination port, the data sequence number, a checksum, etc. Then on top of that the IP protocol will add another 24 bytes. That includes stuff like the source IP address and the destination IP address, header checksum, various flags, etc. Then, the physical media will add more bytes and/or bits to each packet. I don't know what DSL does, but for ethernet, you have 64 preanble bits plus 48 bits for the destination adderss plus 48 bits for the source address bus 16 bits for the type field plus a 32 bit CRC plus 8 bits for the postable. Thats an overhead of about 27 more bytes per packet. A full size ethernet packet can hold only 1500 data bytes of payload data. So that means a full size ethernet packet is 1500 + 27 or 1527 bytes or 12216 bits of data. In that packet, there can only be something like 1500 - 24 - 24 = 1450 bytes of TCP data. But I think the actual max is 1448 bytes. Though IP can support larger frames, the internet is built on the ethernet standard so the largest packets you find flying around most of the intener are these 1448 sized data packets with about 48 bytes of TCP and IP overhead + more for the physical medium. So, if you have a 100 Mbit ethernet connection, it can push 100,000,000 bits per second max. A packet with 1448 article bytes in it will have about 24 + 24 + 27 bytes of TCP+IP+Ethernet overhead in them yealding packets of 1523 bytes each going over the bandwidth. So that's 100,000,000 / 1523 * 1448 or 95 Mbits of article data bytes you can push over 100 Mbit either net. Divide by 8 to get 11.884 million article bytes. Divide by 1024 twice to convert from bits to MBytes, and we end up with 11.3 MBytes per second being the max you could push in a TCP stream over an 100 Mbit ethernet connection. So, if you start with 100 Mbits, and just divide by 9, you get 11.1 MBytes, which is very close to the correct 11.3 Mbyte answer, but it has nothing to do with 1 stop bit being added for each byte. It's the 1000 vs 1024 bits vs bytes convention for measuring bandwidth, plus the TCP and IP and physical packet overhead which makes dividing by 9 a better rough estimate than dividing by 8. I don't know the physical packet overhead for DSL, but if that's the bandwidth number you starting with, then dividning by 9 is probably a good rough estimate in order to convert bandwidth measured in bits to download speed in K or M bytes per second. But it will only be a rough estimate becuse of all the complexity of calculating actual overhead. And, because of many complex performance issues, it's very hard to every hit that maximum number in most real world applications. So you should expect to see less. Divide your bandwidth by 9 to get application bytes, and take 80% of that to estimate what you can expect to actually see. If you transfer at around that rate, you can assume your machine is working "normally". Getting it to go faster will require a lot of tuning on both sides of the transfer. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com http://NewsReader.Com/
Technical Details
Message-ID:
<20050309154826.338$3Q@newsreader.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-octanews.general.mbox.gz!number1.nntp.ams.giganews.com!number1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!feed5.newsreader.com!newsreader.com!newsh.newsreader.com!ellis.newsreader.com!not-for-mailReferences:
<960FF163A45B351A7E@204.153.244.156> <4228f6e9$0$88270$892e0abb@auth.newsreader.octanews.com> <_b7Wd.3497$C47.2013@newssvr14.news.prodigy.com>Show Full Headers
Complete Article Headers
Message-ID: <20050309154826.338$3Q@newsreader.com>
Subject: Re: Approx conversion from bps to downloaded bytes
Date: Wed, 09 Mar 2005 20:48:26 +0000
From: curt@kcwc.com (Curt Welch)
References: <960FF163A45B351A7E@204.153.244.156> <4228f6e9$0$88270$892e0abb@auth.newsreader.octanews.com> <_b7Wd.3497$C47.2013@newssvr14.news.prodigy.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-octanews.general.mbox.gz!number1.nntp.ams.giganews.com!number1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!feed5.newsreader.com!newsreader.com!newsh.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: alt.free.newsservers,news.software.readers,octanews.general
X-Trace: NewsReader.Com xBi-oVRXyK/.WpvM/EwBlQ.L@o..SUry+lb./_w8xXVOgE6sb
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,
?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
%IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 126