Remix.run Logo
Aardwolf 6 days ago

I wonder why it's not standard that you can simply connect two PC's to each other with a USB cable and have them communicate/transfer files. With same protocol in all OSes, of course. Seems like it should have been one of the first features USB could have had since the beginning, imho

I know there's something about USB A to USB A cables not existing in theory, but this would have been a good reason to have it exist, and USB C of course can do this

Also, Android to PC can sort of do it, and is arguably two computers in some form (but this was easier when Android still acted like a mass storage device). But e.g. two laptops can't do it with each other.

felurx 6 days ago | parent | next [-]

You actually can connect two machines via USB-C (USB4 / Thunderbolt) and you get a network connection.

You only get Link-Local addresses by default, which I recall as somewhat annoying if you want to use SSH or whatever, but if you have something that does network discovery it should probably work pretty seamlessly.

See https://christian.kellner.me/2018/05/24/thunderbolt-networki... or https://superuser.com/a/1784608

userbinator 6 days ago | parent | next [-]

You only get Link-Local addresses by default

The same thing happens with two machines connected via an Ethernet cable, which appears to be what this USB4 network feature does - an Ethernet NIC to software, but with different lower layer protocols.

dwattttt 6 days ago | parent [-]

Crossover cables, get'cher crossover cables here!

deathanatos 5 days ago | parent [-]

AIUI, most NICs these days do what is called "auto-crossover"; i.e., they'll detect the situation and just do the "crossover" in the NIC itself. A normal cable works.

fodkodrasz 5 days ago | parent [-]

Yes, the name is Auto MDI-X and is standard since on-board 1Gbps Ethernet NICs became the norm.

https://en.wikipedia.org/wiki/Medium-dependent_interface#Aut...

Dagger2 4 days ago | parent | prev | next [-]

ssh is fine:

  ssh fe80::2%eth0
where fe80::2 is the peer's address, and eth0 is the local name of the interface they're on.

Unfortunately browsers have decided that link-local is pointless and refuse to support it, so HTTP is much more difficult.

grishka 6 days ago | parent | prev [-]

Non-USB-shaped older Thunderbolt, down to version 1, can do this too, iirc. But you do need the expensive and somewhat rare cable.

clearleaf 6 days ago | parent | prev | next [-]

The incredible technology you're describing was possible on the Nintendo DS without wires and no need for a LAN either. It's a problem that's been solved in hundreds of different ways over the last 40 years but certain people don't want that problem to ever be solved without cloud services involved.

This dumb pipe thing is certainly interesting but it will run into the same problem as the myriad other solutions that already exist. If you're trying to give a 50MB file to a Windows user they have no way to receive it via any method a Linux user would have to send it unless the Windows user has gone out of their way to install something most people have never heard of.

deathanatos 5 days ago | parent | next [-]

> It's a problem that's been solved in hundreds of different ways over the last 40 years

If we put the requirements of,

  1. E2EE
  2. Does not rely on Google. (Or ideally, any other for profit corporation.)
That eliminates like 90% of the recent trend of WebRTC P2P file transfer things that have graced HN over the last decade, as all WebRTC code seems to just copy Google's STUN/TURN servers between each other.

But as you say,

> but certain people don't want that problem to ever be solved without cloud services involved.

ISPs seem to be that in set. IPv6 would obsolete NAT, but my ISP was kind enough to ship an IPv6 firewall that by default drops incoming packets. It has four modes: drop everything, drop all inbound, a weird intermediate mode that is useless¹, and allow everything.

(¹this is Verizon fios; they claim, "This feature enables "outside-to-inside" access for IPv6 services so that an "outside" Internet service (gaming, video, etc.) can access a specific "inside" home client device & port in your local area network."; but the feature, AFAICT, requires the external peer's address. I.e., I need to know what my roaming IP will be before I leave the house, somehow, and that's obviously impossible. It seems utterly clearly slapped on to say "it comes with a firewall" but was never used by anyone at Verizon in the real world prior to shipping…)

genewitch 5 days ago | parent [-]

starlink doesn't even give you publicly routable ipv6 unless you bypass the starlink router.

My starlink is such that i cannot install/set up things like pfsense/opnsense because the connection drops sometimes, and when either of those installers fail, they fail all the way back to "format the drive y/n?" Also, things like ipcop and monowall et al don't seem to support ipv6.

I looked in to managing ipv6 from a "i am making my own router" and no OS makes this simple. i tried with debian, and could not get it to route any packets. I literally wrote the guide for using a VM for ipcop and one of the "wall" distros; but something about ipv6 just evades me.

deathanatos 5 days ago | parent [-]

> starlink doesn't even give you publicly routable ipv6 unless you bypass the starlink router.

If you've not got an Internet[-routable] address, are you truly connected to the Internet?

> I looked in to managing ipv6 from a "i am making my own router" and no OS makes this simple. i tried with debian, and could not get it to route any packets. I literally wrote the guide for using a VM for ipcop and one of the "wall" distros; but something about ipv6 just evades me.

TBH, I would think that this is just enabling v6 forwarding. That wouldn't do RA or DHCP, I don't think, but I don't think you'd want that, either. (That would be the responsibility of the upstream network.)

Dagger2 2 days ago | parent | next [-]

You would want that. The upstream network can't do it for you, because RAs can't be routed. Same deal for DHCPv6 (although personally I'd say you can probably skip that and just use SLAAC).

genewitch 4 days ago | parent | prev [-]

in order to have public ipv6 on starlink you need to manage the /56 they delegate to you into however many /64s that is (at least 8); i tested it with a store bought router, everything worked if you can do PD with DHCP[v6] or whatever. I returned the router because it was $200 and i will eventually figure it out on a VM.

Dagger2 2 days ago | parent [-]

It's pretty simple with systemd-networkd:

  # On the upstream network.
  [Network]
  DHCP=yes
  [DHCPv6]
  PrefixDelegationHint=::/56

  # On each downstream network.
  [Network]
  IPv6SendRA=yes
  DHCPPrefixDelegation=yes
If you don't want systemd-networkd, look at https://wiki.debian.org/IPv6PrefixDelegation#Using_ifupdown_.... Firewalling is the same as v4, just without the NAT.

One frustrating part is that as far as I can tell nothing supports easy downstream DHCPv6-PD delegation, so machines on the downstream network that want their own prefix won't be able to get one automatically. OpenWRT's network config daemon supports it, but nothing on regular Linux does.

> however many /64s that is (at least 8);

256!

loloquwowndueo 6 days ago | parent | prev | next [-]

Pairdrop.net - no need to install anything, transfers go over the local network if both devices are in a LAN.

elliotec 6 days ago | parent | prev | next [-]

I mean, windows users install things they’ve never heard of all the time.

If this was a real thing you needed to do, and it is too much work to get them to install WSL, you could probably just send them the link to install Git and use git bash to run that curl install sh script for dumbpipe.

And if this seemed like a very useful thing, it couldn’t be too hard to package this all up into a little utility that gets windows to do it.

But alas, it remains “easier” to do this with email or a cloud service or a usb stick/sd card.

kovek 6 days ago | parent | prev [-]

> It's a problem that's been solved in hundreds of different ways over the last 40 years

I guess now you can find the solution that you need by telling the requirements to LLMs who have now indexed a lot of the tradeoffs

userbinator 6 days ago | parent | prev | next [-]

USB is asymmetric - there's a host and a device, and the latter acts as a polled slave.

The use-case of a wired connection between two PCs was already solved years before USB --- with Ethernet.

genewitch 5 days ago | parent [-]

there are USB 2.0 (and probably 1.x) devices with usb-A on both sides and a small box in the middle that acts as a network crossover between two machines, i've seen them in stores. I've never used one because i know how to set CIDR. And, as others have mentioned, this does just work with usb-c.

jrm4 5 days ago | parent | prev | next [-]

Like so many possible networking/connection nice things that we can't have, you really can directly blame this one on "the companies."

Brought to you by the same people that made "peer-to-peer" a dirty word.

1vuio0pswjnm7 6 days ago | parent | prev | next [-]

"I wonder why it's not standard that you can simply connect two PC's to each other with a USB cable and them communicate/transfer files."

After TCP/IP became standard on personal computers, I used Ethernet crossover cable to transfer large files between compuers. I always have some non-networked computers. USB sticks were not yet available.

Today the Ethernet port is removed from many personal computers perhaps in hopes computer owners will send ("sync") their files to third party computers on the internet (renamed "the cloud") as a means of transferring files between the owner's computers.

Much has changed over the years. Expect replies about those changes. There are many, many different ways to transfer files today. Expect comments advocating those other methods. But the crossover cable method still works. With a USB-to-Ethernet adapter it can work even on computers with no Ethernet port. No special software is needed. No router is needed. No internet is needed. Certainly no third party is needed. Just TCP/IP which is still a standard.

1vuio0pswjnm7 5 days ago | parent | next [-]

https://www.xda-developers.com/reasons-wi-fi-never-better-th...

1vuio0pswjnm7 5 days ago | parent | prev | next [-]

https://news.ycombinator.com/item?id=29713322

loloquwowndueo 6 days ago | parent | prev | next [-]

> Today the Ethernet port is removed from many personal computers

Pretty sure one can set up an ad hoc wifi network for this.

efreak 3 days ago | parent | next [-]

Not on Windows 11 you can't. They removed that for...reasons. They also removed the lovely hosted network that was added with 7 (Vista?) so now you can't network two modern Windows devices without something else (physical cable, or a non-Windows or older Windows device for hosting a network). Stuck with a low speed Wi-Fi router and USB 2 cables? It's gonna take you hours to make that one-time 200gb transfer, unless you wanna drag it down the stairs (the only USB 3 cables I own are mini USB 3 cables for use with an older external hard drive that I no longer own, all my USBC cables are USB 2/PD only...I think...).

deathanatos 5 days ago | parent | prev [-]

One … can. I have a script for this myself, but I only set that up after wanting to do ad hoc and then realizing that it was basically impossible to do from scratch. Ad hoc requires an Internet connection to download the knowledge necessary to do ad hoc, and that utterly defeats the point of it all. (Except in how I've now cached that into a script.)

Ad hoc requires the machines be in "WiFi shouting range".

hoherd 5 days ago | parent | next [-]

I was about to talk about how online help files are forgotten these days, and should guide you to the right information to set up an ad-hoc network, but I was disappointed three times over by macOS.

macOS does not have any offline documentation like pretty much every OS used to. When I turn off my WiFi and then open "Mac User Guide" or "Tips for your Mac", they both tell me they require an internet connection.

When I re-enable my internet connection, neither of those apps have information about how to set up an ad-hoc wifi network.

When I looked up how to create an ad-hoc network in other sources, I discovered that the ability to create an ad-hoc network was apparently removed from the GUI in macOS 11, and now requires CLI commands.

I hate how modern tech companies assume that everybody always has access to a high speed internet connection.

userbinator 5 days ago | parent [-]

I hate how modern tech companies assume that everybody always has access to a high speed internet connection.

I suspect it's deliberate, especially when said company also sells cloud services.

loloquwowndueo 5 days ago | parent | prev | next [-]

Oh so you bought two computers at a store with the operating system preinstalled and have never connected them to the Internet? And you have no Internet access whatsoever to look things up for your two 100% air gapped computers?

I’m not buying it.

deathanatos 5 days ago | parent [-]

That's sort of a disingenuous phrasing, but yes. I'm not thinking of them as "air gapped", since I'm intentionally attempting to form an ad hoc WiFi network between them, but yes, until two laptops are connected over a network, yeah, they're effectively "air gapped" I suppose.

They have normal, consumer OSes on them. Whatever one might reasonably already have preinstalled.

I'm sitting at an macOS machine presently. If I poke around the Wi-Fi menu, and the Wi-Fi settings … IDK, I come up empty handed.

So let's cheat, and Google it. But the entire point of my post above is that needing to Google it defeats the point; if I have an Internet connection (which would be required to Google something) — I can just network the various machines using that Internet connection. In every situation I've wanted to form an ad hoc network, it is because I do not have any access to the Internet, period, but I still have the need to network two machines together.

Anyways, Gemini's answer:

> To set up an ad-hoc Wi-Fi network on macOS, you can use the "Create Network" option in the Wi-Fi menu.

Apparent hallucination, since there is no such menu item.

The first result says the same thing:

> 1. Click the wifi icon on the menu bar. 2. Click “Create network. . .”

(… I suppose I see where the training data came from).

The next result is a reddit thread; the thread is specifically about ad hoc WiFi. The only answer is a link to a macOS support article; that article tells us to go to General → Sharing, and use "Internet Sharing". But AFAICT, that's for sharing an existing WiFi connection over a secondardy medium: i.e., if you have WiFi, you could share that connection over a TB cable, or some other wired medium. And "To Devices Using" conspicuously lacks "also over WiFi", or similar. I.e., this also isn't what we're looking for.

The rest of the results are mostly all similarly confused, and I've given up.

So even if I had Internet, … I still can't do it. So if I'm actually in a situation where I need an ad hoc, it definitely isn't happening.

loloquwowndueo 5 days ago | parent [-]

> if I have an Internet connection (which would be required to Google something) — I can just network the various machines using that Internet connection

Wow, tell me you don’t know how computer networks work without telling me you don’t know how computer networks work.

I think we are done here.

roetlich 4 days ago | parent [-]

What?

I think there must be some misunderstanding? I think deathanatos just wants an easy way to send files between computers when the internet is down, which seems decently reasonable.

cozzyd 5 days ago | parent | prev [-]

This is super easy in Linux with NetworkManager. I assume other OS's have simple hotspot functionality?

deathanatos 5 days ago | parent [-]

I never got around to installing NM in Linux. wpa_supplicant on its own is just … mostly good enough.

Perhaps that's mea culpa, and I suppose perhaps I should try NM again, but I also sort of thought this wouldn't be rocket science, until I tried to do it and failed.

vineyardmike 5 days ago | parent | prev [-]

> Today the Ethernet port is removed from many personal computers perhaps in hopes computer owners will send ("sync") their files to third party computers on the internet (renamed "the cloud") as a means of transferring files between the owner's computers.

Oh come on, this isn't a conspiracy. For the last decade, every single laptop computer I've used has been thinner than an ethernet port, and every desktop has shipped with an ethernet port. I think the last few generations of MacBook Pros (which were famously thicker than prior generations) are roughly as thick as an ethernet port, but I'm not sure it'd practically fit.

And I know hacker news hates thin laptops, but most people prefer thin laptops over laptops with ethernet. My MacBook Air is thin and powerful and portable and can be charged with a USB-C phone charger. It's totally worth it for 99% of people to not have an ethernet port.

vdqtp3 4 days ago | parent [-]

> thinner than an ethernet port

The XJACK and similar designs have been around long enough they can vote

Bluecobra 5 days ago | parent | prev | next [-]

You used to be able to connect two PC’s together via the parallel port. I had to do this once to re-install Windows 95 on a laptop with a hard drive and floppy. It was painfully slow but it worked.

userbinator 5 days ago | parent | next [-]

https://en.wikipedia.org/wiki/IEEE_1284#Characteristics

Up to 2MB/s effective throughput, better than 10M Ethernet. Likely it was slower for you due to other limitations.

exidy 5 days ago | parent | prev | next [-]

I believe this was pioneered by Laplink[0].

[0] https://en.wikipedia.org/wiki/Laplink

b3lvedere 5 days ago | parent | next [-]

Yup. Used to use this a lot in the DOS era. Copying files between LPT or COM ports. Slow, but worked without too much hassle.

genewitch 5 days ago | parent | prev [-]

or [x|z]modem ?

chriswarbo 5 days ago | parent | prev [-]

> You used to be able to connect two PC’s together via the parallel port.

This could be done on Amiga too, using parnet https://crossconnect.tripod.com/PARNET.HTML

I recall it being easier to set up than a dialup modem (since the latter also required installing a TCP/IP stack)

viraptor 6 days ago | parent | prev | next [-]

On Linux you can do it by creating an MTP endpoint, like mobile devices do https://github.com/viveris/uMTP-Responder

It looks like MS also had one, but only on Windows CE for some reason https://www.microsoft.com/en-us/download/details.aspx?id=933...

cozzyd 5 days ago | parent [-]

Or an rndis gadget

rtpg 5 days ago | parent | prev | next [-]

You can plug an ethernet cable in between machines and send files over it! So that period where this would be useful already had a pretty good solution (I vividly remember doing this like 3 times in the same day with some family members for some reason (probably nobody having a USB drive at the moment!))

thebruce87m 6 days ago | parent | prev | next [-]

FireWire did the IIRC. When buying a new Mac you would connect them via a single cable to do the data transfer.

ericwood 6 days ago | parent [-]

Macs still have target disk mode but it requires rebooting. Highly recommend using thunderbolt to transfer over to a new computer!

0_____0 6 days ago | parent | prev | next [-]

IIRC Apple computers can be put into Target Disk Mode, which lets a host computer rifle through its contents as if it is a dumb disk drive

pletnes 6 days ago | parent [-]

This requires shutting down one computer (the mac) first, though.

incanus77 6 days ago | parent | prev | next [-]

I realize you are asking for cross-OS, but Mac OS X was doing this in 2002 (and probably earlier) for PowerBook models with an ethernet cable between them. As I recall, iBooks didn't do this even if they had the port, but PowerBooks would do the auto-crossover, then Finder/AFP would support the machines showing up for each other.

dotancohen 5 days ago | parent | prev | next [-]

I actually have a USB-A to USB-A cable. It came with priority Windows software on an 80mm CD-ROM. It wasn't long enough to connect two desktops in the same room if not on the same table, and I just never tried with a laptop because all my laptops have run Debian or some variant thereof since 2005 or so.

tripdout 6 days ago | parent | prev | next [-]

The USB 3.0 spec does actually support A to A cables, but I'm not sure if any software makes use of it.

xandrius 6 days ago | parent | prev | next [-]

You mean a cross ethernet cable?

Or using Bluetooth? Or using local WiFi (direct or not).

deathanatos 5 days ago | parent [-]

> You mean a cross ethernet cable?

If both machines have an Ethernet port.

> Or using Bluetooth?

Half the time I need a dumb pipe, it's from personal to work. Regrettably, work forces me to use macOS, and macOS's bluetooth implementation is just an utter tire fire, and doesn't work 90% of the time. I usually fall back to networks, for that reason.

Of course, MBPs also have the "no port" problem above.

> Or using local WiFi (direct or not)

If I'm home, yeah. But TFA is advertising the ability to hole-punch, and if I'm traveling, that'd be an advantage.

defraudbah 5 days ago | parent | prev | next [-]

ethernet works out of the box, i used local lans long time before i knew how to program

usb probably works too if you google a bit

meindnoch 6 days ago | parent | prev [-]

But then nobody could analyze your files... :/