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

Add segment size to addressed envelope metadata #2390

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

glbrntt
Copy link
Contributor

@glbrntt glbrntt commented Mar 13, 2023

Motivation:

Recent additions added support for UDP_SEGMENT and UDP_GRO on Linux. These are both configured via channel options. Enabing UDP_SEGMENT at the channel level means all datagrams sent will use the same segment size.

We can offer finer-grained control by allowing users to set the segment size at the datagram level by setting the option in the CMSG headers.

We can also recover the segment size on the receive side by reading the header value, this is possible for both methods of setting the segment size.

Modifications:

  • Add segmentSize to AddressedEnvelope.Metadata which sets the segment size on outbound messages and indicates the segment size the sender used on the receive side (assuming GRO is enabled).
  • Add tests

Results:

  • Finer grained control over UDP segmentation.
  • Users can recover the segment size used by the remote peer.

@glbrntt glbrntt added the 🆕 semver/minor Adds new public API. label Mar 13, 2023
@glbrntt glbrntt requested a review from Lukasa March 13, 2023 14:07
Motivation:

Recent additions added support for UDP_SEGMENT and UDP_GRO on Linux.
These are both configured via channel options. Enabing UDP_SEGMENT at
the channel level means all datagrams sent will use the same segment
size.

We can offer finer-grained control by allowing users to set the segment
size at the datagram level by setting the option in the CMSG headers.

We can also recover the segment size on the receive side by reading the
header value, this is possible for both methods of setting the segment
size.

Modifications:

- Add `segmentSize` to `AddressedEnvelope.Metadata` which sets the
  segment size on outbound messages and indicates the segment size the
  sender used on the receive side (assuming GRO is enabled).
- Add tests

Results:

- Finer grained control over UDP segmentation.
- Users can recover the segment size used by the remote peer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant