MSFN Forum: The (meta-sata-pata)physics of USB Transfer - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

The (meta-sata-pata)physics of USB Transfer (only 10 kinds of people allowed) Rate Topic: -----

#1 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,420
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 23 December 2011 - 04:02 AM

View PostFoxbat, on 22 December 2011 - 01:48 AM, said:

Those slim USB drives must also make trade-offs to achieve the reduction in size, like a reduction in transfer speed. There is no easy way to cheat physics.

Well, it depends on the type of data you send.

You see, 1's are slim enough, 0's are rather fat and may get slowed down by friction in the tinier electronic pipes.
As long as you send lots of 1's everything seems normal but when you want to actually 00 out a stick, it will get SLOW.
:whistle:

Though for very different reasons, the effect is not completely unlike what happens with cable connections:
http://www.911cd.net...pic=21827&st=23
though if you use 0's and 8's on those tiny USB sticks, you will actually worsen the issue :ph34r:

:lol:

jaclaz

This post has been edited by jaclaz: 24 December 2011 - 11:50 AM



#2 User is offline   rloew 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 932
  • Joined: 30-May 05
  • OS:98SE
  • Country: Country Flag

Posted 23 December 2011 - 01:03 PM

View Postjaclaz, on 23 December 2011 - 04:02 AM, said:

View PostFoxbat, on 22 December 2011 - 01:48 AM, said:

Those slim USB drives must also make trade-offs to achieve the reduction in size, like a reduction in transfer speed. There is no easy way to cheat physics.

Well, it depends on the type of data you send.

You see, 1's are slim enough, 0's are rather fat and may get slowed down by friction in the tinier electronic pipes.
As long as you send lots of 1's everything seems normal but when you want to actually 00 out a stick, it will get SLOW.
:whistle:

Though for very different reasons, the effect is not completely unlike what happens with cable connections:
http://www.911cd.net...pic=21827&st=23
though if you use 0's and 8's on those tiny USB sticks, you will actually worsen the issue :ph34r:

:lol:

jaclaz

Too bad nobody posted the real reason 0's are slower than 1's when writing USB Devices.

#3 User is offline   Foxbat 

  • Member
  • PipPip
  • Group: Members
  • Posts: 118
  • Joined: 18-January 11
  • OS:none specified
  • Country: Country Flag

Posted 24 December 2011 - 05:04 AM

View Postrloew, on 23 December 2011 - 01:03 PM, said:

Too bad nobody posted the real reason 0's are slower than 1's when writing USB Devices.

It boils down to line capacity. 0's require more bandwidth than 1's going through the line. USB wiring specifications lack 0-bit compression.

USB nominal transfer rate bit 0

Type A Connector
 __________        ____________________________________________________________
|  ______  |         ________    ________    ________    ________    ________ 
| [______] |  -->   /        \  /        \  /        \  /        \  /        \
|  _____   |  -->   |        |  |        |  |        |  |        |  |        |
| [_____]  |  -->   |        |  |        |  |        |  |        |  |        |
| [_____]  |  -->   |        |  |        |  |        |  |        |  |        |
|  ______  |  -->   |        |  |        |  |        |  |        |  |        |
| [______] |  -->   \________/  \________/  \________/  \________/  \________/
|__________|       ____________________________________________________________

   Result               0           0           0           0           0

===============================================================================

USB nominal transfer rate bit 1

Type A Connector
 __________        ____________________________________________________________
|  ______  |                 
| [______] |  -->    /|     /|     /|     /|     /|     /|     /|     /|    
|  _____   |  -->   / |    / |    / |    / |    / |    / |    / |    / |    
| [_____]  |  -->     |      |      |      |      |      |      |      |    
| [_____]  |  -->     |      |      |      |      |      |      |      |    
|  ______  |  -->     |      |      |      |      |      |      |      |    
| [______] |  -->   __|__  __|__  __|__  __|__  __|__  __|__  __|__  __|__  
|__________|       ____________________________________________________________

   Result             1      1      1      1      1      1      1      1


#4 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,420
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 24 December 2011 - 06:23 AM

View PostFoxbat, on 24 December 2011 - 05:04 AM, said:

It boils down to line capacity. 0's require more bandwidth than 1's going through the line. USB wiring specifications lack 0-bit compression.

Not really. :(
In your nice diagram both the 0 and 1's are propelled by a same given force, the --> :


Type A Connector
 __________ 
|  ______  |  
| [______] |  -->  
|  _____   |  -->   
| [_____]  |  -->   
| [_____]  |  -->   
|  ______  |  -->  
| [______] |  -->  
|__________|     


Since you are transmitting bits in vertical position the actual (band) width is actually the height between the two horizontal walls of the pipe (and is obviously a constant), this has nothing to do with actual rate.

A more accurate diagram (though you still have the actual bits sideways) is this one:
Type A Connector
 __________        __________________________________
|  ______  |                 
| [______] |   -->    /|     -->   /|     -->  /| 
|  _____   |   -->   / |     -->  / |     --> / | 
| [_____]  |   -->     |     -->    |     -->   |
| [_____]  |   -->     |     -->    |     -->   | 
|  ______  |   -->     |     -->    |     -->   | 
| [______] |   -->   __|__   -->  __|__   --> __|__ 
|__________|       ___________________________________

(you have to push each single byte).

In such a scenario, physics tells us how if you give a stronger push, the pushed object will acquire greater speed, so that if the diagram was a motion picture, what you woud see would be roughly as follows:

Type A Connector
 __________        __________________________________
|  ______  |         ____         ____         ____   
| [______] |  --->  /    \  ---> /    \  ---> /    \ 
|  _____   |  --->  |    |  ---> |    |  ---> |    | 
| [_____]  |  --->  |    |  ---> |    |  ---> |    | 
| [_____]  |  --->  |    |  ---> |    |  ---> |    | 
|  ______  |  --->  |    |  ---> |    |  ---> |    | 
| [______] |  --->  \____/  ---> \____/  ---> \____/ 
|__________|       ___________________________________


BUT what the good guys did was simply to use smaller characters:
               ____         
    /|        /    \                                 ____
   / |        |    |                    /|          /    \
     |  and   |    |              =      |    and   |    | 
     |        |    |                   __|__        \____/ 
     |        |    |           
   __|__      \____/  


And sent them vertically, here you can see how the fatter 0's may slow down transfer, since they go more tight in the pipe:
|__ __ |
|  |   |
|  |   |
|  |/  |
| ____ |
|/    \|
||    ||
|\____/|
| ____ |
|/    \|
||    ||
|\____/|
| ____ |
|/    \|
||    ||
|\____/|
|__ __ |
|  |   |
|  |   |
|  |/  |
|__ __ |
|  |   |
|  |   |
|  |/  |
| ____ |
|/    \|
||    ||
|\____/|


jaclaz

This post has been edited by jaclaz: 24 December 2011 - 07:38 AM


#5 User is offline   loblo 

  • Oldbie
  • PipPipPipPip
  • Group: Members
  • Posts: 679
  • Joined: 12-January 10
  • OS:ME
  • Country: Country Flag

Posted 24 December 2011 - 06:49 AM

Guys, going over and over with that kind of jokes is not too helpfull IMO, however I was wondering if rloew was also joking saying that transmitting zeros was slower than transmitting ones so I looked up a bit and from what I understand (perhaps erroneously) by briefly reading about NRZI encoding used for USB data transmission it would be that the more there are bit changes the slower the transmission.

This post has been edited by loblo: 24 December 2011 - 06:52 AM


#6 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,420
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 24 December 2011 - 07:41 AM

View Postloblo, on 24 December 2011 - 06:49 AM, said:

Guys, going over and over with that kind of jokes is not too helpfull IMO, however I was wondering if rloew was also joking saying that transmitting zeros was slower than transmitting ones so I looked up a bit and from what I understand (perhaps erroneously) by briefly reading about NRZI encoding used for USB data transmission it would be that the more there are bit changes the slower the transmission.

Noone ever tagged those posts as "helpful", AFAIK. :whistle:

I asked dencorso if he could split these few posts to a new thread, so that we can discuss some physics ;) without deranging the NUSB topic. :ph34r:

A bit more seriously (but not much ;)) the NRZI in itself has no consequence, it is the bit stuffing that actually makes the USB behave the other way round:
http://en.wikipedia....-return-to-zero

Quote

Non-Return-to-Zero Inverted (NRZI)

Example NRZI encoding

NRZ-transition occurs for a zero

Non return to zero, inverted (NRZI) is a method of mapping a binary signal to a physical signal for transmission over some transmission media. The two level NRZI signal has a transition at a clock boundary if the bit being transmitted is a logical 1, and does not have a transition if the bit being transmitted is a logical 0.

"One" is represented by a transition of the physical level.

"Zero" has no transition.

Also, NRZI might take the opposite convention, as in Universal Serial Bus (USB) signalling, when in Mode 1 (transition when signalling zero and steady level when signalling one). The transition occurs on the leading edge of the clock for the given bit. This distinguishes NRZI from NRZ-Mark.

However, even NRZI can have long series of zeros (or ones if transitioning on "zero"), so clock recovery can be difficult unless some form of run length limited (RLL) coding is used on top. Magnetic disk and tape storage devices generally use fixed-rate RLL codes, while USB uses bit stuffing, which is efficient, but results in a variable data rate: it takes slightly longer to send a long string of 1 bits over USB than it does to send a long string of 0 bits. (USB inserts an additional 0 bit after 6 consecutive 1 bits.)


http://en.wikipedia....ki/Bit_stuffing

Quote

A similar scheme is used in the Universal Serial Bus, but for a different reason: to ensure sufficient clock edges. Low- and full-speed USB data is sent NRZI encoded: a 0 bit causes a signal transition, while a 1 bit causes no change. The receiver must count the time between transitions to determine the number of 1 bits, and if that time is too long, the receiver can lose count. USB stuffs a 0 bit (causing a transition) after every 6 consecutive 1 bits; this guarantees at least one transition every 7 bit times. (A (0,6) RLL code.)

The main disadvantage of this form of bit-stuffing is that the code rate is unpredictable; it depends on the data being transmitted.


But that merely says that a 0 is added every few 1's, so as long as you send values up to 127 everything is fine and dandy.

170 and 85 will still be very nice numbers to transmit :yes: .

Guess why typing ASCII is usually faster than typing UNICODE? :w00t:

jaclaz

This post has been edited by jaclaz: 24 December 2011 - 07:49 AM


#7 User is online   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,322
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 24 December 2011 - 10:00 AM

Quote

Guess why typing ASCII is usually faster than typing UNICODE?


That ones simple:

ASCII = 5 characters

UNICODE = 7 characters

With that simple math ASCII is and will always be faster and (much easier on the fingers in the long run) than UNICODE...

Also what happens when and if binary gets pased 0-1, 2-3 and gets up to the rough and jagged numbers of 4 and 7???

This post has been edited by Kelsenellenelvian: 24 December 2011 - 10:04 AM


#8 User is online   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,322
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 24 December 2011 - 10:40 AM

ASCII = 01000001 01010011 01000011 01001001 01001001

UNICODE = 01010101 01001110 01001001 01000011 01001111 01000100 01000101

As you can see the 2 extra characters in binary cause ALOT more typing and effort.

This post has been edited by Kelsenellenelvian: 24 December 2011 - 10:40 AM


#9 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,420
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 24 December 2011 - 12:14 PM

View PostKelsenellenelvian, on 24 December 2011 - 10:00 AM, said:

Also what happens when and if binary gets pased 0-1, 2-3 and gets up to the rough and jagged numbers of 4 and 7???

Again it depends which effect you want to reduce, or the feature you want to add...

0 and 8's are very good as they are rounded, but, given that the pipes walls are made in a hard enough material, both the 4 and 7, since they have sharp, scraping edges may contribute to clean the pipes from any escaped electron that may pile up and clog the pipes, like:
|.8.|
|. .|
|. .|





The alternative, as you might know, is to send a few asterisks down the pipe, like:
|*  |
|*  |
| * |
| * |
|  *|
|  *|




Or, as some do, a set of slashes/backslashes:
| \ |
| \ |
|  \|
|  \|
|/  |
|/  |


Personally I prefer the asterisks because you can give 'em a little spin, so that they rotate, and each one of the six edges works * only a little time and thus last longer.

jaclaz

#10 User is online   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,322
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 24 December 2011 - 12:21 PM

Yeah but that is assuming you have a straight length of cable...

ANY slight bend and your going to get a clog.

(My cables have ALL sorts of bends, twists and loops in them.)

This post has been edited by Kelsenellenelvian: 24 December 2011 - 12:50 PM


#11 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,420
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 24 December 2011 - 12:46 PM

View PostKelsenellenelvian, on 24 December 2011 - 12:21 PM, said:

Yeah but that is assuming you have a straight length of cable...

ANY slight bend and your going to get a clog.

Sure :), on cables, back to where it all began:
http://www.911cd.net...pic=21827&st=23

It is not very common, but it can happen, it obviously depends on the material the pipes are made of/layered with.

Ever wondered how there were once gold (SCSI) cables and even today there is people willing to spend some US$21,.000 :w00t:
http://www.noiseaddi...est-audiophile/
http://www.verber.co.../ce/cables.html
http://consumerist.c...ter-cables.html
It's easy, they are made with better materials and have much smoother walls, after a few hours of use coathangers get all clogged by electrons. :ph34r:

Ha!, noone ever runs an endurance comparison with coathangers! :whistle:

But with Foxbat, we were talking of USB transfers and of the tinier sticks, and of USB connectors, they are straight enough normally.

jaclaz

This post has been edited by jaclaz: 24 December 2011 - 12:52 PM


#12 User is online   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,322
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 24 December 2011 - 12:50 PM

ALTHOUGH! I am now building a app to send a metric sh!tload of spining asterisks down my pipes once every morning so I can have that fresh' clean feeling everyday.

http://youtu.be/N91XsdrBqUY

#13 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,420
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 24 December 2011 - 12:53 PM

View PostKelsenellenelvian, on 24 December 2011 - 12:50 PM, said:

ALTHOUGH! I am now building a app to send a metric sh!tload of spining asterisks down my pipes once every morning so I can have that fresh' clean feeling everyday.

http://youtu.be/N91XsdrBqUY


You should NOT run that app every morning! :no:

It's just like DEFRAG, you only need to do it when it is needed and it depends on the use you do of the disk.

Currently used 1's already provide for normal cleaning, so unless you send too much 0's you shouldn't have so frequent the need.

There are some reports that streaming p0rn can clog cables faster, though. :rolleyes:

jaclaz

#14 User is online   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,322
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 24 December 2011 - 12:55 PM

Ah good point, BUT hey I do watch alot of porn so maybe I will set it to every wednesday morning at 3am, MS thinks thats good enough for my win7 defrag so I might as well have everything sorted out at the same time.

This post has been edited by Kelsenellenelvian: 24 December 2011 - 01:06 PM


#15 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,420
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 24 December 2011 - 01:08 PM

View PostKelsenellenelvian, on 24 December 2011 - 12:55 PM, said:

Ah good point, BUT hey I do watch alot of porn so maybe I will set it to every wednesday morning at 3am, MS thinks thats good enough for my win7 so I might as well have everything sorted out at the same time.


You should be VERY aware of the risks involved in running that at 3 A.M. :ph34r:

You need to add to your scheduling set a provision to calculate if the moon is full and skip the cleaning on that night if it is.

The sound (well below what the human ear can perceive) made by the spinning asterisks on some cable types can be very similar to the mating cry of werewolves... :w00t:

Of course it is well possible that it doesn't happen on your cables, but I wouldn't take the chance, if I were you. :no:

http://www.imdb.com/...es?qt=qt0484648

:)

jaclaz

#16 User is online   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,322
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 24 December 2011 - 01:29 PM

Quote

The sound (well below what the human ear can perceive) made by the spinning asterisks on some cable types can be very similar to the mating cry of werewolves...


The possibility of this make me think of sparkly vampires. I understand that they seem to go hand-in-hand with werewolves nowadays. While I am curious I REALLY don't want all of the trouble this may bring.

However the pale-skinned, dark haired beauties they attract might be nice :D

http://verydemotivat...75038528447.jpg

This post has been edited by Kelsenellenelvian: 24 December 2011 - 01:51 PM


#17 User is offline   rloew 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 932
  • Joined: 30-May 05
  • OS:98SE
  • Country: Country Flag

Posted 24 December 2011 - 03:05 PM

View Postloblo, on 24 December 2011 - 06:49 AM, said:

Guys, going over and over with that kind of jokes is not too helpfull IMO, however I was wondering if rloew was also joking saying that transmitting zeros was slower than transmitting ones so I looked up a bit and from what I understand (perhaps erroneously) by briefly reading about NRZI encoding used for USB data transmission it would be that the more there are bit changes the slower the transmission.

I wasn't joking!
But I wasn't talking about "transmitting" zeroes, I was talking about "writing" zeroes.

Nobody has gotten even close yet.

#18 User is offline   Foxbat 

  • Member
  • PipPip
  • Group: Members
  • Posts: 118
  • Joined: 18-January 11
  • OS:none specified
  • Country: Country Flag

Posted 24 December 2011 - 07:56 PM

Quote

In such a scenario, physics tells us how if you give a stronger push, the pushed object will acquire greater speed
Why stop here? USB pin 1 provides 5V max. If the USB specifications were modified to be driven at 12V (volt is a unit of pressure), we can utilize the VBUS to additionally accelerate the data rate by 2.4 times faster over the existing rate.

Quote

BUT what the good guys did was simply to use smaller characters
With bit compression, we can further reduced reduce the size to its most basic form. 0, 1.

Quote

And sent them vertically, here you can see how the fatter 0's may slow down transfer, since they go more tight in the pipe
Any advantage of transmitting them lengthwise is negated by their adjacency to each other which allows them to take advantage of aerodynamic drafting (a la stock car racing). Transmitting them as originally diagrammed always result in shorter data length, and therefore faster rate.

Tightness of the pipe can be resolved with a wider gauge cable. USB data conductor wires use a twisted pair (figure 1). The problem with this configuration is twofold. Transmitting data through a swirly twist as opposed to a straight line is inherently slower. The gauge is also narrow. Data can only flow in single file (figure 2). Rather than have each pin in its own wire, all pins can be propelled en mass over a multi/fat pipeline, and applying multi-quad shielding to compensate for not using twisted pair, which also helps stiffen the cable, thus avoiding sharp bends or kinks (figure 3).

USB Type A Connector
 __________
|  ______  |
| [______] | 1 5V    -->  ------------------------------------------------------------------------
|  _____   |              _  __  __  __  __  __  __  __  __  __  __  __  __  __  __  __  __  __  _
| [_____]  | 2 Data- -->   \/  \/  \/  \/  \/  \/  \/  \/  \/  \/  \/  \/  \/  \/  \/  \/  \/  \/ 
| [_____]  | 3 Data+ -->  _/\__/\__/\__/\__/\__/\__/\__/\__/\__/\__/\__/\__/\__/\__/\__/\__/\__/\_
|  ______  |                                        Twisted Pair
| [______] | 4 GND   -->  ------------------------------------------------------------------------
|__________|

Figure 1: USB data lines in a twisted pair

==================================================================================================

USB Type A Connector
 __________
|  ______  |
| [______] | 1 5V         ------------------------------------------------------------------------
|  _____   |
| [_____]  | 2 Data-        01  11  00  10  00  01  00  11  00  01  10  00  00  11  00  01  00  00
| [_____]  | 3 Data+ -->  01  00  01  11  01  00  01  10  01  01  00  00  01  11  01  10  01  11
|  ______  |                                        Twisted Pair
| [______] | 4 GND        ------------------------------------------------------------------------
|__________|
      Transmission Order: ...............................................................987654321
                          (using dots to represent two digit numbers due to lack of space)
Figure 2: Data transmitted slowly over 72 individual bits through a twisted pair

==================================================================================================

USB Type A Connector          Extra Shielding
                   =======================================
 __________        =======================================
|  ______  |         ------------> 0 0 0 0 0 0 0 0 0
| [______] | 1 12V   ------------> 1 1 1 0 1 1 1 1 1
|  _____   |         ------------> 0 0 0 1 0 0 0 0 0
| [_____]  | 2 Data- ------------> 0 0 0 0 0 0 0 0 1
| [_____]  | 3 Data+ ------------> 1 1 1 0 0 1 0 1 0
|  ______  |         ------------> 1 0 1 0 1 0 0 1 0
| [______] | 4 GND   ------------> 0 0 1 0 0 1 0 1 1
|__________|         ------------> 0 1 1 0 1 1 1 0 0
                   =======================================
                   =======================================
                              Extra Shielding
               Transmission Order: 9 8 7 6 5 4 3 2 1

Figure 3: Data transmitted quickly in 9 bytes yielding the output of:
01010011 01001110 01000001 01001011 01000101 00100000 01001111 01001001 01001100


#19 User is offline   GrofLuigi 

  • GroupPolicy Tattoo Artist
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,275
  • Joined: 21-April 05
  • OS:none specified
  • Country: Country Flag

Posted 25 December 2011 - 05:15 AM

Ah, you're talking about UPB (Universal Parallel Bus)? :ph34r:

GL

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy