-
-
Notifications
You must be signed in to change notification settings - Fork 390
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 dangerous_packet_null_cipher feature to disable packet encryption. #1436
Add dangerous_packet_null_cipher feature to disable packet encryption. #1436
Conversation
Could you accomplish this with a custom |
i will take a look and get back when done. |
2d8adff
to
6226c54
Compare
As a reminder the goal of the patch is to disable packet encryption on the production code path to find hotspot on the production code path. I took some time to look at the various traits implemented in "quinn-proto/src/crypto/rustls.rs" and i think it will not achieve the previously listed goal (if i did not miss something obvious). We want the TLS session to be created and used as if packets were encrypted. The same patch could also be done to disable packet header protection (i plan to do a similar patch or update this one). If we implement a custom crypto Session, we still want to run the TLS handshake and ephemeral session key code as in production, this will need some kind of "inner: TlsSession" field to forward calls, doing this may/will lower performance as crypto::Session and associated Trait will need to be forwarded to call appropriate function on inner field. Doing so the tested code will not be the same as the production one without the packet encryption/decryption. I totally understand that this code is dangerous to commit as it must not be enabled in production, if you want you can keep the code as a patch/PR and use it when doing performance measurement in order to test or develop some optimizations. |
Why do you believe forwarding calls to an inner |
i will do a POC and see how it goes, but i think i may need to have Traits forwarding thus one more level of calls. |
6226c54
to
e2c47ed
Compare
Sorry for the delay but i was busy working on other topics. Here is an updated version with a custom |
The main benefit of achieving this with a custom |
Hi Ralith, just to be sure: you want me to go further and implement a full standalone session in perf sub-crate and add options to enable it ? |
Yes, I think that's the right way to implement this if you want it merged as part of this repo. |
Ok il will take a look and update the patch. I need to figure out how TlsSession is magically used as a rustls glue layer. |
There's no magic. The |
e2c47ed
to
19839bd
Compare
New version available with the custom crypto session localized in perf folder. It can be enabled using |
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.
Thanks, that's exactly what I had in mind.
So naming wise, I'm not so sure "null cipher" fits in? We don't use the term cipher anywhere else IIRC. Maybe no_crypto? |
perf/src/null.rs
Outdated
|
||
impl NullCiperServerConfig { | ||
pub fn new(config: Arc<rustls::ServerConfig>) -> Self { | ||
Self { inner: config } |
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.
Why are we storing a rustls config in here??
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.
See references to self.inner
below. In short, this logic creates a TLS session as usual but short-circuits the packet protection.
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.
Why don't we go whole hog and avoid all the TLS work?
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.
There is two reasons for this:
- we want to do everything TLS related (handshake, key rolling, ...) to see it in profile/flamegraph but we don't want the profile to be overwhelmed with the crypto operation
- doing like this require far less modification
What could also be bypassed is header protection and also packet tags as both of those operation also do some kind of crypto operations.
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.
Ah, okay, thanks.
i am open to any suggestion about naming, @Ralith what is your opinion ? |
19839bd
to
bbff9cb
Compare
Maybe |
Maybe NoEncryption to be close to this RFC/Draft https://datatracker.ietf.org/doc/html/draft-banks-quic-disable-encryption ? |
I am fine with NoProtection and maybe later a level or bitfield could be included as parameter to choose which part could be disabled (header / packet / tag). |
bbff9cb
to
db637b3
Compare
encryption / decryption. It can be enabled using --no-protection command line option. This can be use when doing performance tests to reveal other hotspots than packet encryption and decryption.
db637b3
to
b762d4b
Compare
This can be use when doing performance tests to reveal other hot-spots than packet encryption and decryption.
This is for testing purpose and should not be used in production.