I went through The best way to do TCP/IP over USB on Linux?, and would like to know more about the feasibility/procedure in order to have two Linux boxes IP-talking to each other over USB. I did it few years ago easily over Serial Link and it was quite stable and mature.
The idea is to have the related named network device (eth0
, usb0
, wlan0
, ..) in /sys/class/net
and then be able to play around with ifconfig
/route
commands, just like any other network device for IP address assigning, routing, pinging,... but that's the easy final part.
In order to achieve this, I see different issues/steps:
HW: cabling. I guess 2 computers only have 'host' USB type-A connectors, while usual USB cable have one Type-A and one Type-B connector: a cable should be carefully prepared in order to prevent power being exchanged, but allow only data. Correct? (I am only covering USB <=2.0 protocol here, as I know USB 3.x could perform full-duplex wiring)
Of course, if I want to connect a PC (host/USB) to a 'device' (rasbpi, mini2440, arduino, ..,) I would actually have a Type-B end and a 'stupid' USB cable could be used. Correct?
Kernel/Driver: what is present in the kernel in order to assign a network device to a USB port? Similar to IP over
/dev/ttySxx
? What if the USB kernel driver is not ready on the other side?Identification of port/connector: how shall the kernel know which port I am actually using (especially if power wiring is cut-off on dedicated cable)? How do I identify my port?
Finally, from a network layer point of view, what should I expect? a simple bridge for Ethernet? or each USB side would have an assigned IP address?
I hope this is not too confused, and you get what I am trying to achieve. But since it use to be so simple to do IP (Ethernet?) over a serial link, I hope it is also the case for USB.