Skip to content

datagrams: Add initial datagram draft #680

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

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