-
Notifications
You must be signed in to change notification settings - Fork 128
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
Investigate on how to use Discovery v5 talkreq/talkresp message packets for creating data streams #725
Comments
Extra note: To investigate / PoC this, no actual (full) implementation of uTP would be needed |
Some quick thoughts on the options I have in mind:
As mentioned, 2.ii. and 3. are very similar. 2.ii. would require probably more architectural changes to be able to nicely separate the stream from the discv5 code (it would rather have to be some sort of a plugin/extension, instead of the muxing in front of protocols as same header decryption needs to be done), but then again 2.ii. requires no changes/additions to the discv5 spec. But perhaps something similar as 2.i. can also sufficient. In this basic solution the All in all, to good thing is that even solution 1.a can be used fine for a PoC for now, as in practise the additional extra overhead is not much (compared to 2.ii. or 3.). |
From what I know uTP is reliable steam protocol, therefore for each send packet there will be corresponding ack from remote node. Can't we structure protocol that way, that are outgoing packet will be in I am also thinking that we may need some kinda specification, of each stream life cycle i.e who should close it, how each should happen, should the stream hang in after sending response etc.With multiple network there will be a lot of stream between different peers, and it would be good not to have some dangling resources. Maybe we can somehow re-use some parts of mplex spec from libp2p which specifies how to multpliex multiple streams https://github.com/libp2p/specs/blob/master/mplex/README.md? |
Current state:
Recap on other options / directions to go:
Some numbers on message overhead:
In general I think we should definitely be able to get rid of the unnecessary One thing to note is that none of the solutions currently consider for muxing and/or connection reuse, as it is unclear how that would work in the current connection setup scheme with FindContent/Content and Offer/Accept. |
Current specification indicates to use the
TalkReq
message to send data over anuTP
stream: https://github.com/ethereum/stateless-ethereum-specs/blob/master/discv5-utp.md#specification , with noTalkResp
message. This actually violates the current Discovery v5 specification.For now, this route can taken (perhaps just reply with empty
TalkResp
messages) so we can focus on the rest of the implementation.However, I believe eventually a "real stream" should be set up, whether as part of the Discovery Protocol (A new packet type) or outside of Discovery Protocol. In the latter case Discovery
Talkreq/Talkresp
would still be used to initiate the uTPconnection_id
(ifuTP
is to be used) and the AES keys negotiated in the Discovery session can still be used for encryption. However, a packet muxing step would have to go in front of the arrival of the data on the socket, before being passed to Discovery.In the end, both solutions are similar, and it is rather about where this packet muxing step is done/checked.
One should carefully think about how to mux the data, without having to waste too much on (failed) decryptions. It could be useful also to keep current header obfuscation of discovery v5 against packet inspection.
This issue is about investigating this and perhaps providing a PoC.
The text was updated successfully, but these errors were encountered: