summaryrefslogtreecommitdiffhomepage
path: root/src/event/quic/ngx_event_quic_transport.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2025-05-23QUIC: ssl_encryption_level_t abstraction layer.Sergey Kandaurov1-5/+5
Encryption level values are decoupled from ssl_encryption_level_t, which is now limited to BoringSSL QUIC callbacks, with mappings provided. Although the values match, this provides a technically safe approach, in particular, to access protection level sized arrays. In preparation for using OpenSSL 3.5 TLS callbacks.
2025-04-15QUIC: do not shrink congestion window after losing an MTU probe.Roman Arutyunyan1-0/+1
As per RFC 9000, Section 14.4: Loss of a QUIC packet that is carried in a PMTU probe is therefore not a reliable indication of congestion and SHOULD NOT trigger a congestion control reaction.
2023-11-30QUIC: ngx_quic_frame_t time fields cleanup.Roman Arutyunyan1-2/+1
The field "first" is removed. It's unused since 909b989ec088. The field "last" is renamed to "send_time". It holds frame send time.
2023-11-29QUIC: congestion control in ngx_quic_frame_sendto().Roman Arutyunyan1-0/+1
Previously ngx_quic_frame_sendto() ignored congestion control and did not contribute to in_flight counter. Now congestion control window is checked unless ignore_congestion flag is set. Also, in_flight counter is incremented and the frame is stored in ctx->sent queue if it's ack-eliciting. This behavior is now similar to ngx_quic_output_packet().
2023-11-22QUIC: ignore duplicate PATH_CHALLENGE frames.Roman Arutyunyan1-0/+1
According to RFC 9000, an endpoint SHOULD NOT send multiple PATH_CHALLENGE frames in a single packet. The change adds a check to enforce this claim to optimize server behavior. Previously each PATH_CHALLENGE always resulted in a single response datagram being sent to client. The effect of this was however limited by QUIC flood protection. Also, PATH_CHALLENGE is explicitly disabled in Initial and Handshake levels, see RFC 9000, Table 3. However, technically it may be sent by client in 0-RTT over a new path without actual migration, even though the migration itself is prohibited during handshake. This allows client to coalesce multiple 0-RTT packets each carrying a PATH_CHALLENGE and end up with multiple PATH_CHALLENGEs per datagram. This again leads to suboptimal behavior, see above. Since the purpose of sending PATH_CHALLENGE frames in 0-RTT is unclear, these frames are now only allowed in 1-RTT. For 0-RTT they are silently ignored.
2023-08-14QUIC: fixed probe-congestion deadlock.Roman Arutyunyan1-1/+0
When probe timeout expired while congestion window was exhausted, probe PINGs could not be sent. As a result, lost packets could not be declared lost and congestion window could not be freed for new packets. This deadlock continued until connection idle timeout expiration. Now PINGs are sent separately from the frame queue without congestion control, as specified by RFC 9002, Section 7: An endpoint MUST NOT send a packet if it would cause bytes_in_flight (see Appendix B.2) to be larger than the congestion window, unless the packet is sent on a PTO timer expiration (see Section 6.2) or when entering recovery (see Section 7.3.2).
2023-01-31QUIC: fixed broken token in NEW_TOKEN (ticket #2446).Roman Arutyunyan1-1/+0
Previously, since 3550b00d9dc8, the token was allocated on stack, to get rid of pool usage. Now the token is allocated by ngx_quic_copy_buffer() in QUIC buffers, also used for STREAM, CRYPTO and ACK frames.
2022-05-31QUIC: avoided pool usage in token calculation.Vladimir Homutov1-0/+1
2022-01-19QUIC: reworked migration handling.Vladimir Homutov1-0/+2
The quic connection now holds active, backup and probe paths instead of sockets. The number of migration paths is now limited and cannot be inflated by a bad client or an attacker. The client id is now associated with path rather than socket. This allows to simplify processing of output and connection ids handling. New migration abandons any previously started migrations. This allows to free consumed client ids and request new for use in future migrations and make progress in case when connection id limit is hit during migration. A path now can be revalidated without losing its state. The patch also fixes various issues with NAT rebinding case handling: - paths are now validated (previously, there was no validation and paths were left in limited state) - attempt to reuse id on different path is now again verified (this was broken in 40445fc7c403) - former path is now validated in case of apparent migration
2021-12-06QUIC: simplified configuration.Vladimir Homutov1-0/+27
Directives that set transport parameters are removed from the configuration. Corresponding values are derived from the quic configuration or initialized to default. Whenever possible, quic configuration parameters are taken from higher-level protocol settings, i.e. HTTP/3.
2021-11-29QUIC: refactored multiple QUIC packets handling.Vladimir Homutov1-0/+1
Single UDP datagram may contain multiple QUIC datagrams. In order to facilitate handling of such cases, 'first' flag in the ngx_quic_header_t structure is introduced.
2021-11-10QUIC: removed ngx_quic_error_text() declaration.Vladimir Homutov1-2/+0
This is a leftover from cab3b7a070ef.
2021-11-10QUIC: removed dead code.Vladimir Homutov1-2/+0
The function is no longer used since b3d9e57d0f62.
2021-10-07QUIC: refactored packet creation.Vladimir Homutov1-1/+3
The "min" and "max" arguments refer to UDP datagram size. Generating payload requires to account properly for header size, which is variable and depends on payload size and packet number.
2021-07-28QUIC: handle EAGAIN properly on UDP sockets.Vladimir Homutov1-0/+1
Previously, the error was ignored leading to unnecessary retransmits. Now, unsent frames are returned into output queue, state is reset, and timer is started for the next send attempt.
2021-07-28QUIC: eliminated stream type from ngx_quic_stream_frame_t.Roman Arutyunyan1-2/+1
The information about the type is contained in off/len/fin bits. Also, where possible, only the first stream type (0x08) is used for simplicity.
2021-06-16QUIC: updated specification references.Sergey Kandaurov1-4/+8
This includes updating citations and further clarification.
2021-04-19QUIC: fixed parsing of unknown frame types.Vladimir Homutov1-0/+2
The ngx_quic_frame_allowed() function only expects known frame types.
2021-04-14QUIC: headers cleanup.Vladimir Homutov1-0/+2
The "ngx_event_quic.h" header file now contains only public definitions, used by modules. All internal definitions are moved into the "ngx_event_quic_connection.h" header file.
2021-04-05QUIC: added error codes and messages from latest drafts.Vladimir Homutov1-1/+3
The AEAD_LIMIT_REACHED was addeded in draft-31. The NO_VIABLE_PATH was added in draft-33.
2021-02-12QUIC: send PING frames on PTO expiration.Roman Arutyunyan1-2/+2
Two PING frames are sent per level that generate two UDP datagrams.
2021-02-03QUIC: removed redundant "app" flag from ngx_quic_close_frame_t.Sergey Kandaurov1-1/+0
The flag was introduced to create type-aware CONNECTION_CLOSE frames, and now is replaced with frame type information, directly accessible. Notably, this fixes type logging for received frames in b3d9e57d0f62.
2021-01-29QUIC: stateless retry.Vladimir Homutov1-0/+2
Previously, quic connection object was created when Retry packet was sent. This is neither necessary nor convenient, and contradicts the idea of retry: protecting from bad clients and saving server resources. Now, the connection is not created, token is verified cryptographically instead of holding it in connection.
2020-12-30QUIC: fixed header protection macro name.Vladimir Homutov1-3/+3
2020-12-25QUIC: ngx_quic_bpf module.Vladimir Homutov1-0/+2
The quic kernel bpf helper inspects packet payload for DCID, extracts key and routes the packet into socket matching the key. Due to reuseport feature, each worker owns a personal socket, which is identified by the same key, used to create DCID. BPF objects are locked in RAM and are subject to RLIMIT_MEMLOCK. The "ulimit -l" command may be used to setup proper limits, if maps cannot be created with EPERM or updated with ETOOLONG.
2020-12-25QUIC: moved all quic sources into src/event/quic.Vladimir Homutov1-0/+356