-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[core] Add a channel argument to set DSCP on streams #28322
Conversation
Are there any thoughts about this proposal, or is there an alternative plan how to classify streams? |
why not just use a socket mutator for this? |
The issue I have is how to handle the declarations of the socket mutator types needed by SetSocketMutator() in ChannelArguments. Currently the socket_mutator.h is located in Are there any plans to make it available for public consumption? |
@drfloob For considering making this API public |
@bjosv Sorry for the delay. Some changes are underway in gRPC's low-level I/O code, and we plan to replace the SocketMutator API with an equivalent. SocketMutator is, as you pointed out, not really a public thing even though it exists in the surface API, the only sanctioned uses are internal to Google. We expect to provide something that the public can use as well. |
@drfloob Any updates on whether the SocketMutator (or equivalent) API will be made public? |
Sorry for the long delay, @bjosv. We have been discussing implementation alternatives for this feature the past few months. Since gRPC has a strong commitment to maintaining a stable public API, and because we're undergoing some significant changes to the way I/O is done in gRPC, we hadn't wanted to make any hasty decisions and risk being burdened with mistakes we'd need to maintain long-term. Ultimately, since this is a widely-used standard, a channel argument like this is probably the right approach. When we introduce this feature, we'll want 4 implementations: Posix iomgr and EventEngine implementations (near identical to each other in regards to this work), and ideally Windows iomgr and EventEngine implementations as well (similarly identical to each other). Would you like to take on the task? |
@drfloob Sure, sounds good. I'll start by lifting this and implement an EventEngine variant. I need to look into the Windows parts a bit more first since I'm not that familiar how it handles DSCP/QoS. |
Wonderful, thank you!
I see a strong recommendation against using IP_TOS, and a few reports that IP_TOS does not work without registry hacking. I'm not familiar with the Windows QoS APIs, but they will probably be needed here based on my initial understanding. Regarding the PosixEventEngine, I believe the iomgr-equivalent spot is here: grpc/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc Lines 117 to 141 in a9873e8
|
@drfloob I pushed a re-take of the PR to include both iomgr and event_engine for both Linux/posix and Windows. I'm not sure adding an additional grpc library is accepted. An alternative for Windows event_engine can be to put the DSCP handling in the I added the |
I now see typos in the commit message...unless PRs are squshed there should be a |
I'm sorry this slipped through the cracks. Thank you for the hard work! I've replied to your comments below, and I'll do another review pass.
Is the qwave library available by default on Windows 10 and later? I haven't found any instructions on how to acquire it, and it's not popping up as a separate installation component for visual studio, so I assume it's available by default but it's worth asking. gRPC currently supports Windows 10+, Visual Studio 2019 and later. If it's available everywhere we support, I don't see any harm here.
You don't have to worry about those. They are both used for wrapped languages, which is safely out of scope for this feature addition. I think you will, however, want to add qwave.lib in the
Most things in gRPC are available in all builds, sometimes configured via runtime flags or arguments. This simplifies testing among other things, since compilation time can be expensive. Unless this adds an intolerable amount of bloat, I'd opt to leave it in all builds.
PRs are squashed, no worries. |
It became a bit complex and we don't need the windows support, maybe it can be implemented by a eager user when the time comes. I have updated the PR to only include Linux/posix support now. |
The implementation in Mac/BSD require the usage of IPPROTO_IPV6 for IPV6 while the Linux implementation is more relaxed. Correcting the testcase to check the socket options IPPROTO_IPV6 for IPv6 sockets.
Running CI on multiple platforms is sure great.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for all the hard work, @bjosv!
@markdroth would you mind providing a second review?
The PR itself looks good to me, but I wonder whether this needs a gRFC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drfloob I'm gonna approve this but could you drive the conversation internally on whether this needs a grfc please?
I've already had that discussion with the core/C++ team TLs, and we decided it isn't necessary here. |
This adds a new channel argument `GRPC_ARG_DSCP` which allows users to create classified gRPC streams with a Differentiated Services Code Point (DSCP) marking on the IP frames. The channel argument is handled on both clients and servers, but currently only on posix based systems. Fixes grpc#17225 **Background**: In addition to what is already described is grpc#17225, when gRPC is used in telco systems there is often a need to classify streams of importance. There can be multiple hops between two endpoints (e.g. between 2 telecom operators) and some streams that are more important than others (e.g. emergency call related or similar). By marking the IP packets using DSCP the aware routers can make a sound decision of the prioritization. This PR propose to use DSCP as the configuration value since its common for both IPv4/IPv6, an alternative would be to use a config name that includes TOS and Traffic Class. There might be more needed regarding documentation and end2end testing, but there I need some advice. **References** https://datatracker.ietf.org/doc/html/rfc2474 https://www.iana.org/assignments/dscp-registry/dscp-registry.xhtml <!-- Your pull request will be routed to the following person by default for triaging. If you know who should review your pull request, please remove the mentioning below. --> @yashykt
This adds a new channel argument `GRPC_ARG_DSCP` which allows users to create classified gRPC streams with a Differentiated Services Code Point (DSCP) marking on the IP frames. The channel argument is handled on both clients and servers, but currently only on posix based systems. Fixes grpc#17225 **Background**: In addition to what is already described is grpc#17225, when gRPC is used in telco systems there is often a need to classify streams of importance. There can be multiple hops between two endpoints (e.g. between 2 telecom operators) and some streams that are more important than others (e.g. emergency call related or similar). By marking the IP packets using DSCP the aware routers can make a sound decision of the prioritization. This PR propose to use DSCP as the configuration value since its common for both IPv4/IPv6, an alternative would be to use a config name that includes TOS and Traffic Class. There might be more needed regarding documentation and end2end testing, but there I need some advice. **References** https://datatracker.ietf.org/doc/html/rfc2474 https://www.iana.org/assignments/dscp-registry/dscp-registry.xhtml <!-- Your pull request will be routed to the following person by default for triaging. If you know who should review your pull request, please remove the mentioning below. --> @yashykt
This adds a new channel argument `GRPC_ARG_DSCP` which allows users to create classified gRPC streams with a Differentiated Services Code Point (DSCP) marking on the IP frames. The channel argument is handled on both clients and servers, but currently only on posix based systems. Fixes grpc#17225 **Background**: In addition to what is already described is grpc#17225, when gRPC is used in telco systems there is often a need to classify streams of importance. There can be multiple hops between two endpoints (e.g. between 2 telecom operators) and some streams that are more important than others (e.g. emergency call related or similar). By marking the IP packets using DSCP the aware routers can make a sound decision of the prioritization. This PR propose to use DSCP as the configuration value since its common for both IPv4/IPv6, an alternative would be to use a config name that includes TOS and Traffic Class. There might be more needed regarding documentation and end2end testing, but there I need some advice. **References** https://datatracker.ietf.org/doc/html/rfc2474 https://www.iana.org/assignments/dscp-registry/dscp-registry.xhtml <!-- Your pull request will be routed to the following person by default for triaging. If you know who should review your pull request, please remove the mentioning below. --> @yashykt
This adds a new channel argument
GRPC_ARG_DSCP
which allows users to create classified gRPC streams with aDifferentiated Services Code Point (DSCP) marking on the IP frames.
The channel argument is handled on both clients and servers, but currently only on posix based systems.
Fixes #17225
Background:
In addition to what is already described is #17225, when gRPC is used in telco systems there is often a need to classify streams of importance. There can be multiple hops between two endpoints (e.g. between 2 telecom operators) and some streams that are more important than others (e.g. emergency call related or similar). By marking the IP packets using DSCP the aware routers can make a sound decision of the prioritization.
This PR propose to use DSCP as the configuration value since its common for both IPv4/IPv6, an alternative would be to use a config name that includes TOS and Traffic Class.
There might be more needed regarding documentation and end2end testing, but there I need some advice.
References
https://datatracker.ietf.org/doc/html/rfc2474
https://www.iana.org/assignments/dscp-registry/dscp-registry.xhtml
@yashykt