13

It seems to be possible to run USB over IP, e.g. using usbip which is part of some Linux distros e.g. https://www.archlinux.org/packages/?q=usbip

Is there something similar for Bluetooth over IP? (NOT: IP over Bluetooth).

This would allow the physical separation of, say, a BT-enabled smartphone from a BT-enabled headset by means of the internet.

Linux bnep might be able to do that, but I haven't been able to find instructions for how to.

  • 3
    I doubt you’ll be able to use USB over the Internet, mainly because of latency issues. – Daniel B Nov 8 '15 at 18:07
  • Is it really USB? The USB specifications call for things which just can't be provided of IP, like physical connector specifications, power, etc. – Ron Maupin Nov 8 '15 at 18:11
  • @RonMaupin Of course, it’s just about what happens between the USB controller and the CPU. Even so, provided the latency is low enough (LAN), software using these devices won’t be able to see the difference. – Daniel B Nov 9 '15 at 13:46
  • 2
    I actually just had an idea with usbip. Could it be possible to use usbip with a USB Bluetooth dongle? (it's a crazy idea, I know) – Léo Lam Nov 11 '15 at 8:50
  • @Leo Lam. Well, technically that'd be 'bt over ip' masquerading as 'usb over ip'. ;) – rinfinity Nov 11 '15 at 11:34
7
+25

Although in our technological world everything today seems possible, as far as I know true Bluetooth-to-Bluetooth-over-IP has never been implemented. I will try and explain the difficulties, that although not insurmountable, are the cause for this situation.

Bluetooth itself is is a wireless technology standard for exchanging data over short distances. It is usually used for device-to-device connections and involves the notion of Pairing, for security purposes. The Bluetooth protocol is extremely versatile and can be used for a many purposes. Its popularity arises from the fact that it operates at frequencies that are globally unlicensed (but not unregulated).

True Bluetooth-to-Bluetooth-over-IP would require two Bluetooth devices to pair over IP. This is not the same as, for example, two persons using Skype to talk over the Internet via Bluetooth headsets, because the headsets are paired with their computers and not with one another.

Here are some excerpts from the Wikipedia article OSI model :

Layer 1: Physical Layer

The physical layer of Parallel SCSI operates in this layer, as do the physical layers of Ethernet and other local-area networks, such as Token Ring, FDDI, ITU-T G.hn, and IEEE 802.11 (Wi-Fi), as well as personal area networks such as Bluetooth and IEEE 802.15.4.

Layer 4: Transport Layer

An example of a transport-layer protocol in the standard Internet stack is Transmission Control Protocol (TCP), usually built on top of the Internet Protocol (IP).

TCP and UDP are transport level 4 protocols, whereas Bluetooth is a lower physical level 1 protocol. Thus you could use TCP or UDP on top of Bluetooth, just as you use TCP and UDP on top of Ethernet, but the opposite is much harder.

The Bluetooth protocol stack includes its own transport protocols: L2CAP and RFCOMM, where RFCOMM links use the L2CAP layer. You can work some IP tunneling over Bluetooth encapsulating UDP packets over RFCOMM links.

Using pure OSI terminology, it is impossible, is even a contradiction of terms, to use a layer 1 protocol over layer 4.

Practically speaking, we could imagine a software-written virtual adapter that would declare itself to Linux on the client side as a physical Bluetooth device and talk over IP to another such virtual Bluetooth device on the server-side Linux. But the complexity involved in emulating OSI layers, and the programming effort that is required for implementing the very versatile Bluetooth protocol and its master-slave architecture, make creating such a general implementation a very demanding exercise that is unlikely to happen, as there is currently no demand for such software.

| improve this answer | |
  • 4
    Much like the OSI stack itself, strict layering only exists in fantasies. Widely-used VPN software do transmit L3 IP packets and even L2 Ethernet frames over L4 UDP… – user1686 Nov 9 '15 at 13:39
  • @grawity: I agree up to a point that a packet is a packet no matter how deeply wrapped. However, VPN does in the end only IP over IP, even if packaged in lower/higher layers, while Bluetooth is an entirely different physical protocol. My answer says that this is possible but probably too complicated to bother, because of protocol differences. Would you disagree with that? – harrymc Nov 9 '15 at 14:18
3

I haven't tried any of this in practice but it's stuff I could find that talks about "Bluetooth over IP".

The book Linux Kernel Networking is very technical but it describes how to do "Bluetooth over IP":

On the server side:

pand --listen --role=NAP

On the client side:

pand --connect btAddressOfTheServer

This creates a virtual interface bnep0.

Apparently this just gives you L2CAP, which can only send packets over a "piconet". But for L2CAP there are thoughts about how to send them over IP in an IETF draft: Transmission of IP Packets over Bluetooth Networks.

The IETF may consider to run L2CAP over IP over the Host Controller with a new protocol:

                       +------------+
                       |    L2CAP   |
                       +------------+
                       |     IP     |
                       +------------+
                       | Foo2 Proto.|
                       +------------+
                       | Host Cont. |
                       +------------+

Figure 4.3.3 - 3rd. Possible Bluetooth Protocol Stack for IP networking

And then I also found UbiPAN: A Bluetooth Extended Personal Area Network which mentions "Bluetooth over IP" - but unfortunately it doesn't look like UbiPAN has been released as free software.

| improve this answer | |
  • 1
    BNEP is used to send network packets directly over L2CAP in an existing piconet, it does not allow the user to bridge bluetooth over IP. Also, the specification you linked to is old and not from the original source (BT SIG), here is the adopted specification: bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=6552 – Jon Carlstedt Nov 11 '15 at 7:25
  • 2
    Sorry, my answer is a work in progress and you may not be happy with it it but it currently contains more useful information about a possible solution than any of the other answers. – kqw Nov 11 '15 at 11:58
  • Your answer doesn't state whether it's possible or not to use Bluetooth over IP. – Winny Nov 18 '18 at 2:57
1

Ok, I have investigated this some more. It is not possible.

Here is why: For this to work, you will need the bluetooth chip in the computer to relay the information instead of answering itself.

This funcionality does not yet exist.

I cannot share any documentation at this moment, since it is proprietary and confidential.

If you are a member of BT SIG you can view the bluetooth roadmap at the panorama section on bluetooth.org

| improve this answer | |
1

I've beed on the same (or similar) thought recently. What I want to do is to use a home automation hub, which unfortunately cannot reach the whole house with single-location radio.

My setup is as follows: computer running bluez + usbip client <- LAN -> other computer with physical bluetooth USB dongle + usbip server.

Turns out this works just fine. From Bluez point of view, it is not able to disginguish between local and remote USB dongles.

(Machines running Linux 4.9.80 + up-todate-usbip + Bluez 5.48 ; arm)

| improve this answer | |
0

Harrymc is correct.

This is not possible or at least not feasible.

You could pair your phone with a computer and your headset with another computer and thus having two bluetooth connections. The connection between the computers can be bridged any way you feel like it and in turn relay all the bluetooth communication. This will make it look like you have bridged bluetooth over IP and you could probably get them to talk to each other and do some of the stuff you are trying to do.

But in reality there is no bluetooth connection between the two devices.

Device A has a bluetooth connection to a computer.

Device B has a bluetooth connection to another computer.

The two devices will not be able to pair and connect directly to each other. One could theoretically build something that would allow a direct bluetooth link to be set up, but traversing the layers and linkkey management would be a nightmare to sort out and that is just the beginning, I have no idea of how to solve package management and frequency hopping, bluetooth frequency-hopping rate is 1600 hops/s for a single slot packet.

If someone actually did this, I would be very impressed and would very much like to take a look under the hood.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.