summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGrant Limberg <[email protected]>2020-07-30 13:15:43 -0700
committerGrant Limberg <[email protected]>2020-07-30 13:15:43 -0700
commit6b197e067ac46401b7953a1aa0ed95bf2daf56f3 (patch)
tree12b75b314d8d53d5484f14bae0eebaeba668b2e1 /include
parent387039456d9dd0a3a7b20017aaa71188c63903af (diff)
parent9f4985b11a5a4f93c9435094adfce378d573c7a6 (diff)
Merge branch 'dev' into dns
Diffstat (limited to 'include')
-rw-r--r--include/ZeroTierOne.h226
1 files changed, 190 insertions, 36 deletions
diff --git a/include/ZeroTierOne.h b/include/ZeroTierOne.h
index 8ff9ba2f..82ae5edf 100644
--- a/include/ZeroTierOne.h
+++ b/include/ZeroTierOne.h
@@ -425,33 +425,155 @@ enum ZT_ResultCode
*/
#define ZT_ResultCode_isFatal(x) ((((int)(x)) >= 100)&&(((int)(x)) < 1000))
+
/**
- * The multipath algorithm in use by this node.
+ * Multipath bonding policy
*/
-enum ZT_MultipathMode
+enum ZT_MultipathBondingPolicy
{
/**
- * No active multipath.
- *
- * Traffic is merely sent over the strongest path. That being
- * said, this mode will automatically failover in the event that a link goes down.
+ * Normal operation. No fault tolerance, no load balancing
*/
- ZT_MULTIPATH_NONE = 0,
+ ZT_BONDING_POLICY_NONE = 0,
/**
- * Traffic is randomly distributed among all active paths.
- *
- * Will cease sending traffic over links that appear to be stale.
+ * Sends traffic out on only one path at a time. Configurable immediate
+ * fail-over.
*/
- ZT_MULTIPATH_RANDOM = 1,
+ ZT_BONDING_POLICY_ACTIVE_BACKUP = 1,
/**
- * Traffic is allocated across all active paths in proportion to their strength and
- * reliability.
- *
- * Will cease sending traffic over links that appear to be stale.
+ * Sends traffic out on all paths
+ */
+ ZT_BONDING_POLICY_BROADCAST = 2,
+
+ /**
+ * Stripes packets across all paths
+ */
+ ZT_BONDING_POLICY_BALANCE_RR = 3,
+
+ /**
+ * Packets destined for specific peers will always be sent over the same
+ * path.
+ */
+ ZT_BONDING_POLICY_BALANCE_XOR = 4,
+
+ /**
+ * Balances flows among all paths according to path performance
*/
- ZT_MULTIPATH_PROPORTIONALLY_BALANCED = 2,
+ ZT_BONDING_POLICY_BALANCE_AWARE = 5
+};
+
+/**
+ * Multipath active re-selection policy (linkSelectMethod)
+ */
+enum ZT_MultipathLinkSelectMethod
+{
+ /**
+ * Primary link regains status as active link whenever it comes back up
+ * (default when links are explicitly specified)
+ */
+ ZT_MULTIPATH_RESELECTION_POLICY_ALWAYS = 0,
+
+ /**
+ * Primary link regains status as active link when it comes back up and
+ * (if) it is better than the currently-active link.
+ */
+ ZT_MULTIPATH_RESELECTION_POLICY_BETTER = 1,
+
+ /**
+ * Primary link regains status as active link only if the currently-active
+ * link fails.
+ */
+ ZT_MULTIPATH_RESELECTION_POLICY_FAILURE = 2,
+
+ /**
+ * The primary link can change if a superior path is detected.
+ * (default if user provides no fail-over guidance)
+ */
+ ZT_MULTIPATH_RESELECTION_POLICY_OPTIMIZE = 3
+};
+
+/**
+ * Mode of multipath link interface
+ */
+enum ZT_MultipathLinkMode
+{
+ ZT_MULTIPATH_SLAVE_MODE_PRIMARY = 0,
+ ZT_MULTIPATH_SLAVE_MODE_SPARE = 1
+};
+
+/**
+ * Strategy for path monitoring
+ */
+enum ZT_MultipathMonitorStrategy
+{
+ /**
+ * Use bonding policy's default strategy
+ */
+ ZT_MULTIPATH_SLAVE_MONITOR_STRATEGY_DEFAULT = 0,
+
+ /**
+ * Does not actively send probes to judge aliveness, will rely
+ * on conventional traffic and summary statistics.
+ */
+ ZT_MULTIPATH_SLAVE_MONITOR_STRATEGY_PASSIVE = 1,
+
+ /**
+ * Sends probes at a constant rate to judge aliveness.
+ */
+ ZT_MULTIPATH_SLAVE_MONITOR_STRATEGY_ACTIVE = 2,
+
+ /**
+ * Sends probes at varying rates which correlate to native
+ * traffic loads to judge aliveness.
+ */
+ ZT_MULTIPATH_SLAVE_MONITOR_STRATEGY_DYNAMIC = 3
+};
+
+/**
+ * Strategy for re-balancing protocol flows
+ */
+enum ZT_MultipathFlowRebalanceStrategy
+{
+ /**
+ * Flows will only be re-balanced among links during
+ * assignment or failover. This minimizes the possibility
+ * of sequence reordering and is thus the default setting.
+ */
+ ZT_MULTIPATH_FLOW_REBALANCE_STRATEGY_PASSIVE = 0,
+
+ /**
+ * Flows that are active may be re-assigned to a new more
+ * suitable link if it can be done without disrupting the flow.
+ * This setting can sometimes cause sequence re-ordering.
+ */
+ ZT_MULTIPATH_FLOW_REBALANCE_STRATEGY_OPPORTUNISTIC = 0,
+
+ /**
+ * Flows will be continuously re-assigned the most suitable link
+ * in order to maximize "balance". This can often cause sequence
+ * reordering and is thus only reccomended for protocols like UDP.
+ */
+ ZT_MULTIPATH_FLOW_REBALANCE_STRATEGY_AGGRESSIVE = 2
+};
+
+/**
+ * Indices for the path quality weight vector
+ */
+enum ZT_MultipathQualityWeightIndex
+{
+ ZT_QOS_LAT_IDX,
+ ZT_QOS_LTM_IDX,
+ ZT_QOS_PDV_IDX,
+ ZT_QOS_PLR_IDX,
+ ZT_QOS_PER_IDX,
+ ZT_QOS_THR_IDX,
+ ZT_QOS_THM_IDX,
+ ZT_QOS_THV_IDX,
+ ZT_QOS_AGE_IDX,
+ ZT_QOS_SCP_IDX,
+ ZT_QOS_WEIGHT_SIZE
};
/**
@@ -1279,44 +1401,49 @@ typedef struct
uint64_t trustedPathId;
/**
- * One-way latency
+ * Mean latency
+ */
+ float latencyMean;
+
+ /**
+ * Maximum observed latency
*/
- float latency;
+ float latencyMax;
/**
- * How much latency varies over time
+ * Variance of latency
*/
- float packetDelayVariance;
+ float latencyVariance;
/**
- * How much observed throughput varies over time
+ * Packet loss ratio
*/
- float throughputDisturbCoeff;
+ float packetLossRatio;
/**
- * Packet Error Ratio (PER)
+ * Packet error ratio
*/
float packetErrorRatio;
/**
- * Packet Loss Ratio (PLR)
+ * Mean throughput
*/
- float packetLossRatio;
+ uint64_t throughputMean;
/**
- * Stability of the path
+ * Maximum observed throughput
*/
- float stability;
+ float throughputMax;
/**
- * Current throughput (moving average)
+ * Throughput variance
*/
- uint64_t throughput;
+ float throughputVariance;
/**
- * Maximum observed throughput for this path
+ * Address scope
*/
- uint64_t maxThroughput;
+ uint8_t scope;
/**
* Percentage of traffic allocated to this path
@@ -1326,7 +1453,9 @@ typedef struct
/**
* Name of physical interface (for monitoring)
*/
- char *ifname;
+ char ifname[32];
+
+ uint64_t localSocket;
/**
* Is path expired?
@@ -1375,14 +1504,39 @@ typedef struct
enum ZT_PeerRole role;
/**
- * Number of paths (size of paths[])
+ * Whether a multi-link bond has formed
*/
- unsigned int pathCount;
+ bool isBonded;
+
+ /**
+ * The bonding policy used to bond to this peer
+ */
+ int bondingPolicy;
+
+ /**
+ * The health status of the bond to this peer
+ */
+ bool isHealthy;
/**
- * Whether this peer was ever reachable via an aggregate link
+ * The number of links that comprise the bond to this peer that are considered alive
*/
- bool hadAggregateLink;
+ int numAliveLinks;
+
+ /**
+ * The number of links that comprise the bond to this peer
+ */
+ int numTotalLinks;
+
+ /**
+ * The user-specified bond template name
+ */
+ char customBondName[32];
+
+ /**
+ * Number of paths (size of paths[])
+ */
+ unsigned int pathCount;
/**
* Known network paths to peer