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

allow additional network filters for QUIC listeners #22722

Merged
merged 11 commits into from
Aug 23, 2022

Conversation

pksohn
Copy link
Contributor

@pksohn pksohn commented Aug 16, 2022

Signed-off-by: Paul Sohn paulsohn@google.com

Commit Message: For QUIC listeners, allow network filters to be added before HTTP Connection Manager
Additional Description: Note that onData() is still never called on QUIC.
Risk Level: Low
Testing: Unit test
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Paul Sohn <paulsohn@google.com>
@repokitteh-read-only
Copy link

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: #22722 was opened by pksohn.

see: more, trace.

@pksohn pksohn marked this pull request as ready for review August 16, 2022 13:57
Copy link
Contributor

@danzh2010 danzh2010 left a comment

Choose a reason for hiding this comment

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

LGTM overall!
Can you document here

that the filters in UDP connections will be created but not process payload as TCP connections do?

@danzh2010
Copy link
Contributor

Plz also fix the clang-tidy CI

Signed-off-by: Paul Sohn <paulsohn@google.com>
Signed-off-by: Paul Sohn <paulsohn@google.com>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @mattklein123
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #22722 was synchronize by pksohn.

see: more, trace.

Copy link
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 generally makes sense with a few comments.

/wait

Comment on lines 231 to 233
// For UDP connections, network filters can be created but do not process
// incoming data as network filters on TCP connections do (i.e. the onData method
// will never be called).
Copy link
Member

Choose a reason for hiding this comment

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

What's the point of this? I assume just for things like RBAC where decisions can be made at the point of initial connection? If so can you clarify? Also, do you want to phrase it more like network filters do not currently process incoming network data? As we might fix this in the future?

Can you also add a release note about this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably we shouldn't generalize it to all UDP-based connections, but be explicit about QUIC. Today QUIC doesn't pass the connection payload to network filter interface onData() because the connection itself handles multiplexing and HTTP parsing. QUIC may support non-http protocols in the future, but multiplexing always happens at L4. So QUIC L4 filters are very likely to have a different set of interfaces. So far we don't really need any L4 filter interfaces, that's why we have only allowed HCM to be installed. But we have a use case now where L4 filters can change the connection transport properties, like cwnd or socket options at the beginning of the connection. This still won't use any L4 interfaces other than the constructor. So we want to relax the constraint here.

Copy link
Member

Choose a reason for hiding this comment

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

OK makes sense. Yes let's please be much more clear about what is supported and also add an integration test. Thank you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks both. I've added a release note and tried to clarify the wording (let me know if you have further suggestions). I'll add an integration test next.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added an integration test; please take a look.

Signed-off-by: Paul Sohn <paulsohn@google.com>
Signed-off-by: Paul Sohn <paulsohn@google.com>
Signed-off-by: Paul Sohn <paulsohn@google.com>
// For QUIC listeners, network filters can be created, but due to differences
// in the connection implementation compared to TCP, the onData() method will
// never be called. Therefore network filters for QUIC listeners should only
// expect to do work at the start of a new connection (i.e. in onNewConnection()).
Copy link
Member

Choose a reason for hiding this comment

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

it would be good to mention, the HCM required to be the last filter for udp.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks

Signed-off-by: Paul Sohn <paulsohn@google.com>
Signed-off-by: Paul Sohn <paulsohn@google.com>
danzh2010
danzh2010 previously approved these changes Aug 23, 2022
Copy link
Contributor

@danzh2010 danzh2010 left a comment

Choose a reason for hiding this comment

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

LGTM!

soulxu
soulxu previously approved these changes Aug 23, 2022
Copy link
Member

@soulxu soulxu 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 the update! one more small comment

// to TCP, the onData() method will never be called. Therefore, network filters
// for QUIC listeners should only expect to do work at the start of a new connection
// (i.e. in onNewConnection()). If there are multiple network filters, HCM must be
// the last filter in the chain.
Copy link
Member

@soulxu soulxu Aug 23, 2022

Choose a reason for hiding this comment

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

If there are multiple network filters this doesn't seems accurate, the HCM must be there and being the last one for QUIC, whatever there is only one filter or multiple filter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, added another clarification.

Signed-off-by: Paul Sohn <paulsohn@google.com>
Signed-off-by: Paul Sohn <paulsohn@google.com>
@pksohn pksohn dismissed stale reviews from soulxu and danzh2010 via 18637c3 August 23, 2022 15:13
Signed-off-by: Paul Sohn <paulsohn@google.com>
Copy link
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, LGTM!

@mattklein123 mattklein123 merged commit 237f84a into envoyproxy:main Aug 23, 2022
RyanTheOptimist pushed a commit that referenced this pull request Feb 1, 2023
Commit Message: Update comment re: QUIC network filters
Additional Description: This comment is out of date since #22722.

Signed-off-by: Paul Sohn <paulsohn@google.com>
VishalDamgude pushed a commit to freshworks/envoy that referenced this pull request Feb 2, 2023
Commit Message: Update comment re: QUIC network filters
Additional Description: This comment is out of date since envoyproxy#22722.

Signed-off-by: Paul Sohn <paulsohn@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants