Taking apart a very cheap USB to Ethernet adapter and pondering on the parts found inside.
Here are two USB to Ethernet adapters:
One of them is sold on ebay for $3.85 AU ($3.99 US), including postage to Australia. The other is sold at Apple Stores for $29.
<footnote>Model MC704ZM / A1277
In Linux they both use the driver for an "ASIX AX88772A" USB to Ethernet converter, even though the Apple one reports as "Apple" and is sold only for the MacBook Air.
<footnote>Internet lore seems to agree that any Mac running OS X 10.5.2 or later can use it.
The cheap adapter comes with drivers for OS X & Windows, as well.
When I ran a TCP throughput test with iperf, they both performed well. The Apple adapter measured throughput of 94.3Mbps. The cheap adapter measured 87.4Mbps. By comparison, the builtin ethernet on my laptop measured 94.8Mbps (after being set from gigabit to 100Mbps.)
There are a few unusual things about the cheap adapter, though. The Linux kernel log says:
usb 3-2.1.2: New USB device found, idVendor=0b95, idProduct=772a usb 3-2.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 3-2.1.2: Product: AX88x72A usb 3-2.1.2: Manufacturer: ASIX Elec. Corp. usb 3-2.1.2: SerialNumber: 000002 eth1: register 'asix' at usb-0000:0e:00.0-2.1.2, ASIX AX88772 USB 2.0 Ethernet, 00:8a:8d:8a:39:2b
Serial number "000002"? Hmm...
Also, the hardware MAC address prefix (00:8a:8d) isn't any known vendor OUI (organisationally unique identifier.) Seems odd, although chipset vendors (like ASIX) often require the device manufacturer to register their own OUI (for instance the Apple adapter uses an Apple prefix.) For a no-name vendor, it makes sense to just make one up.
Spot the difference
Here's a view inside the cheap adapter:
Inside the Apple adapter:
It seems $29 buys you shielding from interference. Underneath the cover:
Some similarities are visible:
- Both adapters have a 512 byte EEPROM onboard (Atmel AT93C66B.)
<footnote>Actually the part markings on the cheap adapter's EEPROM don't match Atmel's datasheet, so it's possible that one is a clone, rebadged, or old stock.
- Both adapters have an Ethernet transformer to isolate the ethernet signals from the rest of the board (MEC TM1701M & LFE8423, respectively.)
The biggest difference is this: the Apple adapter contains a clearly labelled ASIX AX88772ALF USB to Ethernet bridge, the other adapter has an unmarked chip that is not made by ASIX.
ASIX don't make any USB/Ethernet devices in a 32 pin package, their smallest package has 64 pins, same as the genuine one above.
It's a clone!
A clever clone
This is not a simple copy, though. It's been modified to make it much cheaper to produce. It might even be a brand new ASIC, created from scratch to be compatible.
To know if it is a modified knockoff or made from scratch we could dissolve the chip packages in acid ("decapping" them) and then look at the exposed silicon die under a microscope. Not quite that keen yet, though.
The genuine AX88772A requires two crystal oscillators for accurate timing - a 25MHz oscillator for the ethernet interface clock, and a 12MHz oscillator for the USB interface clock. The cheap adapter only has a single 25MHz crystal.
How much does this save? A lot. The Apple adapter has two "TXC" brand oscillators (the shiny silver packages.) ~~These cost around $1.33 each if you buy 15,000~~
<footnote>Not the same oscillators but the same brand, meeting the spec that ASIX requires: 25MHz & 12MHz. Of course both Apple and our noname manufacturer would pay less than Digikey's prices, but it gives you some idea.
</footnote>. ~~This wholesale cost alone is nearly the retail price of the cheap adapter on taobao.com.~~
By comparison, a single large crystal resonator like the one on the cheap adapter costs $0.16 from the same source (~~6%~~ 20%, see below, of the cost.)
EDIT: Someone on reddit pointed out that I was using 'oscillator' incorrectly to refer to the large crystal, which is only the resonator part of an oscillator circuit. Fixed!
EDIT 2: Gerard points out in the comments that the two TXC chips are probably just crystal resonators (not full oscillators) as well. I checked the reference schematic for ASIX's Demoboard and he's right. Thanks Gerard! So the cheapest ones they could be are around $0.40 each (12MHz/25MHz), the cheaper board's single crystal is then closer to 20% of the cost.
In the genuine chip, the 12MHz frequency would be used to derive 480MHz for USB 2.0 High Speed by using a PLL frequency multipler circuit. 12 x 40 = 480.
In the cheap one, I'm guessing the host's packet sync must be used to synchronise the 480MHz clock. Without a high speed oscilloscope or a USB 2.0 logic analyser it'd be hard to tell how well this goes at meeting the 480MHz +/-500ppm requirement of the USB High Speed spec.
<footnote>I think the Linux kernel could know the raw USB bit error rate, giving some idea of how precise the timing was, but the kernel doesn't record it anywhere
</footnote> ASIX themselves warn that if their precision 12MHz clock source has an incorrect capacitor it "can cause some problem during USB High Speed mode enumeration. For example, during the 100 times of repeatedly plug-and-unplug test, there may be 1 time that AX88772 may not be initialized properly". You'd imagine this kind of problem is potentially much worse in the cheap adapter, although I haven't yet noticed anything.
The Apple adapter also has many more small components – two inductors (the cheap adapter has none), over twenty five capacitors (the cheap adapter has only nineteen), more resistors. For the cheap adapter design, every fraction of a cent saved is important!
One thing that surprised me is that the cheap adapter has a functioning blue activity LED, that glows through the enclosure. The Apple adapter actually has a space on the PCB for this, but no LED in place (Apple's designers presumably nixed it for aesthetic reasons.) I'm surprised the manufacturer paid the few cents to add this feature.
For the manufacturer of cloned/compatible ASICs, an interesting bonus
<footnote>Assuming you can ignore copyright law, and have no qualms about reproducing other companies' intellectual property for profit
</footnote> is driver support. The CD that came with the cheap adapter contains ASIX's own drivers for Windows and OS X.
The Windows drivers are the exact same digitally signed ones that Microsoft distributes through Windows Update, meaning the adapters appear to have "passed" Windows Hardware Quality Labs testing. Something the actual device manufacturer surely couldn't have afforded.
In my simple tests both adapters seemed perfectly reliable, moving data back and forth quickly without any measurable errors. I ran an eight hour two-way ping flood (assuring plenty of collisions) with zero lost packets.
However, the cheap adapter is probably susceptible to (and a producer of) electrical noise. The Apple adapter is protected from an electrically noisy environment by its metal shielding, and extra decoupling capacitors on the board.
On the other hand, both USB and Ethernet contain mechanisms for dealing with errors introduced by interference. It's possible the protocols are well engineered enough that you'll never notice the difference.
It is also possible that the cloned ASIC will display hardware bugs that aren't in the legitimate adapter. So far I haven't found any (I tested some of the uncommon features like forcing 10Mbps, forcing half duplex, adjusting MTU.) I'd be interested to hear of any, though.
I'm probably unusual in that I find this world of cheap clone "shanzhai" hardware amazing. I'm fascinated that someone is out there redesigning existing silicon to make a knockoff that is smaller, cheaper but otherwise near-equivalent - to be used in devices that retail for less than $3.
I'd love to learn more about these secretive industries and the engineers who work in them.
How about you? Do you have any experience with dirt cheap hardware devices? How do you feel about shanzhai competing with regular firms' R&D by cloning their hardware? Please leave a comment and let me know what you think.