-
Notifications
You must be signed in to change notification settings - Fork 648
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
Support propagating ECN information on AddressedEnvelope
s
#1472
Comments
This was referenced May 4, 2020
PeterAdams-A
added a commit
that referenced
this issue
May 5, 2020
Add Optional ECN MetaData to Addressed Envelope Motivation: This is a very small step along the path to #1472 Modifications: Add an optional metadata field to addressed envelope. Currently the only possible data is ECN information. This is not currently populated anywhere. Result: Metadata in place for future work. Co-authored-by: Cory Benfield <lukasa@apple.com>
Can we also read ECN flags using NIO? |
Yes, this is implemented. Set |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is possible that users of datagram channels may be interested in ECN information associated with the IP packets that carry the datagrams. It's possible to obtain this information from the OS and for us to propagate it through the channel, but today we do not.
The proposal for how to do so comes in multiple parts, each of which is probably a separate chunk of work:
Add support for
AddressedEnvelope
to carry arbitrary metadata in a performant wayThis probably involves adding a metadata field to
AddressedEnvelope
that is usually empty, and only ever filled when necessary. This metadata will need to be keyed and typed. This is a straightforward Swift-level data structure problem, and requires no NIO-specific knowledge.Move datagram channels over to using
recvmsg
in the single-read case, instead ofrecvfrom
. (Move DatagramChannel over to using recvmsg. #1473)This allows us to extract metadata from socket reads.
Wire up extracting metadata of known types from
recvmsg
.Just a straightforward extension. We need to minimise allocations here, so we should aim to be careful about how we build this. Ideally we'll use the stack.
Add a
ChannelOption
that allows users to request ECN information, and then make sure we extract and propagate that information.Update
swift-nio-transport-services
to support this new flag, asNetwork.framework
automatically provides this information for us.The text was updated successfully, but these errors were encountered: