// Copyright (c) 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef QUICHE_QUIC_CORE_QUIC_MTU_DISCOVERY_H_ #define QUICHE_QUIC_CORE_QUIC_MTU_DISCOVERY_H_ #include <iostream> #include "quiche/quic/core/quic_constants.h" #include "quiche/quic/core/quic_types.h" namespace quic { // The initial number of packets between MTU probes. After each attempt the // number is doubled. inline constexpr QuicPacketCount kPacketsBetweenMtuProbesBase = …; // The number of MTU probes that get sent before giving up. inline constexpr size_t kMtuDiscoveryAttempts = …; // Ensure that exponential back-off does not result in an integer overflow. // The number of packets can be potentially capped, but that is not useful at // current kMtuDiscoveryAttempts value, and hence is not implemented at present. static_assert …; static_assert …; // The increased packet size targeted when doing path MTU discovery. inline constexpr QuicByteCount kMtuDiscoveryTargetPacketSizeHigh = …; inline constexpr QuicByteCount kMtuDiscoveryTargetPacketSizeLow = …; static_assert …; static_assert …; static_assert …; static_assert …; // QuicConnectionMtuDiscoverer is a MTU discovery controller, it answers two // questions: // 1) Probe scheduling: Whether a connection should send a MTU probe packet // right now. // 2) MTU search stradegy: When it is time to send, what should be the size of // the probing packet. // Note the discoverer does not actually send or process probing packets. // // Unit tests are in QuicConnectionTest.MtuDiscovery*. class QUICHE_EXPORT QuicConnectionMtuDiscoverer { … }; } // namespace quic #endif // QUICHE_QUIC_CORE_QUIC_MTU_DISCOVERY_H_