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

where is the framing? #53

Closed
vans163 opened this issue Mar 9, 2018 · 5 comments
Closed

where is the framing? #53

vans163 opened this issue Mar 9, 2018 · 5 comments

Comments

@vans163
Copy link

vans163 commented Mar 9, 2018

Question, did you consider using msgpak or at worst json?

Question 2: were is the framing, over TCP the message can be sent as fragments requiring multiple receive calls, how do I know when I got the full message? Most protocols at the very least have the first 1-4 bytes (varint sometimes) specifiying the message length.

@sennui
Copy link
Contributor

sennui commented Mar 9, 2018

@vans163 yes we will go with msgpack. Wire protocol is coming soon, we need to polish that.

@hanssv
Copy link
Member

hanssv commented Apr 16, 2018

Since msgpack has some quirks when it comes to deterministic representation RLP (https://github.com/ethereum/wiki/wiki/RLP) is used for serialization of objects and P2P messages. An overview of the sync protocol is HERE and the exact messages are documented HERE

@vans163
Copy link
Author

vans163 commented Apr 16, 2018

Iv been following EoS and company, the P2P connections between light nodes is very useful to build all sorts of use cases. They accomplish it by having STUN/Turn like peer nodes to help establish these connections. But these solutions all use TCP (with TCP holepunch), a UDP solution would be really useful. Something like SCTP where the peer can select if they want a reliable+ordered, or unreliable channel.

@knarz
Copy link
Contributor

knarz commented Apr 20, 2018

Keeping as many nodes as possible in the p2p network is definitely a goal.

Something like SCTP, that allows both modes, would be nice but from a quick glance, SCTP seems like a bad candidate, though, given that it needs special drivers for both Windows and MacOS and would probably run into problems with middleboxes.

With that said, we will almost certainly end up using both TCP and UDP—or maybe something from the userland, QUIC-like.

@vans163
Copy link
Author

vans163 commented Apr 22, 2018

@knarz Allowing TCP and UDP nat holepunching plus P2P connections would be awesome. Is there any confirmation on this? P2P connections + inchannel smart contracts can lead to some very interesting use cases.

My vote would be against QUIC. If someone wanted to implement quic and they have UDP available (with nat holepunch/p2p signalling), they can. QUIC is too complex and growing at its current stage, it would be problem ridden and time consuming.

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

5 participants