10 ms·
Show HN: TCP/UDP over sound
- Neil44 10y agoA software defined modem?
- jacquesm 10y agoClever, an audio soft-modem. Was there a reason to not implement this as an actual modem with a frequency band assigned to either channel and then to run SLIP or PPP over it?
- voltagex_ 10y agoDifficulty level, probably. I'd love to see both and also one that can survive over GSM audio (is that even possible?)
- jleahy 10y agoGSM is definitely possible, but you'd struggle to get more than 2kbit/second (and that'd be over a good connection). You'd probably need FEC to pull it off.
- noselasd 10y agoThere's dialup over GSM. Though those modems does this by piping data through a software modem and then onto the GSM channel, however it requests a clear channel, so no transcoding is done by the network or the phone (the lossy GSM codecs arn't suitable for this) GPRS made that pretty much obsolete though.
- kalleboo 10y agoThe feature for getting a pure data channel was called CSD https://en.wikipedia.org/wiki/Circuit_Switched_Data https://en.wikipedia.org/wiki/Circuit_Switched_Data
- huehehue 10y agoI built a similar internet-over-voice system for a hackathon a couple of years ago. A mobile app started a call, sent a URL over the line via DTMF tones, the server fetched the page, converted each response character to a frequency, saved it all as a sound file, and played it back over the line. The app would listen to the call, decode the sound via FFT and display the resultant data as a web page. I found decent results by increasing the pitch variance between notes. The interesting thing about GSM/low-quality audio is that, since quality is known, it might be possible to account for it in a more specific way. The idea was to provide a means of internet access on a device with no mobile data plan. Of course, the worst case scenario is just sending everything as DTMF tones, but getting a tweet out would take like an hour
- brian-armstrong 10y agoThe goal of this library is to provide the familiar sockets interface over a non-traditional eth, in this case sound. Can you expand on your question? I think I understand what you're saying but I don't quite see what it would accomplish. And this is an "actual" modem, whatever that means. If you mean an IETF/RFC modem spec, there are many reasons. Those specs are focused on narrowband POTS limitations, which we don't face over a less-restricted channel. Implementing those features might be interesting from a vintage perspective but would require substantial work to achieve compatibility for relatively little gain.
- jacquesm 10y agoIf you did it as a traditional modem then one could hook up any old piece of software to the appropriate character devices and you'd be off to the races. Not everything is sockets, and there are simple and relatively easy to use wrappers around a standardized serial character interface to turn such a connection into one supporting all of the regular internet protocols. It seems - but I may be wrong about this - that this solved something at a different layer than what I would have expected.
- brian-armstrong 10y agoAh, yeah, that makes sense. My plans for this library are mostly focused on using the sockets directly, with the library linked by both peers. I'm really interested in being able to use this as a simple UDP client/server.
- jacquesm 10y agoYou'd get that just about for free by running SLIP or PPP over your audio modem.
- brian-armstrong 10y agoPerhaps - my plan is to use this on iOS and Android where I suspect SLIP and PPP interop is not as straightforward. By bundling everything in with the app, there won't be any kernel dependencies, aside from the sound card.
- wyldfire 10y agoGMSK [1] among others. Pretty cool! [1] https://en.wikipedia.org/wiki/Minimum-shift_keying#Gaussian_minimum-shift_keying https://en.wikipedia.org/wiki/Minimum-shift_keying#Gaussian_...
- brian-armstrong 10y agoIf anyone is curious about the modulation and error correction techniques supported by this modem, you can try out https://quiet.github.io/quiet-profile-lab/ https://quiet.github.io/quiet-profile-lab/ in your browser, which uses Web Audio to interact with your sound card. This runs at a frame level, about one layer below the UDP/TCP provided by quiet-lwip, but all of the modem characteristics are the same.
- piannucci 10y agoI've been working on something similar[1] for a few years. Don't forget that you can use tun/tap devices to avoid re-implementing TCP/IP, and to gain interoperability with OS services! [1] https://github.com/piannucci/blurt/tree/master/blurt_py_80211/streaming https://github.com/piannucci/blurt/tree/master/blurt_py_8021...
- brian-armstrong 10y agoInteresting, I had looked around for similar libraries when I started but didn't find many. It looks like ours differ in terms of FEC and configurability. What throughput does your modem get?
- piannucci 10y agoBaseline (most robust, up to 10 m range) configuration is 562.5 bps. Tops out at 3 Kbps under ideal conditions (maybe 30 cm range).
- ytjohn 10y agoThis is exceedingly cool. If someone wants to play with lower bandwidth data (text, basic file transfer) over sound, it's a pretty active area in the world of amateur radio. You can download the open-source program fldigi (http://www.w1hkj.com/modes/index.htm http://www.w1hkj.com/modes/index.htm) on 2 computers, point speakers and microphones at each other, and try sending text (or files/images). The "flmsg" program will send pre-formatted stanzas which get converted into standard forms. That being said, doing things like TCP/IP and other data is rather difficult on radio, mainly due to the duplex requirements and frequency spacing. But in pure audio, much more possible.
- brian-armstrong 10y agoThis is an interesting point. And in fact, the mechanisms that libquiet uses to encode/decode come from liquid dsp, which is in fact intended for use over RF.
- flashman 10y agoI look forward to the inevitable HN 'What is this thing?' post in ten years when somebody implements this in a one-off system then leaves the company. "Here is a recording of the two devices talking, one in the left channel and the other in the right. Can we figure out what they're saying?"
- alanh 10y agoWith this headline, I cannot hear anything in my head except “the dial-up noise.” TCP over sound was how I used to connect to the Internet…
- aylons 10y agoGood catch, but it was actually over audio signals. Sound was just for monitoring.
- vacri 10y agoSome ye olde modems had a socket that you plugged your regular handset into: https://en.wikipedia.org/wiki/Acoustic_coupler https://en.wikipedia.org/wiki/Acoustic_coupler I think one was used in the film War Games, but can't recall clearly.
- larholm 10y agoWar Games used a Dataphon s21d, iirc. https://de.wikipedia.org/wiki/Akustikkoppler#/media/File:Acustic_copler_with_serial_interface_dataphon_s_21_d.jpg https://de.wikipedia.org/wiki/Akustikkoppler#/media/File:Acu... I had one for my C-64.
- aylons 10y agoI stand corrected! At least until the latter days of dial-up.
- mirimir 10y agoBack in the day, I carried an acoustic coupler with my laptop. Also a patch cable with alligator clips. And tools to disassemble stuff.
- biot 10y agoThat's a distinction without a difference. If another family member picked up the phone while you were dialed up, they certainly heard it.
- Razengan 10y agoSlightly unrelated but curious; have there been any attempts to transfer data as sound? I don't mean sound converted to electricity, or to represent 0s and 1s, but using a specific frequency range to represent 1, another range to represent 2, another for 3... I don't know the terms for these things. Using vibrations instead of electrons to transmit data over a wire? Do creatures like dolphins do this?
- nickodell 10y ago>I don't mean sound converted to electricity, or to represent 0s and 1s, but using a specific frequency range to represent 1, another range to represent 2, another for 3... I don't know the terms for these things. Frequency-shift keying? https://en.wikipedia.org/wiki/Frequency-shift_keying https://en.wikipedia.org/wiki/Frequency-shift_keying
- goodmachine 10y agoYup, a company I co-founded http://chirp.io http://chirp.io has been using this technique (well, MFSK) to share data over the air, between mobile and embedded devices for a while now. Easy to describe, hard to do robustly.
- JorgeGT 10y agoI'm curious, did you selected audible frequencies (1760hz-10.5khz) because there were the only ones technically feasible with the current popular mics/speakers or because you actually wanted users to hear the data? I have played with minimodem to do this (FSK) and while cool, it is an unpleasant noise. I managed to transmit at inaudible frequencies but certainly it was very very unreliable with normal consumer hardware.
- goodmachine 10y agoBoth, in fact. Add to this we wanted the system to work reliably at very low volumes in noisy surrounds, and it was a very interesting challenge. If you'd like to know more, we have trial SDKs you can goof around with. Feel free to give the technology a spin.
- 0x0 10y agoI wish there was a youtube link that demo'ed this here :)
- brian-armstrong 10y agoIf you'd like to play with the base modem, sans TCP stack, have a look at the emscriptened version here https://quiet.github.io/quiet-profile-lab/ https://quiet.github.io/quiet-profile-lab/
- 0x0 10y agoThat is super cool! Is there a receiver too, that one can run on a 2nd computer, and transmit text/files? Edit: wow, the ultrasonic thing is really cool. Imagine putting that in mobile apps and having them communicate "silently" over the air!
- brian-armstrong 10y agoIf you want to try 2 devices, here's another demo, again sans TCP https://quiet.github.io/quiet-js/ https://quiet.github.io/quiet-js/ I recommend running the receiver on a non-mobile device if you try this. Unfortunately running a receiver smoothly from a mobile browser is fairly difficult.
- 0x0 10y agoThat link is worthy of a HN post in itself! :D Wow, what about ad networks abusing this for cross-domain cross-tab communications?!?
- brian-armstrong 10y agoI posted that link a few months ago and it was pretty well-received. Today's submission is more iterating -- the one in the link offers a basic frame-only interface but today's submission is a full network stack I considered the cross-tab case but couldn't think of an obvious way to implement that. They'd have to get mic permissions, at any rate
- NamTaf 10y agoWas there not a PoC recently (~months ago) of someone who did similar over a speaker/microphone but outside the audible range of ears? It was a PoC of the Flame malware capability to jump airgapped PCs
- niftich 10y agoNot sure if this is what you meant, but Chromecast's guest mode will pair using ultrasound. The guy who worked on it has some code using the WebAudio API on github and his linked blog: https://github.com/borismus/sonicnet.js https://github.com/borismus/sonicnet.js
- NamTaf 10y agoNo there was an article on here several months ago that I couldn't find when searching where someone wrote a PoC for the transmission of data via near-ultrasonic sounds from a computer speaker and microphone. I don't think it was this [1] one, but it shows the concept being used. Maybe I'm misintepreting the OP's work and not realising how it differs in some subtle way? I get that they've put TCP/UDP over it, but is there something else I'm oblivious to? Also, I meant BadBIOS [2], not Flame. [1]: https://www.anfractuosity.com/projects/ultrasound-via-a-laptop/ https://www.anfractuosity.com/projects/ultrasound-via-a-lapt... [2]: https://en.wikipedia.org/wiki/BadBIOS https://en.wikipedia.org/wiki/BadBIOS
- JorgeGT 10y agoMaybe this one? https://github.com/quiet/quiet-js https://github.com/quiet/quiet-js I remember it sparked a discussion about airgap breaking.
- deutronium 10y agoI've actually done TCP/IP over sound, via GNU Radio - https://www.anfractuosity.com/projects/ultrasound-networking/ https://www.anfractuosity.com/projects/ultrasound-networking...
- niftich 10y ago
- nathancahill 10y agoI've been prototyping a dail-up concept (like CSD) over 2G networks. Combined with heavy server-side compressing, the goal is to achieve speeds faster than GPRS in areas that have no data coverage to speak of. TCP over sound was the first part. I'll have to study this implementation.
- 4ad 10y agoYour project sounds very interesting. I don't think you'll be able to achieve speeds faster than GPRS, but it's useful nevertheless.
- pjc50 10y agoNote that your audio will get fed through the AMR codec and then limited by the bandwidth available to that. For best results reverse-engineer the codec so your symbols are maximally distinguished by it. It should not be possible to exceed the carrier's CSD rate over the link, but it's an interesting way of circumventing their billing.
- deleted 10y ago[deleted]
- ComodoHacker 10y agoMore interesting IMO would be to embed data stream into normal audio stream within human-audible range. Something like MP3 steganography, but decodable after air transfer. Had anyone tried that? I can imagine some interesting potential applications, including weird ones.
- JorgeGT 10y agoYou may be interested in https://github.com/quiet/quiet-js https://github.com/quiet/quiet-js and https://danielrapp.github.io/spectroface/ https://danielrapp.github.io/spectroface/, both encode text / images over audible frequencies, but of course they sound weird. However it is technically trivial to encode "hidden" data at inaudible frequencies (>25 kHz) along with a song/whatever in the audible range and recover the data with a high pass filter. You would have to explain, however, the need for >48kHz sample rate. Another, stealthier option would be to encode information in the background noise of a recording, but this would require more complex encoding/filtering techniques.
- return0 10y agoThis will be great for retro robots (i am certain they will be popular with the hipsters of the future one day).
- ham 10y agoI wonder would it be possible - like in steganography - to hide the waveform in ambient noise or music so that it's not perceptible if used with speakers and microphone within audible ranges?
- SoulMan 10y agoIt reminds me a app called chirp which allowed data transfer via sound from phone to phone.
- beardog 10y agoI know which app you're talking about. I've played with it a little, it seems to just transfer a link/identifier by sound to then download the file via the internet.
- SoulMan 10y agoOh yeah, somehow I cant find that app any more. Guess complete data transfer would be prone to error given the medium is sound waves. hence they stuck to link.
- jbert 10y agoThe setup process for our Cocoon home security device (https://cocoon.life https://cocoon.life) uses an audio transfer from the phone to pass wifi details and a token to bootstrap setup and a trust relationship. After some time spent tuning and with some forward error correction, the reliability is good and it's not too harsh on the ears. Response from beta testers has been pretty positive.