Posted May 17, 2012 20:09 UTC (Thu) by nybble41 (subscriber, #55106)
In reply to: MTPFS by linusw
Parent article: Tasting the Ice Cream Sandwich
> What USB needs is a real transactional file transfer class, think of FTP over USB.
I was thinking more along the lines of SMB/CIFS over USB (with optional UNIX extensions), but the principle is the same. Take a decent network filesystem protocol, adapt it for point-to-point use over a single, arbitrary, byte-oriented channel, standardize users, groups, and permissions, and then layer it over USB.
One nice thing about using SMB/CIFS would be that it could be implemented for most current operating systems with a simple USB-to-IP proxy and existing network filesystem drivers.
FTP (or WebDAV) would probably work just as well; I'm just not sure about potential protocol limitations. I've never known anyone to use FTP as a network filesystem protocol.
Posted May 17, 2012 20:30 UTC (Thu) by jimparis (subscriber, #38647)
[Link]
> One nice thing about using SMB/CIFS would be that it could be implemented for most current operating systems with a simple USB-to-IP proxy and existing network filesystem drivers.
You could even do it with no added PC software -- have your phone be a USB RNDIS interface that runs a DHCP server, and run a SMB/CIFS fileserver with all the right discovery stuff that makes it just show up in your normal network browser. I'm surprised they're not doing this.
MTPFS
Posted May 17, 2012 21:51 UTC (Thu) by nybble41 (subscriber, #55106)
[Link]
>> One nice thing about using SMB/CIFS would be that it could be implemented for most current operating systems with a simple USB-to-IP proxy and existing network filesystem drivers.
> You could even do it with no added PC software -- have your phone be a USB RNDIS interface that runs a DHCP server, and run a SMB/CIFS fileserver with all the right discovery stuff that makes it just show up in your normal network browser.
That assumes your PC is set up to automatically establish links over arbitrary USB network adapters, which seems like a rather insecure default. The USB-to-IP proxy in my proposal would only allow the device to present a restricted SMB host on a private, non-routable address range; it wouldn't be able to choose its address or access other services on the host PC.
Even ignoring the security aspects, I believe desktop Linux setups, at least with NetworkManager, normally prefer wired network connections over WiFi, and I wouldn't want my WiFi-connected laptop to disconnect from the Internet every time I plug in my tablet or smartphone.
IIRC, on Windows it chooses the faster network as the default route, unless you configure the metrics manually; depending on speed of the main network, the result may depend on whether the device shows up as a 100 Mbps or 1000 Mbps adapter. In the latter case (necessary to max out the USB at 480 Mbps) it could even cause issues for 100 Mbps LANs, which are still common, much less WiFi at anywhere from 12 to 300 Mbps.
MTPFS
Posted May 18, 2012 11:08 UTC (Fri) by tialaramex (subscriber, #21167)
[Link]
The default behaviour for most desktop systems is in fact to assume that the USB network device leads to the Internet, and further, if there is no better route to the Internet in use already that you plugged it in because you want to use it and so it should be configured and made ready to use.
(Obviously policy might prohibit non-superusers from having this functionality on a company machine for example)
But you are correct that a built-in Ethernet device will be preferred most often if it's available. However we live in the Future⢠and even when some other device is the preferred route to the Internet, link-local services should work over alternative devices. So, at least in theory, mDNS advertising a shared drive over a USB device would make it show up and be accessible.
Of course since nobody does this today it probably wouldn't actually work right out of the box if you tried it. But all the components exist, getting it to work is just a matter of polish.
MTPFS
Posted May 18, 2012 15:45 UTC (Fri) by nybble41 (subscriber, #55106)
[Link]
> But you are correct that a built-in Ethernet device will be preferred most often if it's available.
Actually, my concern was just the opposite: that the built-in Ethernet or WiFi adapter might _not_ be preferred over the USB connection, which can only access this one device. Link-local access to the device will probably work just fine, but if the system selects that adapter as the default route there will be unfortunate side effects for the user's LAN/Internet connection.
> Of course since nobody does this today it probably wouldn't actually work right out of the box if you tried it.
That was my point. Sure, all the pieces are there, but the reason for making it an RNDIS interface to begin with was to avoid the need for any extra software. If you have to reconfigure the system or add special support for such devices, you might as well just include the more secure filesharing-only USB-to-IP proxy I originally suggested.