Skip to content

Conversation

@camshaft
Copy link
Contributor

@camshaft camshaft commented Jun 22, 2023

Description of changes:

When doing performance testing, it can be helpful to disable crypto entirely in order to isolate and identify bottlenecks.

This change adds a private TLS provider that simply exchanges transport parameters over cleartext and doesn't encrypt anything. This has somewhat similar goals as the quic-disable-encryption draft, but is quite a bit simpler since it doesn't do any negotiation or handshaking.

Testing:

I added an integration test to make sure the null TLS provider negotiated with itself. I also added support for using it in the qns application to make it easier to benchmark.

$ ./target/release/s2n-quic-qns perf server --ip 192.167.1.10 --port 4433 --stats --max-throughput 1000 --tls null
$ ./target/release/s2n-quic-qns perf client --ip 192.167.1.10 --port 4433 --receive 10000000000000000000 --stats --max-throughput 1500 --tls null

Send

flamegraph

Send (XDP)

flamegraph

Receive

flamegraph

Receive (XDP)

flamegraph

Tx Rate	Rx Rate	Max Cwnd	Max Inflight	Lost Packets	Wakeups	Duration	Max RTT	Max SRTT	PTO Count	Max Pacing Rate	Max Delivery Rate
37.78Gbps       0bps    6.61MB  6.61MB  105     2586    26.874ms        2.205ms 1.198237ms      0       0bps    0bps
37.46Gbps       0bps    6.71MB  6.71MB  167     2591    26.574ms        4.069ms 2.226255ms      0       27.31Gbps       0bps
37.80Gbps       0bps    6.65MB  6.65MB  93      2613    26.81ms 2.205ms 1.206517ms      0       0bps    0bps
37.57Gbps       0bps    6.65MB  6.65MB  203     2564    26.709ms        2.331ms 1.939357ms      0       0bps    0bps
37.45Gbps       0bps    6.62MB  6.61MB  167     2533    26.588ms        3.99ms  2.262232ms      0       28.05Gbps       0bps
37.79Gbps       0bps    6.66MB  6.66MB  97      2606    26.549ms        2.213ms 1.224121ms      9       0bps    0bps
37.86Gbps       0bps    6.60MB  6.59MB  123     2520    26.723ms        2.113ms 1.186678ms      0       0bps    0bps
37.43Gbps       0bps    6.66MB  6.66MB  223     2532    26.622ms        2.374ms 1.974841ms      0       0bps    0bps
37.48Gbps       0bps    6.80MB  6.87MB  131     2611    631µs   4.03ms  2.436432ms      10      30.01Gbps       0bps
37.88Gbps       0bps    6.57MB  6.56MB  167     2649    26.725ms        2.006ms 2.214737ms      0       31.27Gbps       0bps
37.46Gbps       0bps    6.80MB  6.87MB  230     2520    26.632ms        3.282ms 2.029627ms      10      22.57Gbps       0bps
37.44Gbps       0bps    6.62MB  6.61MB  90      2484    26.694ms        3.338ms 2.040467ms      0       23.81Gbps       0bps
37.95Gbps       0bps    6.62MB  6.62MB  158     2613    26.605ms        2.325ms 1.198464ms      0       0bps    0bps
37.33Gbps       0bps    6.64MB  6.64MB  175     2544    26.707ms        3.157ms 2.409539ms      0       30.01Gbps       0bps
37.40Gbps       0bps    6.64MB  6.64MB  225     2520    26.897ms        3.257ms 2.469882ms      0       31.75Gbps       0bps
37.94Gbps       0bps    6.68MB  6.68MB  120     2581    26.613ms        2.138ms 1.203878ms      0       0bps    0bps
37.41Gbps       0bps    6.66MB  6.66MB  72      2523    26.6ms  4.13ms  1.739614ms      0       0bps    0bps
37.82Gbps       0bps    6.64MB  6.63MB  188     2539    31.497ms        4.749ms 1.683957ms      0       0bps    0bps
37.47Gbps       0bps    6.65MB  6.64MB  303     2553    26.638ms        2.613ms 1.815557ms      0       0bps    0bps
37.39Gbps       0bps    6.64MB  6.64MB  113     2516    26.51ms 4.144ms 2.179126ms      10      26.60Gbps       0bps
37.87Gbps       0bps    6.68MB  6.68MB  182     2605    26.668ms        2.175ms 1.17278ms       0       0bps    0bps
$ iperf3 -s -p 4433
-----------------------------------------------------------
Server listening on 4433 (test #1)
-----------------------------------------------------------
Accepted connection from 192.167.1.20, port 39380
[  5] local 192.167.1.10 port 4433 connected to 192.167.1.20 port 39390
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  4.82 GBytes  41.4 Gbits/sec
[  5]   1.00-2.00   sec  4.87 GBytes  41.9 Gbits/sec
[  5]   2.00-3.00   sec  4.85 GBytes  41.7 Gbits/sec
[  5]   3.00-4.00   sec  4.81 GBytes  41.3 Gbits/sec
[  5]   4.00-5.00   sec  4.85 GBytes  41.6 Gbits/sec
[  5]   5.00-6.00   sec  4.86 GBytes  41.7 Gbits/sec
[  5]   6.00-7.00   sec  4.84 GBytes  41.5 Gbits/sec
[  5]   7.00-8.00   sec  4.79 GBytes  41.2 Gbits/sec
[  5]   8.00-9.00   sec  4.73 GBytes  40.6 Gbits/sec
[  5]   9.00-10.00  sec  4.86 GBytes  41.8 Gbits/sec

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@camshaft camshaft force-pushed the camshaft/no-tls-test branch 4 times, most recently from f1c699c to 4fbd614 Compare June 23, 2023 21:56
@camshaft camshaft marked this pull request as ready for review June 23, 2023 21:58
@camshaft camshaft force-pushed the camshaft/no-tls-test branch from 4fbd614 to 9a27e81 Compare June 26, 2023 18:22
@camshaft camshaft requested a review from toidiu June 27, 2023 15:02
@camshaft camshaft force-pushed the camshaft/no-tls-test branch from 9a27e81 to 2eece61 Compare June 27, 2023 21:34
@camshaft camshaft requested review from WesleyRosenblum and removed request for toidiu June 30, 2023 00:08
Copy link
Contributor

@WesleyRosenblum WesleyRosenblum left a comment

Choose a reason for hiding this comment

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

Opened #1857 to add to the CI, as discussed offline

fn new_server_session<Params: s2n_codec::EncoderValue>(
&mut self,
transport_parameters: &Params,
) -> Self::Session {
Copy link
Contributor

Choose a reason for hiding this comment

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

do you think its worth a println here and in new_client_session just warning that a null TLS session has been initiated that will not perform any encryption?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my worry is if we're testing the connection creation latency outside of crypto it would also affect the measurement since we're printing to the console

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually thinking about it a bit, I'll put it in the Endpoint::default() method, since that's only created at start up.

@camshaft camshaft force-pushed the camshaft/no-tls-test branch from 2eece61 to 274b7f7 Compare June 30, 2023 23:24
@camshaft camshaft force-pushed the camshaft/no-tls-test branch from 274b7f7 to e41b09a Compare June 30, 2023 23:26
Comment on lines 63 to 64
eprintln!(" An s2n-quic endpoint has configured without cryptographic protections.");
eprintln!(" This should ONLY be used for testing purposed only.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
eprintln!(" An s2n-quic endpoint has configured without cryptographic protections.");
eprintln!(" This should ONLY be used for testing purposed only.");
eprintln!(" An s2n-quic endpoint has been configured without cryptographic protections.");
eprintln!(" This should ONLY be used for testing purposes.");

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.

2 participants