Skip to content

Conversation

MarcoPolo
Copy link
Contributor

Initial text for specifying how datagrams will work on libp2p.

cc @raulk @sukunrt @jxs

Copy link
Contributor

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered tying a datagram flow to a stream, similar to what HTTP DATAGRAMS (RFC 9297) does?

This would have the following benefits:

  1. Shorter datagram header (especially important given MTU restrictions).
  2. Both peers get the opportunity to cancel a datagram flow (by closing / resetting the associated stream).
  3. A reliable control channel, e.g. for application protocols that need to send an occasional control message next to a datagram flow.

@MarcoPolo
Copy link
Contributor Author

Thanks @marten-seemann! That's a nice idea. We can include the versioning information in the stream as well so we don't pay that overhead on every datagram. The datagram itself then only has a single varint of overhead.

@sukunrt sukunrt self-requested a review May 29, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

2 participants