GithubHelp home page GithubHelp logo

Comments (12)

njouanin avatar njouanin commented on June 10, 2024 1

I started working on an elixir implementation of the matter protocol which relies on UDP.
There's also a need for mDNS (UDP based) support.

from thousand_island.

mtrudel avatar mtrudel commented on June 10, 2024

UDP support is very much something that I'd like to land (and something I have a strict requirement for based on mtrudel/bandit#28), but I'm not sure yet that Thousand Island is the place for it. The UDP API is very different from TCP, and the ThousandIsland.Transport behaviour doesn't capture it well at all.

My very loose plan (that I haven't validated beyond very preliminary research) is Thousand Island will expose QUIC as a transport alongside TCP and TLS based on their similarities as connection-oriented protocols, and that Thousand Island's QUIC support would be based on UDP support implemented somewhere (I'm just not sure if that somewhere is within Thousand Island or its own project).

All that being said, I'm not planning on tackling this personally until after Bandit 0.8 lands. I would say that 90% of the difficulty in this workup would be building the right abstraction; the code-level work here is pretty close to trivial. What specific use cases were you looking at?

from thousand_island.

mtrudel avatar mtrudel commented on June 10, 2024

Interesting!

In terms of mDNS servers, I've tried all of them over the life of HAP, and have been left wanting by all of them for one reason or another. I've settled on mdns_lite (not least because @fhunleth is the most responsive maintainer on the planet). Looking at their implementation it seems that they've moved to using :socket directly (going even lower from :gen_udp, the opposite direction than an abstraction such as Thousand Island would provide).

from thousand_island.

ryanwinchester avatar ryanwinchester commented on June 10, 2024

I started working on an elixir implementation of the matter protocol which relies on UDP.

Nice! I was working on Z-Wave for Elixir until SmartRent released Grizzly (which is great, btw). Now, I'm not touching anything until I see how Matter pans out. 😅

from thousand_island.

njouanin avatar njouanin commented on June 10, 2024

Nice! I was working on Z-Wave for Elixir until SmartRent released Grizzly (which is great, btw). Now, I'm not touching anything until I see how Matter pans out. 😅

This is still early work. I still fight with specification documents which is not always clear ...

from thousand_island.

mtrudel avatar mtrudel commented on June 10, 2024

Closing due to nothing being actionable on Thousand Island's side.

from thousand_island.

hissssst avatar hissssst commented on June 10, 2024

@mtrudel @njouanin so are you implementing this feature in thousand island (or relative project)?

I need UDP ranch-like pool for socks5 proxy I am writing, and I think that instead of writing my own pool, I could implement it as a part of thousand_island. Do you need this implementation, or are you already writing one?

from thousand_island.

mtrudel avatar mtrudel commented on June 10, 2024

I haven't started anything yet, but I've spent a bit of time researching and I'm not really sure yet what the right abstraction is here. UDP is rather a bit different and I'm conscious of not putting a round peg in a square hole.

Do you have any implementation ideas? I'd love to chat them over!

from thousand_island.

hissssst avatar hissssst commented on June 10, 2024

I thought about implementing ThousandIsland.Transport backed by gen_udp. Some callbacks like handshake or secure? could be simply ignored (or can return default values like {:error, :not_implemented} and false)

from thousand_island.

hissssst avatar hissssst commented on June 10, 2024

Of course implementing QUIC is a different question. I am talking about vanilla UDP socket here

from thousand_island.

hissssst avatar hissssst commented on June 10, 2024

Oh, I stumbled across some listener being incapable to handle UDP sockets, hmm

from thousand_island.

mtrudel avatar mtrudel commented on June 10, 2024

That's the thing, right? To restate the obvious:

  • The TCP/SSL socket concept is a single pair of reliable byte streams between two peers
  • The UDP datagram concept is standalone send / receive of discrete datagrams. There's enough meat to the abstraction to layer a simple 'receive/reply' semantic on top of this, but it's not persistent
  • QUIC models any number of concurrent reliable byte streams between two peers

Thousand Island provides three fundamental things:

  1. An easy to consume, GenServer-like abstraction of a reliable byte stream (with connection, send/receive, and shutdown as fundamental points of interaction)
  2. Effective use of OTP processes to provide robust connection acceptance and a 'one process per connection' model
  3. Reliable management & supervision of all of the above. If something crashes, we take care of it.

All three of these things make perfect sense for TCP/SSL. All three make some amount of sense for QUIC (point 2 may need to be extended to connections and streams as being handled in separate process, much as Bandit does with HTTP/2 today). But really, only the third point makes any sense for UDP (and it's a pretty anodyne point to begin with).

All of which is to say that I'm thinking less and less that Thousand Island is the right home for UDP. I'm not sure what is the right home is at the moment, and need to tinker adhoc a bit more before I'm going to feel confident that any particular approach is the right one.

from thousand_island.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.