openssl-qlog.pod 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. =pod
  2. =head1 NAME
  3. openssl-qlog - OpenSSL qlog tracing functionality
  4. =head1 DESCRIPTION
  5. OpenSSL has unstable support for generating logs in the qlog logging format,
  6. which can be used to obtain diagnostic data for QUIC connections. The data
  7. generated includes information on packets sent and received and the frames
  8. contained within them, as well as loss detection and other events.
  9. The qlog output generated by OpenSSL can be used to obtain diagnostic
  10. visualisations of a given QUIC connection using tools such as B<qvis>.
  11. B<WARNING:> The output of OpenSSL's qlog functionality uses an unstable format
  12. based on a draft specification. qlog output is not subject to any format
  13. stability or compatibility guarantees at this time, and B<will> change in
  14. incompatible ways in future versions of OpenSSL. See B<FORMAT STABILITY> below
  15. for details.
  16. =head1 USAGE
  17. When OpenSSL is built with qlog support, qlog is enabled at run time by setting
  18. the standard B<QLOGDIR> environment variable to point to a directory where qlog
  19. files should be written. Once set, any QUIC connection established by OpenSSL
  20. will have a qlog file written automatically to the specified directory.
  21. Log files are generated in the I<.sqlog> format based on JSON-SEQ (RFC 7464).
  22. The filenames of generated log files under the specified B<QLOGDIR> use the
  23. following structure:
  24. {connection_odcid}_{vantage_point_type}.sqlog
  25. where B<{connection_odcid}> is the lowercase hexadecimal encoding of a QUIC
  26. connection's Original Destination Connection ID, which is the Destination
  27. Connection ID used in the header of the first Initial packet sent as part of the
  28. connection process, and B<{vantage_point_type}> is either C<client> or
  29. C<server>, reflecting the perspective of the endpoint producing the qlog output.
  30. The qlog functionality can be disabled at OpenSSL build time using the
  31. I<no-unstable-qlog> configure flag.
  32. =head1 SUPPORTED EVENT TYPES
  33. The following event types are currently supported:
  34. =over 4
  35. =item B<connectivity:connection_started>
  36. =item B<connectivity:connection_state_updated>
  37. =item B<connectivity:connection_closed>
  38. =item B<transport:parameters_set>
  39. =item B<transport:packet_sent>
  40. =item B<transport:packet_received>
  41. =item B<recovery:packet_lost>
  42. =back
  43. =head1 FILTERS
  44. By default, all supported event types are logged. The B<OSSL_QFILTER>
  45. environment variable can be used to configure a filter specification which
  46. determines which event types are to be logged. Each event type can be turned on
  47. and off individually. The filter specification is a space-separated list of
  48. terms listing event types to enable or disable. The terms are applied in order,
  49. thus the effects of later terms override the effects of earlier terms.
  50. =head2 Examples
  51. Here are some example filter specifications:
  52. =over 4
  53. =item C<*> (or C<+*>)
  54. Enable all supported qlog event types.
  55. =item C<-*>
  56. Disable all qlog event types.
  57. =item C<* -transport:packet_received>
  58. Enable all qlog event types, but disable the B<transport:packet_received> event
  59. type.
  60. =item C<-* transport:packet_sent>
  61. Disable all qlog event types, except for the B<transport:packet_sent> event type.
  62. =item C<-* connectivity:* transport:parameters_set>
  63. Disable all qlog event types, except for B<transport:parameters_set> and all
  64. supported event types in the B<connectivity> category.
  65. =back
  66. =head2 Filter Syntax Specification
  67. Formally, the format of the filter specification in ABNF is as follows:
  68. filter = *filter-term
  69. filter-term = add-sub-term
  70. add-sub-term = ["-" / "+"] specifier
  71. specifier = global-specifier / qualified-specifier
  72. global-specifier = wildcard
  73. qualified-specifier = component-specifier ":" component-specifier
  74. component-specifier = name / wildcard
  75. wildcard = "*"
  76. name = 1*(ALPHA / DIGIT / "_" / "-")
  77. Filter terms are interpreted as follows:
  78. =over 4
  79. =item C<+*> (or C<*>)
  80. Enables all event types.
  81. =item C<-*>
  82. Disables all event types.
  83. =item C<+foo:*> (or C<foo:*>)
  84. Enables all event types in the B<foo> category.
  85. =item C<-foo:*>
  86. Disables all event types in the B<foo> category.
  87. =item C<+foo:bar> (or C<foo:bar>)
  88. Enables a specific event type B<foo:bar>.
  89. =item C<-foo:bar>
  90. Disables a specific event type B<foo:bar>.
  91. =back
  92. Partial wildcard matches are not supported at this time.
  93. =head2 Default Configuration
  94. If the B<OSSL_QFILTER> environment variable is not set or set to the empty
  95. string, this is equivalent to enabling all event types (i.e., it is equivalent
  96. to a filter of C<*>). Note that the B<QLOGDIR> environment variable must also be
  97. set to enable qlog.
  98. =head1 FORMAT STABILITY
  99. The OpenSSL qlog functionality currently implements a draft version of the qlog
  100. specification. Future revisions to the qlog specification in advance of formal
  101. standardisation are expected to introduce incompatible and breaking changes to
  102. the qlog format. The OpenSSL qlog functionality will transition to producing
  103. output in this format in the future once standardisation is complete.
  104. Because of this, the qlog output of OpenSSL B<will> change in incompatible and
  105. breaking ways in the future, including in non-major releases of OpenSSL. The
  106. qlog output of OpenSSL is considered unstable and not subject to any format
  107. stability or compatibility guarantees at this time.
  108. Users of the OpenSSL qlog functionality must be aware that the output may change
  109. arbitrarily between releases and that the preservation of compatibility with any
  110. given tool between releases is not guaranteed.
  111. =head2 Aims
  112. The OpenSSL draft qlog functionality is primarily intended for use in
  113. conjunction with the qvis tool L<https://qvis.quictools.info/>. In terms of
  114. format compatibility, the output format of the OpenSSL qlog functionality is
  115. expected to track what is supported by qvis. As such, future changes to the
  116. output of the OpenSSL qlog functionality are expected to track changes in qvis
  117. as they occur, and reflect the versions of qlog currently supported by qvis.
  118. This means that prior to the finalisation of the qlog standard, in the event of
  119. a disparity between the current draft and what qvis supports, the OpenSSL qlog
  120. functionality will generally aim for qvis compatibility over compliance with the
  121. latest draft.
  122. As such, OpenSSL's qlog functionality currently implements qlog version 0.3 as
  123. defined in B<draft-ietf-quic-qlog-main-schema-05> and
  124. B<draft-ietf-quic-qlog-quic-events-04>. These revisions are intentionally used
  125. instead of more recent revisions due to their qvis compatibility.
  126. =head1 LIMITATIONS
  127. The OpenSSL implementation of qlog currently has the following limitations:
  128. =over 4
  129. =item
  130. Not all event types defined by the draft specification are implemented.
  131. =item
  132. Only the JSON-SEQ (B<.sqlog>) output format is supported.
  133. =item
  134. Only the B<QLOGDIR> environment variable is supported for configuring the qlog
  135. output directory. The standard B<QLOGFILE> environment variable is not
  136. supported.
  137. =item
  138. There is no API for programmatically enabling or controlling the qlog
  139. functionality.
  140. =back
  141. =head1 SEE ALSO
  142. L<openssl-quic(7)>, L<openssl-env(7)>
  143. =head1 HISTORY
  144. This functionality was added in OpenSSL 3.3.
  145. =head1 COPYRIGHT
  146. Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
  147. Licensed under the Apache License 2.0 (the "License"). You may not use
  148. this file except in compliance with the License. You can obtain a copy
  149. in the file LICENSE in the source distribution or at
  150. L<https://www.openssl.org/source/license.html>.
  151. =cut