Skip to content

udp: add router for UDP proxy#17864

Closed
zhxie wants to merge 12 commits intoenvoyproxy:mainfrom
zhxie:udp-proxy-router
Closed

udp: add router for UDP proxy#17864
zhxie wants to merge 12 commits intoenvoyproxy:mainfrom
zhxie:udp-proxy-router

Conversation

@zhxie
Copy link
Copy Markdown
Contributor

@zhxie zhxie commented Aug 26, 2021

Commit Message: udp: add router for UDP proxy
Additional Description: match source prefix and route UDP packets to different clusters
Risk Level: Low
Testing: Unit and integration
Docs Changes: N/A
Release Notes: WIP
Platform Specific Features: N/A
Fixes #17652
Deprecated: the envoy::extensions::filters::udp::udp_proxy::v3::UdpProxyConfig::cluster is deprecated in favor of envoy::extensions::filters::udp::udp_proxy::v3::UdpProxyConfig::route_config

zhxie added 5 commits August 26, 2021 11:27
Signed-off-by: Xie Zhihao <zhihao.xie@intel.com>
Signed-off-by: Xie Zhihao <zhihao.xie@intel.com>
Signed-off-by: Xie Zhihao <zhihao.xie@intel.com>
Signed-off-by: Xie Zhihao <zhihao.xie@intel.com>
Signed-off-by: Xie Zhihao <zhihao.xie@intel.com>
@repokitteh-read-only
Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #17864 was opened by zhxie.

see: more, trace.

@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/envoy/.
envoyproxy/api-shepherds assignee is @adisuissa
CC @envoyproxy/api-watchers: FYI only for changes made to api/envoy/.

🐱

Caused by: #17864 was opened by zhxie.

see: more, trace.

zhxie added 3 commits August 26, 2021 13:09
Signed-off-by: Xie Zhihao <zhihao.xie@intel.com>
Signed-off-by: Xie Zhihao <zhihao.xie@intel.com>
Signed-off-by: Xie Zhihao <zhihao.xie@intel.com>
@zhxie zhxie changed the title udp: add UDP router udp: add router for UDP proxy Aug 26, 2021
Signed-off-by: Xie Zhihao <zhihao.xie@intel.com>
@zhxie zhxie marked this pull request as ready for review August 26, 2021 11:53
@zhxie zhxie requested a review from mattklein123 as a code owner August 26, 2021 11:53
@mattklein123 mattklein123 self-assigned this Aug 26, 2021
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. Starting out with some API comments.

/wait

@@ -51,6 +52,9 @@ message UdpProxyConfig {

// The upstream cluster to connect to.
string cluster = 2 [(validate.rules).string = {min_len: 1}];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you deprecate cluster since I think any direct cluster route can be expressed via the new route table?

// [#protodoc-title: UDP proxy route configuration]
// UDP proxy :ref:`configuration overview <config_udp_listener_filters_udp_proxy>`.

message RouteConfiguration {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think for this we should go straight to using the new style matchers as there is no reason here not to support sub-linear matching for CIDR ranges, etc. Can you take a look at #17633 and replicate that here? Obviously some matchers won't be supported and we will have to deal with that, but many would be. cc @snowp who can help with questions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have noticed these components, but they focus on HTTP and may be not suitable for UDP. In fact, network filters have their own route matchers like RocketMQ route configuration for RocketMQ proxy and Thrift route configuration for Thrift proxy. UDP proxy is a UDP listener filter which is similar to network filters, so I am not sure if we can use these new style matchers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The new matching API was developed in order to avoid each protocol from having to define their own matching APIs - the API itself should not be HTTP specific, only loosely coupled with HTTP through extensions and the context in which they are used. Happy to chat more about how we can make use of the new API in this context.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That sounds great! A unified matcher API will bring convenience to development. In UDP, we mainly consider the source prefix and source port.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yup as Snow said, the new API was designed for this purpose, so let's please switch to it, even if we only support a small subset of matchers.

/wait

zhxie added 3 commits August 27, 2021 11:18
Signed-off-by: Xie Zhihao <zhihao.xie@intel.com>
Signed-off-by: Xie Zhihao <zhihao.xie@intel.com>
Signed-off-by: Xie Zhihao <zhihao.xie@intel.com>
@github-actions
Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Sep 26, 2021
@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 3, 2021

This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api stale stalebot believes this issue/PR has not been touched recently waiting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Route UDP packets to different upstreams based on origin IP

4 participants