refactor(datafmt): use "udp" instead of "quic" (#946)

This diff changes the data format to prefer "udp" to "quic" everywhere we were previously using "quic".

Previously, the code inconsistently used "quic" for operations where we knew we were using "quic" and "udp" otherwise (e.g., for generic operations like ReadFrom).

While it would be more correct to say that a specific HTTP request used "quic" rather than "udp", using "udp" consistently allows one to see how distinct events such as ReadFrom and an handshake all refer to the same address, port, and protocol triple. Therefore, this change makes it easier to programmatically unpack a single measurement and create endpoint stats.

Before implementing this change, I discussed the problem with @hellais who mentioned that ooni/data is not currently using the "quic" string anywhere. I know that ooni/pipeline also doesn't rely on this string. The only users of this feature have been research-oriented experiments such as urlgetter, for which such a change would actually be acceptable.

See https://github.com/ooni/probe/issues/2238 and https://github.com/ooni/spec/pull/262.
This commit is contained in:
Simone Basso
2022-09-08 17:19:59 +02:00
committed by GitHub
parent 800217d15b
commit b78b9aca51
21 changed files with 66 additions and 66 deletions
+16 -16
View File
@@ -89,12 +89,12 @@ Produces this JSON:
```JavaScript
{
// In chapter02 these two fields were similar but
// the network was "tcp" as opposed to "quic"
"network": "quic",
// the network was "tcp" as opposed to "udp"
"network": "udp",
"address": "8.8.4.4:443",
// This block contains I/O operations. Note that
// the protocol is "quic" and that the syscalls
// the protocol is "udp" and that the syscalls
// are "read_from" and "write_to" because QUIC does
// not bind/connect sockets. (The real syscalls
// are actually `recvfrom` and `sendto` but here
@@ -106,7 +106,7 @@ Produces this JSON:
"failure": null,
"num_bytes": 1252,
"operation": "write_to",
"proto": "quic",
"proto": "udp",
"t": 0.027184208,
"started": 0.027127208,
"oddity": ""
@@ -116,7 +116,7 @@ Produces this JSON:
"failure": null,
"num_bytes": 1252,
"operation": "read_from",
"proto": "quic",
"proto": "udp",
"t": 0.053116458,
"started": 0.025626583,
"oddity": ""
@@ -126,7 +126,7 @@ Produces this JSON:
"failure": null,
"num_bytes": 1252,
"operation": "write_to",
"proto": "quic",
"proto": "udp",
"t": 0.054538792,
"started": 0.054517542,
"oddity": ""
@@ -136,7 +136,7 @@ Produces this JSON:
"failure": null,
"num_bytes": 1252,
"operation": "read_from",
"proto": "quic",
"proto": "udp",
"t": 0.069144958,
"started": 0.053194208,
"oddity": ""
@@ -146,7 +146,7 @@ Produces this JSON:
"failure": null,
"num_bytes": 1252,
"operation": "read_from",
"proto": "quic",
"proto": "udp",
"t": 0.069183458,
"started": 0.069173292,
"oddity": ""
@@ -156,7 +156,7 @@ Produces this JSON:
"failure": null,
"num_bytes": 1252,
"operation": "read_from",
"proto": "quic",
"proto": "udp",
"t": 0.06920225,
"started": 0.069197875,
"oddity": ""
@@ -166,7 +166,7 @@ Produces this JSON:
"failure": null,
"num_bytes": 1216,
"operation": "read_from",
"proto": "quic",
"proto": "udp",
"t": 0.069210958,
"started": 0.069206875,
"oddity": ""
@@ -176,7 +176,7 @@ Produces this JSON:
"failure": null,
"num_bytes": 65,
"operation": "read_from",
"proto": "quic",
"proto": "udp",
"t": 0.069220667,
"started": 0.069217375,
"oddity": ""
@@ -186,7 +186,7 @@ Produces this JSON:
"failure": null,
"num_bytes": 44,
"operation": "write_to",
"proto": "quic",
"proto": "udp",
"t": 0.069433417,
"started": 0.069417625,
"oddity": ""
@@ -196,7 +196,7 @@ Produces this JSON:
"failure": null,
"num_bytes": 44,
"operation": "write_to",
"proto": "quic",
"proto": "udp",
"t": 0.069677625,
"started": 0.069647458,
"oddity": ""
@@ -206,7 +206,7 @@ Produces this JSON:
"failure": null,
"num_bytes": 83,
"operation": "write_to",
"proto": "quic",
"proto": "udp",
"t": 0.073461917,
"started": 0.073432875,
"oddity": ""
@@ -216,7 +216,7 @@ Produces this JSON:
"failure": null,
"num_bytes": 33,
"operation": "write_to",
"proto": "quic",
"proto": "udp",
"t": 0.073559417,
"started": 0.073542542,
"oddity": ""
@@ -253,7 +253,7 @@ Produces this JSON:
],
"no_tls_verify": false,
"oddity": "",
"proto": "quic",
"proto": "udp",
"started": 0.025061583
}
]
+16 -16
View File
@@ -90,12 +90,12 @@ func main() {
// ```JavaScript
// {
// // In chapter02 these two fields were similar but
// // the network was "tcp" as opposed to "quic"
// "network": "quic",
// // the network was "tcp" as opposed to "udp"
// "network": "udp",
// "address": "8.8.4.4:443",
//
// // This block contains I/O operations. Note that
// // the protocol is "quic" and that the syscalls
// // the protocol is "udp" and that the syscalls
// // are "read_from" and "write_to" because QUIC does
// // not bind/connect sockets. (The real syscalls
// // are actually `recvfrom` and `sendto` but here
@@ -107,7 +107,7 @@ func main() {
// "failure": null,
// "num_bytes": 1252,
// "operation": "write_to",
// "proto": "quic",
// "proto": "udp",
// "t": 0.027184208,
// "started": 0.027127208,
// "oddity": ""
@@ -117,7 +117,7 @@ func main() {
// "failure": null,
// "num_bytes": 1252,
// "operation": "read_from",
// "proto": "quic",
// "proto": "udp",
// "t": 0.053116458,
// "started": 0.025626583,
// "oddity": ""
@@ -127,7 +127,7 @@ func main() {
// "failure": null,
// "num_bytes": 1252,
// "operation": "write_to",
// "proto": "quic",
// "proto": "udp",
// "t": 0.054538792,
// "started": 0.054517542,
// "oddity": ""
@@ -137,7 +137,7 @@ func main() {
// "failure": null,
// "num_bytes": 1252,
// "operation": "read_from",
// "proto": "quic",
// "proto": "udp",
// "t": 0.069144958,
// "started": 0.053194208,
// "oddity": ""
@@ -147,7 +147,7 @@ func main() {
// "failure": null,
// "num_bytes": 1252,
// "operation": "read_from",
// "proto": "quic",
// "proto": "udp",
// "t": 0.069183458,
// "started": 0.069173292,
// "oddity": ""
@@ -157,7 +157,7 @@ func main() {
// "failure": null,
// "num_bytes": 1252,
// "operation": "read_from",
// "proto": "quic",
// "proto": "udp",
// "t": 0.06920225,
// "started": 0.069197875,
// "oddity": ""
@@ -167,7 +167,7 @@ func main() {
// "failure": null,
// "num_bytes": 1216,
// "operation": "read_from",
// "proto": "quic",
// "proto": "udp",
// "t": 0.069210958,
// "started": 0.069206875,
// "oddity": ""
@@ -177,7 +177,7 @@ func main() {
// "failure": null,
// "num_bytes": 65,
// "operation": "read_from",
// "proto": "quic",
// "proto": "udp",
// "t": 0.069220667,
// "started": 0.069217375,
// "oddity": ""
@@ -187,7 +187,7 @@ func main() {
// "failure": null,
// "num_bytes": 44,
// "operation": "write_to",
// "proto": "quic",
// "proto": "udp",
// "t": 0.069433417,
// "started": 0.069417625,
// "oddity": ""
@@ -197,7 +197,7 @@ func main() {
// "failure": null,
// "num_bytes": 44,
// "operation": "write_to",
// "proto": "quic",
// "proto": "udp",
// "t": 0.069677625,
// "started": 0.069647458,
// "oddity": ""
@@ -207,7 +207,7 @@ func main() {
// "failure": null,
// "num_bytes": 83,
// "operation": "write_to",
// "proto": "quic",
// "proto": "udp",
// "t": 0.073461917,
// "started": 0.073432875,
// "oddity": ""
@@ -217,7 +217,7 @@ func main() {
// "failure": null,
// "num_bytes": 33,
// "operation": "write_to",
// "proto": "quic",
// "proto": "udp",
// "t": 0.073559417,
// "started": 0.073542542,
// "oddity": ""
@@ -254,7 +254,7 @@ func main() {
// ],
// "no_tls_verify": false,
// "oddity": "",
// "proto": "quic",
// "proto": "udp",
// "started": 0.025061583
// }
// ]