ref: Move to NaclBox for channel encryption and move versions out of endpoints.
This change does several things:
1) Create a new endpoint version (version 5) this will eventually
replace all previous endpoint version and the only valid format.
The difference from v4 is the removal of versioning information.
2) Switch to NaclBox for channel encryption.
3) Change the low level protocol to use SetupVC instead of OpenVC for
new messages. This does version and encryption negotiation all
at once as the first thing on a new VC..
There are several reasons for this change:
1) We save round-trips vs TLS.
2) Versioning is reliable since it's negotiated. This is compared
to now where the root mounttable must be updated before new
clients are deployed. This has proven an unrealistic requirement.
Old benchmarks:
Benchmark_dial_VC_TLS 100 36758152 ns/op
--- Histogram (unit: ms)
Count: 100 Min: 22 Max: 49 Avg: 36.21
------------------------------------------------------------
[ 22, 23) 1 1.0% 1.0%
[ 23, 24) 0 0.0% 1.0%
[ 24, 25) 0 0.0% 1.0%
[ 25, 26) 0 0.0% 1.0%
[ 26, 28) 0 0.0% 1.0%
[ 28, 31) 5 5.0% 6.0% #
[ 31, 34) 38 38.0% 44.0% ####
[ 34, 38) 14 14.0% 58.0% #
[ 38, 43) 28 28.0% 86.0% ###
[ 43, 50) 14 14.0% 100.0% #
[ 50, 59) 0 0.0% 100.0%
[ 59, 70) 0 0.0% 100.0%
[ 70, 83) 0 0.0% 100.0%
[ 83, 100) 0 0.0% 100.0%
[100, 121) 0 0.0% 100.0%
[121, 148) 0 0.0% 100.0%
[148, inf) 0 0.0% 100.0%
Benchmark_throughput_Flow_1VIF_1VC_1Flow 50000 36354 ns/op 1408.36 MB/s
Benchmark_throughput_Flow_1VIF_1VC_2Flow 50000 36849 ns/op 1389.43 MB/s
Benchmark_throughput_Flow_1VIF_1VC_8Flow 30000 44898 ns/op 1140.35 MB/s
Benchmark_throughput_Flow_1VIF_2VC_2Flow 50000 37180 ns/op 1377.06 MB/s
Benchmark_throughput_Flow_1VIF_2VC_8Flow 30000 44599 ns/op 1147.99 MB/s
Benchmark_throughput_Flow_2VIF_4VC_8Flow 30000 44945 ns/op 1139.15 MB/s
Benchmark_throughput_Flow_1VIF_1VC_1FlowTLS 3000 543051 ns/op 94.28 MB/s
Benchmark_throughput_Flow_1VIF_1VC_2FlowTLS 3000 534945 ns/op 95.71 MB/s
Benchmark_throughput_Flow_1VIF_1VC_8FlowTLS 3000 552158 ns/op 92.73 MB/s
Benchmark_throughput_Flow_1VIF_2VC_2FlowTLS 3000 760363 ns/op 67.34 MB/s
Benchmark_throughput_Flow_1VIF_2VC_8FlowTLS 3000 462552 ns/op 110.69 MB/s
Benchmark_throughput_Flow_2VIF_4VC_8FlowTLS 3000 463113 ns/op 110.56 MB/s
ok v.io/x/ref/profiles/internal/rpc/stream/benchmark 37.809s
New benchmarks:
--- Histogram (unit: ms)
Count: 100 Min: 14 Max: 39 Avg: 30.63
------------------------------------------------------------
[ 14, 15) 1 1.0% 1.0%
[ 15, 16) 0 0.0% 1.0%
[ 16, 17) 0 0.0% 1.0%
[ 17, 18) 0 0.0% 1.0%
[ 18, 20) 0 0.0% 1.0%
[ 20, 22) 0 0.0% 1.0%
[ 22, 25) 0 0.0% 1.0%
[ 25, 29) 0 0.0% 1.0%
[ 29, 34) 97 97.0% 98.0% ##########
[ 34, 40) 2 2.0% 100.0%
[ 40, 48) 0 0.0% 100.0%
[ 48, 58) 0 0.0% 100.0%
[ 58, 71) 0 0.0% 100.0%
[ 71, 87) 0 0.0% 100.0%
[ 87, 107) 0 0.0% 100.0%
[107, 131) 0 0.0% 100.0%
[131, inf) 0 0.0% 100.0%
Benchmark_throughput_Flow_1VIF_1VC_1Flow 50000 32806 ns/op 1560.65 MB/s
Benchmark_throughput_Flow_1VIF_1VC_2Flow 50000 31752 ns/op 1612.47 MB/s
Benchmark_throughput_Flow_1VIF_1VC_8Flow 50000 39765 ns/op 1287.54 MB/s
Benchmark_throughput_Flow_1VIF_2VC_2Flow 50000 31967 ns/op 1601.62 MB/s
Benchmark_throughput_Flow_1VIF_2VC_8Flow 50000 39513 ns/op 1295.74 MB/s
Benchmark_throughput_Flow_2VIF_4VC_8Flow 30000 40676 ns/op 1258.72 MB/s
Benchmark_throughput_Flow_1VIF_1VC_1FlowTLS 10000 237259 ns/op 215.80 MB/s
Benchmark_throughput_Flow_1VIF_1VC_2FlowTLS 10000 233769 ns/op 219.02 MB/s
Benchmark_throughput_Flow_1VIF_1VC_8FlowTLS 10000 244584 ns/op 209.33 MB/s
Benchmark_throughput_Flow_1VIF_2VC_2FlowTLS 10000 235281 ns/op 217.61 MB/s
Benchmark_throughput_Flow_1VIF_2VC_8FlowTLS 10000 238344 ns/op 214.81 MB/s
Benchmark_throughput_Flow_2VIF_4VC_8FlowTLS 10000 239573 ns/op 213.71 MB/s
ok v.io/x/ref/profiles/internal/rpc/stream/benchmark 39.893s
MultiPart: 2/2
Change-Id: Ia2397c445116d12d0b037ad65f686ddd9846f33b
19 files changed