Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how should a UDP transport look like after the big transport refactor #3

Closed
zaibon opened this issue Jun 19, 2018 · 11 comments
Closed

Comments

@zaibon
Copy link

zaibon commented Jun 19, 2018

In my quest to understand and get my hands dirty with libp2p I was looking to implement a UDP transport.
So I discovered this repo. Now I have a couple of question regarding how an UDP transport should look like now that the big transport refactor has landed.

Using the tcp transport as example I can get my head around pretty much every part of the transport interface.
The only problem I have is regarding the Listen method of the interface. Listen should return a Listener and a Listener should have an Accept method. In the context of UDP, an Accept method doesn't really make sense. So I'm puzzled, should we have another kind of transport for non connected transport type or should I hack around it and implement a UDP listener that would always return the same underlying connection for example

I've started working on some implementation if you already want to have a look at it : https://github.com/zaibon/go-udp-transport

@backkem
Copy link

backkem commented Jun 27, 2018

I'm interested in this abstraction as well. Just returning the same connection on Accept doesn't seem like a good idea. It would turn Accept from blocking into non-blocking since there is nothing to wait for.
I see the following options:

  • Add a thin protocol above UDP to make it act like a reliable connection, at least some initial connection setup message. However, it would no longer be plain 'UDP' transport.
  • Add support for multiformats/go-multiaddr-net PacketConn to libp2p/go-libp2p-transport Listener. However, this means all higher level code should work with both.

CC @Stebalien @lgierth

@Stebalien
Copy link
Member

So, the current thinking is to have a separate transport "column" for packet based connections as they're significantly different.

@zaibon
Copy link
Author

zaibon commented Jun 28, 2018

some discussions around that topic also happened there: libp2p/specs#71 (comment)

@ghost
Copy link

ghost commented Jun 28, 2018

So, the current thinking is to have a separate transport "column" for packet based connections as they're significantly different.

I was thinking something else. They aren't all that different: libp2p/specs#71 (comment)

@Stebalien
Copy link
Member

We'll have to be careful about prioritizing connections and saying "all connections support literally all features" is a strong statement we'll have to think about. However, that should work.

(Note: we'll probably also want session-less packet connections and those will likely need a separate stack).

@ghost
Copy link

ghost commented Jun 28, 2018

We'll have to be careful about prioritizing connections and saying "all connections support literally all features" is a strong statement we'll have to think about. However, that should work.

Yeah agreed that we need to be able to tell the nuances there. For many use cases there'll be one combination of transport/muxers/crypto/etc. that'll fit nicely, and most other combinations will be less than ideal.

Note: we'll probably also want session-less packet connections and those will likely need a separate stack

This is the fire-and-forget messaging that's mainly motivated by DHT latency and throughput right?

@Stebalien
Copy link
Member

This is the fire-and-forget messaging that's mainly motivated by DHT latency and throughput right?

Yes.

@libp2p libp2p deleted a comment from tbfly Aug 11, 2018
@bonedaddy
Copy link

As far as I can tell there isn't much in the way of UDP transports. I looked at the fork someone made but it doesn't look like it compiles or works. Has there been any success in a UDP transport? I know there is quic but I'm not sure if that would fall under the same "pure udp transport"

@Stebalien
Copy link
Member

An actual UDP transport would be be packet/message oriented and would require a new transport stack and some new libp2p interfaces for sending/receiving messages.

@bonedaddy
Copy link

Damn that is no short order, but makes sense. thanks.

@zaibon
Copy link
Author

zaibon commented Mar 19, 2020

I guess we can close this issue then. I'll close it. Fee free to re-open if anything else needs to happen here.

@zaibon zaibon closed this as completed Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants