2021-03-09 23:24:35 +01:00
|
|
|
#pragma once
|
2019-06-18 01:19:39 +02:00
|
|
|
|
2020-02-25 21:52:59 +01:00
|
|
|
#include <chrono>
|
2019-06-18 01:19:39 +02:00
|
|
|
#include <cstddef>
|
|
|
|
|
2021-03-09 23:24:35 +01:00
|
|
|
#include <llarp/util/types.hpp>
|
|
|
|
#include <llarp/util/time.hpp>
|
2019-06-18 01:19:39 +02:00
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace path
|
|
|
|
{
|
|
|
|
/// maximum path length
|
|
|
|
constexpr std::size_t max_len = 8;
|
|
|
|
/// default path length
|
|
|
|
constexpr std::size_t default_len = 4;
|
|
|
|
/// pad messages to the nearest this many bytes
|
|
|
|
constexpr std::size_t pad_size = 128;
|
|
|
|
/// default path lifetime in ms
|
2020-03-01 17:40:15 +01:00
|
|
|
constexpr std::chrono::milliseconds default_lifetime = 20min;
|
2020-02-25 21:52:59 +01:00
|
|
|
/// minimum into lifetime we will advertise
|
2020-04-07 20:38:56 +02:00
|
|
|
constexpr std::chrono::milliseconds min_intro_lifetime = default_lifetime / 2;
|
2020-02-25 21:52:59 +01:00
|
|
|
/// spacing frequency at which we try to build paths for introductions
|
2020-04-07 20:38:56 +02:00
|
|
|
constexpr std::chrono::milliseconds intro_path_spread = default_lifetime / 5;
|
2020-03-01 17:33:45 +01:00
|
|
|
/// Minimum paths to keep around for intros; mainly used at startup (the
|
|
|
|
/// spread, above, should be able to maintain more than this number of paths
|
|
|
|
/// normally once things are going).
|
|
|
|
constexpr std::size_t min_intro_paths = 4;
|
2019-06-18 01:19:39 +02:00
|
|
|
/// after this many ms a path build times out
|
2020-03-01 17:40:15 +01:00
|
|
|
constexpr auto build_timeout = 30s;
|
2019-06-18 01:19:39 +02:00
|
|
|
|
|
|
|
/// measure latency every this interval ms
|
2020-05-21 16:24:59 +02:00
|
|
|
constexpr auto latency_interval = 20s;
|
2019-06-18 01:19:39 +02:00
|
|
|
/// if a path is inactive for this amount of time it's dead
|
2020-05-21 16:24:59 +02:00
|
|
|
constexpr auto alive_timeout = latency_interval * 1.5;
|
2020-06-01 15:17:44 +02:00
|
|
|
|
|
|
|
/// how big transit hop traffic queues are
|
|
|
|
constexpr std::size_t transit_hop_queue_size = 256;
|
|
|
|
|
2019-06-18 01:19:39 +02:00
|
|
|
} // namespace path
|
|
|
|
} // namespace llarp
|