9 ms·
This is a great discussion of all the ambiguity that has been added to the USB spec along the way and how that ambiguity can bite you. I'm fairly convinced at t
by ChuckMcM 4y ago
This is a great discussion of all the ambiguity that has been added to the USB spec along the way and how that ambiguity can bite you. I'm fairly convinced at this late stage that the IETF motto of "precise in what you send, flexible in what you receive" is basically evil. When standards work around the non-compliance of clients in creative ways (like HTTP browsers did, A LOT) they become "well it isn't in the standard but if you don't do this you'll break a lot of things out in the field" problems. That resistance to breaking existing clients is understandable, but ultimately it is a trap (in my opinion) that results in both security issues and safety issues.
It would be interesting to have a USB 4.x spec that was both explicit in all the behaviors AND had explicit tests for and responses to non-compliant stuff. I don't think the IEEE or anyone else for that matter has the stones to try the experiment though.
- jzwinck 4y agoIf IEEE does that, some manufacturers will just ignore it. Sure they may have to write weasel words like "USB compatible but not USB authorized" on their products, but they'll dominate the market by allowing people to use the largest variety of devices.
- zdragnar 4y agoThe simplest practical way around that (imho) is to license the name for the 4.x standard and be proactive in taking action against anyone who uses the name or logo if their cables or ports aren't compliant. Of course, depending on the jurisdiction who can actually bring claims, and how damages can be calculated, vary greatly. I, for one, wouldn't buy "USB compatible but not USB authorized" cables if it meant being secure in knowing that the damned cable will actually work. Less tech savvy people might not, but there's also people who can be tricked into buying blinker fluid for their cars. There's gotta be a happy medium somewhere.
- marcosdumay 4y ago> is to license the name for the 4.x standard Oh, while you are at it, they will also need names that don't keep changing and don't have synonyms. The 4.x names are ok for reference in a standard, but they are useless for consumer communication.
- solardev 4y agoIs that basically what Thunderbolt does?
- kayfox 4y ago> The simplest practical way around that (imho) is to license the name for the 4.x standard and be proactive in taking action against anyone who uses the name or logo if their cables or ports aren't compliant. USB-IF promulgates the spec, licenses the logo and all that, they also have a suite of tests that manufacturers are to perform and submit to certify the devices. The problem is that not all manufacturers perform the tests or use the logo, so while it means USB is ubiquitous, it also has some weird behaviors in some devices that are compounded by the complexity of the USB C spec.
- bluGill 4y agoThey should trademark the connector, it was a unique design, so that can be done. Even now Congress (or your local county equivalent) could make USB the law and make anything non compliant illegal.
- gumby 4y agoThe negative impact of Postel's suggestion ("be conservative in what you send, be liberal in what you accept", AKA the "Robustness principle") is worse on end users than developers in cases like USB. USB is silently super backwards compatible. This is really good in a pinch: I need to get the data off this drive and even if it takes six hours because I only have a USB 2 cable I'm better off than if I couldn't do it at all. The problem is the opposite case for users: They have a fast USB-4 drive (potentially 40 Gbps) and a USB 4 laptop but pick up a USB-2 only cable. Hard for most people to diagnise, especially as such a cable won't have an e-marker so the laptop can't even query it. Or a slow charging cable for their device, so they fancy laptop doesn't visibly charge, or only charges overnight. Even for me these cases are hard to diagnose. And harder to understand than, say, using an inferior cable with your monitor so you et no signal at all.
- brookst 4y ago+1 I recently threw out all of my USB-C cables that are longer than a foot but can’t charge at 100w, because I decided USB-C is a primarily a charging protocol, and I’ll use wireless, short cables, or Ethernet for data transfer and HDMI for display. The matrix of charging + data speeds in USB-C is a nightmare and always resulted in having the wrong cable for the desired devices and usage.
- fastball 4y agoYou could also just buy higher quality cables, right? The problem is usually that most consumers see two USB-C cables and one is $10 and the other is $50 so they buy the $10 one, only later realizing (if at all) that the $10 only does data, or only does 50W, or w/e. But if you actually pay attention it seems like cables work as advertised with reasonable consistency, at least for me.
- guffins 4y agoThey may work as advertised, but the problem is that the cables themselves have no indication of what was advertised in the first place. The ability to know what the cable you’re holding can do is just not there. Unless you have some way of ensuring that all your cables are the same, you need to: - discard/donate every cable that you can’t identify (as @brookst did) by its eMarker (though they’re required by spec) unless you own a specialized USB-C voltmeter or multimeter - manually label every cable with all its unique specifications, either after running it through an eMarker reader or immediately after taking it out of the box
- asveikau 4y ago> "precise in what you send, flexible in what you receive" is basically evil I think it's a matter of where you apply it. For a purely software construct such as a network protocol, probably ok. For something like negotiating current and voltage where making the wrong decision can melt a cable or fry a circuit board, as stated in TFA, obviously it doesn't fly.
- Taywee 4y agoEven a purely software construct, it's evil. If you flexibly receive, then popularly wrong data becomes the new standard.
- asveikau 4y agoI feel like you are making an assumption that your flexible implementation, or a single "wrong" implementation, becomes dominant. If there are many implementations with differing amounts of perceived flexibility or wrongness in different areas, the average is going to be OK. If misunderstanding a spec is so common that many implementers are universally confused and "wrong" in the same way, maybe it's the spec that was wrong, and the misinterpretation should have been the spec. Ps. Phrasing this as "evil" contrasting with good reads to me as paranoid and melodramatic.
- Taywee 4y agoI agree with "evil" being melodromatic of a term. I was just using it for consistency. Bad behavior being eventually codified into a standard because implementations were lax and it's impossible to go back on what everybody is now already doing is the story behind much of the modern web as it exists. HTML requiring closing tags for some elements, requiring a lack of closing tags for others, and leaving the closing tag still optional for yet others is a side effect of common browser behaviors. You're right that many implementations with different wrongness smooths out the average in many cases, except when all those implementations are expected to behave the same way on the same bad data. Then they all converge to the same bad behavior, which then becomes the new standard. Perhaps that's organic and natural, but I still wish we had a world where HTML was strictly compatible with XML, or with any other structured and predictable format.
- duped 4y agoThe problem isn't the philosophy but applying the philosophy out of context. I don't want my device to be "flexible" in what it accepts when we're talking about dozens of watts fed by amperes of current into my hand or pocket. Like there's a reason that Speak-On (1) was invented. It turns out sharing a common connector for carrying power and signal can be fucking dangerous. (1) https://en.wikipedia.org/wiki/Speakon_connector https://en.wikipedia.org/wiki/Speakon_connector
- jacquesm 4y agoI've seen more than one XLR based cable go up in a puff of magic smoke, this is a nice industry response to a very real problem. Better yet if the problem isn't detected during a soundcheck. Whoever thought that using the same connector for microphones as for speakers was a good idea wasn't thinking clearly that day. Unfortunately there is still a lot of old gear floating around so you get this: https://www.bax-shop.nl/speakerkabels/klotz-scasf030-neutrik-speakon-2p-xlr-female-30-cm-speakerkabe/product-details.html https://www.bax-shop.nl/speakerkabels/klotz-scasf030-neutrik...
- duped 4y agoI've seen older stage monitors use powered TRS cables. I still see it in amp heads and cabs. Powered signals on exposed conductors. Better not touch it.
- jacquesm 4y agoOh, that must work great when you insert them and short the connectors against ground...
- duped 4y agoIt's actually not that bad since the only thing on the other end is a transducer that's already rated for a lot of current. It's just rather dangerous to have powered audio signals on exposed copper so you generally don't hot swap the things. It's not so bad for amps since the cables are very short and inaccessible, but for stage monitors you can accidentally unplug it on stage.
- brigade 4y agoOf these, I think the only one that can work solely because of an overly "flexible in what you receive" is the USB condoms, which shouldn't be encouraged in the first place. Specifically, that people wanted to charge at more than 100mA without doing real negotiation, so they ignored official USB specs came up with a variety of static or simpler negotiations that could be mimicked. The un-negotiated 20V power input is a WTF and I've never seen that before, but the typical behavior from a port not expecting that is getting fried so it's not like anyone else is being overly liberal. The extension cable works because basically all physical connections from the last 30 years or so are designed to still try to work at a degraded level with subpar signal integrity, because the world is analogue and you can't have a 100% perfect signal. The sometimes missing pins can't be required without breaking compatibility with pre-C ports that don't have them. Likewise, the male-A to female-C adapter can't really be distinguished from a male-A to male-C cable, so you can't prevent it from working without also blocking those cables. IMO the real issue is the USB-IF stubbornly refusing to allow any legit versions of an extension cable (or I guess male-A to female-C) with active circuitry to make them reliable/safe. A hub allows male-A to male-A connections and length extension after all...
- 2muchcoffeeman 4y agoI think the solution to charging from an untrusted port is a power bank. Mine will pass through power to my device if the device needs charging. If not, it will recharge itself. It's also powerful enough to recharge a tablet and I think my M2 Air. I bought the power bank from a well known brand, and I've tried charging it from different supplies. It seems to negotiate the power to charge itself correctly. And my devices just detect it as a power supply. It has wireless charging for phones too.
- brigade 4y agoThe right solution is not thinking about it at all. The only extant malicious chargers anyone has shown evidence of have been proof-of-concepts whose concept hasn't worked in nearly a decade. If you're worried about purely theoretical attacks, you should also be worried about your power bank's firmware being infected from the malicious port and subsequently infecting your phone.
- deleted 4y ago[deleted]
- ilyt 4y agoI firmly believe that if every fucker designing those standards had to provide 2 different reference implementations (say 2 different languages so idiosyncrasies don't leak into design) plus full test suite for every feature we'd be with far simpler and better working standards, coz maybe someone will realize "fuck, this is hard to implement right, maybe we should rethink it?" Instead it's yet another standard that looks like someone that fell out of the ivory tower outhouse.
- wizzwizz4 4y ago> say 2 different languages so idiosyncrasies don't leak into design Preferably, two different idiosyncratic languages. I vote Prolog and Snap! (BYOB). If you pick C and D, you'll get basically the same idiosyncrasies leaking in from both languages.
- kayfox 4y agoUSB is controlled by the USB-IF and not IEEE, if it was controlled by IEEE the standards would be much more strict and defined.
- eli 4y agoYou might as well just name it something other than USB at that point if it isn’t going to be backward compatible.
- nine_k 4y agoThe Postel's suggestion works because it's profitable for the device makers. Be strict at what you send, as much as you can. This maximizes the probability of your widget working with everything else. Be lenient in what you accept, and your widget will likely work with everyone else's widgets, even if everything else's ideas of the correct protocol slightly diverge. Following the two approaches makes your widget more compatible than a strictly-adherent, inflexible widget your competitor might produce. The more compatible your widget is, the fewer unhappy customers you have: it fails to work in fewer cases that a strictly-adherent widget would. It may not work ideally in every case, but it may work well enough for the customer to keep it, or even for you to deny a refund. With low-price items like cables, it again plays into the cable maker's hand: all the various cables are okay because they demonstrably work (not "broken"), but now you can differentiate between very cheap cables that can do little but suffice in simple cases, and premium cables that offer high speed, high power, etc. You can put a cheap cable into a toy as a charging-only low-power cable and save the all-important few cents. You can charge $29.99 for a cable that can do it all™, for customers annoyed by cheap underperforming cables (which they also bought from you!), who decide to finally splurge on the real thing. A world where there'd be one and only maximalist format, and where the smallest deviation from it would render a device / cable useless, would be (even) more painful for the customer, more expensive, and with some more preice-sensitive segments underserved. The variability that follows from the "be lenient to what you receive" corresponds to the need to serve many varied market segments. Sorry!