36

I have a Win 10 64-bit HP laptop (model: 15-dw0088ca) which has 1 USB-C port and two USB ports.

  1. Can I use an ordinary USB-C ↔ USB-C cable, like the one in Pic 1, to transfer files from this HP computer to another one that also has an USB-C port?

    simplex1_0-1633888143587.jpeg

    Pic 1: USB-C ↔ USB-C cable.

  2. Can I use an ordinary USB-C ↔ USB cable, like the one in Pic 2, to transfer files from this HP computer to another one that only has USB ports (no USB-C port)?

    simplex1_1-1633888328047.jpeg

    Pic 2: USB-C ↔ USB cable.

Remark: I know that, with some software, files can be transferred from one PC to another using a special USB ↔ USB cable like this one:

simplex1_2-1633888514559.jpeg

PC to PC data transfer cable (which I do not have).

Various sites say that using an ordinary USB ↔ USB cable for PC to PC data transfer is not a solution. I do not really understand why as long as ordinary cables like: USB ↔ Micro-USB, USB ↔ USB-C, USB-C ↔ USB-C can be used for transferring files between a mobile phone and a PC.

Note:

There is a similar question (Is it possible to connect two PCs via USB C?) but the answers there are a bit speculative. This is an example:

So, if you have two computers with USB-C ports, and a USB-C cable, then the chances are that all the hardware is there to make a 20 Gbps connection between the two. All it takes is one computer to have the right software to support a network device on a USB-C port, and the other to have the right software to emulate a network device on a USB-C port.

It is not clear from the above excerpt whether an USB-C ↔ USB-C connection between two computer, with an ordinary cable (not a data transfer cable), is possible. Also, there is no answer regarding the USB-C ↔ USB data transfer.

phuclv
  • 26,555
  • 15
  • 113
  • 235
Robert Werner
  • 555
  • 2
  • 6
  • 11
  • 1
    Does this answer your question? [Is it possible to connect two PCs via USB C?](https://superuser.com/questions/1215710/is-it-possible-to-connect-two-pcs-via-usb-c) – MMM Oct 11 '21 at 12:37
  • @MMM , The answers there are a bit speculative. they are not quite clear. I quote from an answer: "So, if you have two computers with USB-C ports, and a USB-C cable, then the chances are that all the hardware is there to make a 20 Gbps connection between the two. All it takes is one computer to have the right software to support a network device on a USB-C port, and the other to have the right software to emulate a network device on a USB-C port." – Robert Werner Oct 11 '21 at 12:40
  • 2
    "ordinary cables ... can be used" Only if transfer's enabled in the phone. In that case the phone basically presents itself to the PC as an external drive or a controllable device. PCs don't have the facility by default. What the answer you quoted refers to is [Ethernet-Over-USB](https://en.wikipedia.org/wiki/Ethernet_over_USB), in which case your PCs see the USB ports as network interfaces, and data transfer is done with network protocols and data transfer tools. – Peregrino69 Oct 11 '21 at 12:52
  • It will be helpful if someone can explain to me the purpose of that convertor which can be seen in the middle of the PC to PC data transfer cable (the last of the three pictures I posted). – Robert Werner Oct 11 '21 at 12:52
  • 5
    Note that what you call "USB" is actually the USB-A connector. – Paŭlo Ebermann Oct 11 '21 at 22:16
  • 2
    @RobertWerner That converter emulates two network adapters, one for the device on each end. – David Schwartz Oct 13 '21 at 00:13
  • 1
    Save yourself the hassle and use an external hard drive or flash drive. The other alternative is over either wifi or ethernet, but I'm not sure how familiar you are with network config. – David Ehrmann Oct 13 '21 at 04:36
  • Linux can do it (albeit not with a point-and-click configuration); Windows could if someone wrote the requisite drivers, but it's unlikely. – hobbs Oct 13 '21 at 15:40
  • While your question is somewhat different from the earlier question (you ask about file transfer), none of the answers address that points and all are worse than the accepted answer on the linked question (which does not have the speculative statements you quoted, but is quite factual) – Ben Voigt Oct 13 '21 at 17:21
  • @Robert Werner I agree with David Schwarz, but I would want to see the vendor and product id, as well it might modify the protocols so only their proprietary software works, a defacto licensing dongle. But a face to face USB to Ethernet is likely, certainly faster than UART. Of course it only has to present as a network interface, you could likely Frankenstring one yourself between port "replicators". – mckenzm Oct 13 '21 at 23:02

5 Answers5

39

USB-C gets rid of the physical USB-A/B distinction and instead allows the two ends to negotiate to work out which acts as computer and which as a device.

However, connecting two USB-C desktops together with a USB-C cable, although physically possible, still ends up with one end being required to act as a device. Most computers don’t usually have software (or hardware) allowing them to act as devices, although it is possible to install such software. Then it all depends on this software.

This is why for generic USB-C you still need a PC-to-PC data transfer cable, that acts for both computers as a device so both computers can act as hosts, which Windows does well. Unless the transfer cable can emulate a network adapter for both hosts, you will also need a specialized software for the transfer of data.

USB-C can also be used for Thunderbolt 3, and if both computers have this then connecting them together with a USB-C cable results in a 10Gbps network link between the two. Thunderbolt 3 has this networking capability built in, rather than requiring adapters or special software. You can even use this capability to daisy chain together multiple PCs into a high speed LAN without requiring a switch, as long as the intermediate PCs each have two Thunderbolt 3 sockets, taking advantage of the Thunderbolt 3 built-in daisy-chaining capability.

Without Thunderbolt 3, the best bet is to do the transfer via a common router. You may also connect the two computers directly via an Ethernet cable to create a local network. Modern Ethernet adapters do not even need a crossover cable.

harrymc
  • 455,459
  • 31
  • 526
  • 924
  • 36
    I think it should be noted how utterly insane it is that an ordinary user can't practically transfer files between two computers by linking them with a physical cable, whether USB or ethernet. – iono Oct 13 '21 at 14:28
  • 5
    "Most computers don’t usually have software allowing them to act as devices" - this is a deep misconception. To act as USB device, the computer must have a dedicated hardware block, and means to control host-device data flows/muxes. Which is absent in most/all desktops. "Just software" cannot make a USB host controller into "device controller", hardware functions are fundamentally different. And there is no logical model of host-to-host connection in USB3 and older. The concept is introduced only in USB4. – Ale..chenski Oct 13 '21 at 17:58
  • 5
    @iono It works just fine with Ethernet. Both computers will get an APIPA address and if you answer "yes" to the prompt Windows gives you about making your computer discoverable to other computers on the network you can share files. Other OSes have other file-sharing options (like scp), but it's basically the same. – 9072997 Oct 13 '21 at 22:02
  • @9072997: You still need a special "crossover" ethernet cable, though - the ethernet cables you can buy at the hardware store are essentially all patch cables, which work for connecting computers to a router, but _not_ directly to each other. – Vikki Oct 13 '21 at 23:37
  • 11
    @Vikki - not for many years already you don't. Auto MDI-X takes care of crossover inside the network interface. – brhans Oct 13 '21 at 23:51
  • 2
    @iono it was/is possible with serial cables and ethernet cables or any other kind of network cable (firewire). USB just isn't a Network standard and needs a clear host/client relationship, beginning at the hardware level... – Robert Riedl Oct 14 '21 at 10:41
  • @iono When you think about it a little bit deeper you realize it would be a special system *only* for connecting two computers together, so it's not too surprising it doesn't exist yet. All the "usual" connections are somehow different from the one want to have in this case. – user253751 Oct 14 '21 at 12:17
  • @iono Define "ordinary user"? I mean, the answer does state "connect two computers with ethernet, form a network, transfer files" as a solution. – Yakk Oct 14 '21 at 14:57
  • @9072997 what percentage of all the people in the world who use a computer every day do you think even knows what an "APIPA address" is? I took a 1.5 years of CS at university, and I've never seen that term before. Please use your brain and try to consider the existence of other human beings before trying to "correct" someone, in case you miss the point entirely like this. – iono Oct 19 '21 at 09:00
  • @iono you don't have to know what it is; It just happens. I was explaining HOW it works, but the end user doesn't need to know that. The end user experience is pretty manageable. Not as nice as say, Air Drop, but not bad. – 9072997 Oct 19 '21 at 14:05
  • @Ale..chenski " And there is no logical model of host-to-host connection in USB3 and older. The concept is introduced only in USB4. " The original USB 3.0 spec in 2010 specified that a USB-A to USB-A cable meets the spec. This is to allow host to host communications. I found mention of this in section 4.10.1.1.2 of the USB 3.0 cable and connector compliance document. I'll link to the document here: https://usb.org/sites/default/files/CabConn_3_0_Compliance_Document_20101020.pdf This is not new, it's just not widely supported. – MacGuffin Oct 19 '21 at 22:47
19

Can I use an ordinary USB-C <-> USB-C cable, like the one in Pic 1, to transfer files from this HP computer to another one that also has an USB-C port?

As far as I know: only if both ports are Thunderbolt or USB4 ports, and if the operating system on both ends supports "IP over Thunderbolt" (or really Ethernet over Thunderbolt). This is available in macOS, Linux, and apparently supported in Windows 10 as well. If it is supported, the connection would show up as a new LAN interface through which you could use SMB or other network file transfer software.

Unfortunately, it seems that your laptop's USB-C port only supports USB (3.2 Gen 1x1) but not Thunderbolt.

With just USB, it would in theory be possible with USB-C for either end to act as either role (USB host vs USB peripheral), but as far as I know, laptops typically do not support this – only smartphones tend to be dual-role, while computers are always hosts.

(Note that the ability to switch USB roles for data transfer seems to be completely independent from the ability to change power supply direction in USB Power Delivery.)

Can I use an ordinary USB-C <-> USB cable, like the one in Pic 2, to transfer files from this HP computer to another one that only has USB ports (no USB-C port)?

Same as above, excpt the device on the USB type-A side is always a USB host, so the HP laptop on the USB-C side is specifically the one which would need to support role switching.

(Finally, if one of the devices supported USB peripheral mode aka USB OTG, like a Raspberry Pi with its USB OTG-capable "dwc2" chip, it could pretend to be a network interface or a storage device – but only Linux has so-called "gadget" drivers implementing this; Windows doesn't.)

It will be helpful if someone can explain to me the purpose of that convertor which can be seen in the middle of the PC to PC data transfer cable (the last of the three pictures I posted).

Regular USB A-to-A connections are not allowed. The 'A' port is always on the USB host, and you cannot connect together two USB hosts. If you tried to make such a direct cable, you'd probably fry one of the USB controllers.

(Micro-B ports on phones and some RPi models are wired to special controllers which can act as either host or peripheral, and the Micro-B port itself has an extra pin to indicate this – which full-size A/B ports did not.)

So what you (usually) have with this cable is not an A-to-A connection between the PCs, but two fairly standard A-to-B connections to the box in the middle which acts as a USB peripheral on both sides. They're a lot like if you had two "USB-to-Ethernet" adapters connected back-to-back.

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
  • 2
    For Macos, you have to boot one of the computers into "[target disk mode](https://support.apple.com/guide/mac-help/transfer-files-mac-computers-target-disk-mode-mchlp1443/mac)". – Christopher Schultz Oct 11 '21 at 21:54
  • @ChristopherSchultz: If you want raw access to the disk over SCSI, then yes, but that's a separate feature from networking over TB/FW. – u1686_grawity Oct 12 '21 at 04:44
  • " you'd probably fry one of the USB controllers." USB, even the early generations, is quite robust. Since the voltage will be capped at 5V, nothing will fry. It won't work, but the worst-case scenario is that you might need to powercycle both PC's. – MSalters Oct 12 '21 at 07:24
  • @MSalters maybe. Backfeeding power into a power supply (because of a random 0.05 volt difference) doesn't seem like a good idea. – user253751 Oct 12 '21 at 08:39
  • 2
    I've had powered USB hubs that lacked diodes, causing them to backfeed the USB port when no load is applied. The computer didn't actually notice unless the USB port was supposed to be unpowered (at boot or sleep), at which point it turned the thing off for safety reasons. – AI0867 Oct 12 '21 at 12:23
  • Aren't all USB-C ports also Thunderbolt ports? – Vikki Oct 13 '21 at 23:38
  • 2
    @Vikki: They use the same connector, but no, Thunderbolt is a separate packet protocol. It can encapsulate USB traffic, or PCIe traffic, or [IP directly for IP-over-Thunderbolt](https://en.wikipedia.org/wiki/Thunderbolt_(interface)#Vulnerability_to_DMA_attacks). See [this diagram and description from wikichip re: Ice Lake's Thunderbolt](https://en.wikichip.org/wiki/intel/microarchitectures/ice_lake_(client)#Thunderbolt_IO_subsystem), and also note the difference between raw Thunderbolt 3 bandwidth (40 Gbit/s) vs. PCIe3 x4 (32.4 Gbit/s) and/or DisplayPort (34.56 Gbit/s) with aggregate 40 max – Peter Cordes Oct 14 '21 at 02:01
  • " Regular USB A-to-A connections are not allowed. " Host to host communications by USB is allowed, it's been in the spec since USB 3.0 in 2010. Microsoft has documentation on how to get this setup for kernel debugging on hardware that lacks serial, Ethernet, or other previously common ports for host to host connectivity. That is a rare use case and other cases would appear to be even rarer. Theoretically someone could write software to setup the ports and transfer something other than kernel logs. – MacGuffin Oct 19 '21 at 22:56
  • @user1686 " If you want raw access to the disk over SCSI, then yes, but that's a separate feature from networking over TB/FW. " Target disk mode is for more than just SCSI, and clicking on the link provided by Christopher Schultz would show that. It is separate from networking by Thunderbolt, FireWire, or whatever but it is an option on Apple computers without SCSI ports. – MacGuffin Oct 25 '21 at 00:22
  • @MacGuffin: I'm not talking about physical ports. "Target disk mode" uses the SCSI *command set* over FireWire, just like how USB disks use the SCSI command set over USB. – u1686_grawity Oct 25 '21 at 06:14
3

For you, (un)fortunately, answer boils down to this: get an USB-C/USB-C cable and try. You may have to be careful, though, as Austin Hemmelgarn points out there may be significant voltage difference between laptops, which may not be mitigated by internal protection of the USB port... Modern laptops aren't grounded at all, so you may have to either get a dedicated USB grounding cable (believe it or not, but apparently this is a big issue in USB, especially for people working with sound on their laptops, and they worked it out ages ago), or makeshift something.

To connect two PCs via USB for data transfer - besides using Bridged USB-A/USB-A cable that has some extra board added, which you don't have - you have few possibilities available:

  1. Use USB-C/USB-C cable. But it also requires for at least one port to be DRD (Dual-role-Data) port. It is part of the USB-C standard already, so basically, it depends on the actual, physical build of the port(s) you have in your laptop(s). Had one of your computers be a Mac of newer design, answer would be yes, as Apple makes all it's USB-C ports as DRD for a few years now.

  2. I think you could also achieve what you need with USB-A/USB-A cable, but again, at least one port needs to be DRD and of course it is, I believe, USB3 or higher feature (But please don't quote me on this, I'm not 100% on that).

  3. Technically, you could to that too with any USB cable provided one of the devices is OTG (OTG is basically DRD, but I think those differ in implementation, so same functionality, different port build), but same condition applies: not 100% sure. Also, not sure if OTG is purely hardware, or it needs also software to work properly (which means drivers in your case).

AcePL
  • 1,680
  • 1
  • 11
  • 20
  • ‘provided a quality cable is used’ and provided you have a unified ground plane, which is not a given in this case. Laptops _usually_ have a floating ground, and it is not unusual for it to have a nontrivial voltage difference from a true ground. A discharge from shorting the floating ground to a true ground shouldn’t actually damage anything, but I would not bet on it unless both computers involved are trivially replaceable. – Austin Hemmelgarn Oct 12 '21 at 13:06
  • @AustinHemmelgarn Good point. And if laptop is on the newer side not even connecting to a charger will ground it... Though this has been addressed in USB-C standard, it may not be enough. Wow, this is getting interesting. What do you think - power down both laptops, connect them and then power them up? That or grounding USB ports, but that requires a pass-through connector, possibly on even both of them... – AcePL Oct 12 '21 at 13:55
  • 1
    Note that one of the requirements of USB C was that any possible connection does not cause damage, so you don't need to be careful (assuming proper implementations, which when should assume or else undefined behaviour happens) – Ferrybig Oct 12 '21 at 16:59
  • @Ferrybig That’s one the two things I would not blindly assume is properly implemented if trying something like this (the other is cable orientation handling, I’ve seen supposedly certified devices that don’t do that correctly), especially given that I’ve seen static discharge fry older USB ports on occasion. – Austin Hemmelgarn Oct 12 '21 at 21:01
  • @Ferrybig But that's the issue that's inherent in USB, regardless of the iteration. Technically it's even worse in -C, because of order of magnitude more power supplied. This problem is long known in industrial devices (USB-connected, but with own high-power supply), in audio industry where USB grounding is a given... This scenario - two ungrounded laptops connected via USB-C- is technically within implementation spec, but in this case EVERYTHING must work perfectly and even then it may not be enough. Electricity is a bit unpredictable gift to humanity. – AcePL Oct 13 '21 at 06:52
  • @AustinHemmelgarn - frying an USB port is, unfortunately, almost inevitable in USB tech... That's why I always prefer system with more USB ports - more redundancy. But in certain cases that static discharge would fry southbridge, and then you're really screwed. – AcePL Oct 13 '21 at 06:57
  • 1
    @AcePL Even though USB has a higher power limit, the specification only allows up to 7.5W without proper negoation, and USB C ports must be protected in voltage in either direction until the role has been establised. (sinks excluded) People connecting chargers to each other or other invalid combinations has been part of the standard of allowing cables with the same plug, it also requires ground and power to mate before any signal cables – Ferrybig Oct 13 '21 at 07:00
  • 1
    @Ferrybig - All you said is true, and it's true since at least USB2 (in general, of course -C is more advanced and better), and yet it's still a problem. Have you seen the details on grounding implementation of the USB-C standard, which I linked in my answer? Austin asks you a question: would you be willing to bet your two laptops on "it should work, because standard says so"? His point (and I agree) is that with two laptops the probability the connection's power and ground DIFFERENCE to be too much for the circuitry to compensate. There's only so much 10 nanoFarad capacitor will take... – AcePL Oct 13 '21 at 07:23
  • 1
    @AustinHemmelgarn: Computers regularly connect to other devices that have their own power-supplies over USB-C (examples: printers, monitors, phones, Arduino's, external-drives). If the other device having its own power-supply isn't a problem in those cases, why might it be a problem if the other device is a PC? – Nat Oct 13 '21 at 17:09
  • 4
    @Nat: Because self-powered USB devices don't connect USB VBUS pin to their internal power supply. USB hosts do. – Ben Voigt Oct 13 '21 at 17:16
  • 1
    @BenVoigt: Thanks! The last paragraph in [this answer](https://electronics.stackexchange.com/a/314188/136119) seems to suggest USB-C might be different, though it sounds like a device that'd assume itself to be a host might still try to peg VBUS to 5V upon detecting a cord? In other words, the problem's basically that two PC's linked by USB-C might just automatically try to set the voltage of the USB-C cord's VBUS to what each of them consider +5V, which may not match? – Nat Oct 13 '21 at 17:22
  • 3
    @Nat: If things are working right, then with USB-C both hosts will detect no peripheral device and neither one will turn on VBUS. But a damaged (or poorly-made) cable could trigger turning on VBUS at both ends... People have definitely burned up USB-C ports by using knockoff cables. – Ben Voigt Oct 13 '21 at 17:30
3

It's possible, but it would require different drivers to the ones that most computers normally use, for the particular port that you are going to be using for this purpose. Such software is not widely available and would probably be a PITA to set up.

In practical terms I'd plug both computers together with Gbit Ethernet and transfer data between them using the existing networking software. The minimum hardware requirement (for those living on a desert island), is one cross-over Ethernet cable. If you have a computer with no wired Ethernet port, get a USB3 (or USB2) Ethernet "dongle", or use wireless through your router. Wireless is pretty fast these days if you put the wireless computer close to a sufficiently capable router.

I once saw a USB data-exchange cable rather like the photo in the question, with a plastic lump in the wire and some rather bogus Windows software. Out of interest I plugged it into a Linux computer, which revealed the plastic lump to contain two USB-Ethernet NICs connected together! So basically, an expensive way to avoid having to learn how to configure one's networking software at all.

nigel222
  • 257
  • 1
  • 3
  • 3
    You do not need a special cross-over cable for gigabit (and everyone has gigabit these days). Any old Ethernet cable should do fine. – user253751 Oct 14 '21 at 12:26
2

This is a lengthy addendum to the answer by @nigel222, too lengthy to have as a comment.

It is possible to transfer data by USB A-to-A, C-to-A, or C-to-C, using the USB 3.x protocol. The process is a pain in the ass and only documented for use by kernel and driver developers, not even the typical software developer is expected to have to do this. If the USB-C ports in question support Thunderbolt then that's a different question, connecting computers by Thunderbolt will create an Ethernet-like network connection which makes the process trivial for all but the newbiest of newbs.

Using two USB-Ethernet adapters and an Ethernet cable is an option, and would be as trivial as if using Thunderbolt. No need to seek out a crossover cable for this as any Ethernet adapter capable of gigabit speed (and all but the cheapest will do this) are able to auto-negotiate the crossover. Unless paying out top dollar for a pair of 10-Gbps adapters this means being limited to 1 Gbps, far below what USB-C is capable of offering on a direct connection.

There are USB-to-USB bridge cables that offer 5 Gbps speeds. This is an improvement not only in speed but often in costs. As nigel222 discovered the chip in the cable is capable of emulating an Ethernet connection. What I discovered is that this chip has a serial port emulator mode too. When used with the horrible software these cables come with the cable is in a non-network mode, some kind of serial transfer mode. The Linux drivers for this cable will be default put the cable in a network mode and I suspect will allow an Ethernet-like connection between two Linux computers. How to get this in a network mode for macOS and Windows is anyone's guess, and if able to be put in this mode it should appear as an Ethernet port in the OS network settings.

So, it is possible to connect two computers by USB for file transfer but so far this is left in the realm of low level programmers. There's work arounds for us mere mortals but none are exactly pretty, or fast. They are not difficult, just not ideal as they involve extra hardware and slow down the connection with this same hardware that would not have to be there if someone wrote software to make this easier.

Some tablet computers and phones have the software for an easy transfer of files to a PC by a USB-C cable. There is nothing special about the hardware that enables this function, it is all software with an off the shelf USB-C controller that is common in many laptop and desktop computers. My guess that this is not a ubiquitous feature because there are still plenty of USB-C controller chips out in the wild that do not support peer-to-peer functionality and the people that have to answer the phones on user complaints would rather just sell you a $50 data transfer cable than try to explain the difference between USB-C controllers.

MacGuffin
  • 1,246
  • 5
  • 13
  • Totally wrong answer regarding USB Type-C ports. You apparently have no idea what the "off the shelf USB-C controller" could be. You must be confusing "debug function" of a USB port with something else. I repeat: to have Dual-Data-Role function, the port hardware must have a separate "device controller" in hardware, switchable with "host controller" (xHCI) over internal or external multiplexor. Period. Please stop confusing public with your wishful thinking. – Ale..chenski Oct 26 '21 at 15:55
  • 1
    @Ale..chenski I agree that to have a dual role port there must be extra hardware but peer-to-peer communication by USB does not require a dual role port. Microsoft wrote out the requirements for peer-to-peer communications in their USB kernel debug setup and dual role ports are not required. Here's that document: https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/setting-up-a-usb-3-0-debug-cable-connection The means to communicate peer-to-peer by USB 3.x is built into Windows but must be set up manually. This is not trivial but also does not require dual role ports. – MacGuffin Oct 26 '21 at 20:03
  • I think the issue is in differences in interpretation of what the "peer-to-peer" communication is. Yes, there is an auxiliary debug mode defined, and implemented in almost all xHCI. It defines "debug port" and a special (and pretty slow) access to MS debug structures. It is a far cry from normal USB access to system (both on host side and inside USB devices), which is normally done over fast DMA. I am sure some hackers can re-purpose the debug port (or scratchpad registers or whatever is there) into some sort of system access and make it to transfer blocks of data, but it will suck. – Ale..chenski Oct 27 '21 at 02:38