@@ -415,33 +415,155 @@ enum ZT_ResultCode
415
415
*/
416
416
#define ZT_ResultCode_isFatal (x ) ((((int)(x)) >= 100)&&(((int)(x)) < 1000))
417
417
418
+
418
419
/**
419
- * The multipath algorithm in use by this node.
420
+ * Multipath bonding policy
420
421
*/
421
- enum ZT_MultipathMode
422
+ enum ZT_MultipathBondingPolicy
422
423
{
423
424
/**
424
- * No active multipath.
425
- *
426
- * Traffic is merely sent over the strongest path. That being
427
- * said, this mode will automatically failover in the event that a link goes down.
425
+ * Normal operation. No fault tolerance, no load balancing
428
426
*/
429
- ZT_MULTIPATH_NONE = 0 ,
427
+ ZT_BONDING_POLICY_NONE = 0 ,
430
428
431
429
/**
432
- * Traffic is randomly distributed among all active paths.
433
- *
434
- * Will cease sending traffic over links that appear to be stale.
430
+ * Sends traffic out on only one path at a time. Configurable immediate
431
+ * fail-over.
435
432
*/
436
- ZT_MULTIPATH_RANDOM = 1 ,
433
+ ZT_BONDING_POLICY_ACTIVE_BACKUP = 1 ,
437
434
438
435
/**
439
- * Traffic is allocated across all active paths in proportion to their strength and
440
- * reliability.
441
- *
442
- * Will cease sending traffic over links that appear to be stale.
436
+ * Sends traffic out on all paths
437
+ */
438
+ ZT_BONDING_POLICY_BROADCAST = 2 ,
439
+
440
+ /**
441
+ * Stripes packets across all paths
442
+ */
443
+ ZT_BONDING_POLICY_BALANCE_RR = 3 ,
444
+
445
+ /**
446
+ * Packets destined for specific peers will always be sent over the same
447
+ * path.
448
+ */
449
+ ZT_BONDING_POLICY_BALANCE_XOR = 4 ,
450
+
451
+ /**
452
+ * Balances flows among all paths according to path performance
453
+ */
454
+ ZT_BONDING_POLICY_BALANCE_AWARE = 5
455
+ };
456
+
457
+ /**
458
+ * Multipath active re-selection policy (linkSelectMethod)
459
+ */
460
+ enum ZT_MultipathLinkSelectMethod
461
+ {
462
+ /**
463
+ * Primary link regains status as active link whenever it comes back up
464
+ * (default when links are explicitly specified)
465
+ */
466
+ ZT_MULTIPATH_RESELECTION_POLICY_ALWAYS = 0 ,
467
+
468
+ /**
469
+ * Primary link regains status as active link when it comes back up and
470
+ * (if) it is better than the currently-active link.
471
+ */
472
+ ZT_MULTIPATH_RESELECTION_POLICY_BETTER = 1 ,
473
+
474
+ /**
475
+ * Primary link regains status as active link only if the currently-active
476
+ * link fails.
477
+ */
478
+ ZT_MULTIPATH_RESELECTION_POLICY_FAILURE = 2 ,
479
+
480
+ /**
481
+ * The primary link can change if a superior path is detected.
482
+ * (default if user provides no fail-over guidance)
443
483
*/
444
- ZT_MULTIPATH_PROPORTIONALLY_BALANCED = 2 ,
484
+ ZT_MULTIPATH_RESELECTION_POLICY_OPTIMIZE = 3
485
+ };
486
+
487
+ /**
488
+ * Mode of multipath link interface
489
+ */
490
+ enum ZT_MultipathLinkMode
491
+ {
492
+ ZT_MULTIPATH_SLAVE_MODE_PRIMARY = 0 ,
493
+ ZT_MULTIPATH_SLAVE_MODE_SPARE = 1
494
+ };
495
+
496
+ /**
497
+ * Strategy for path monitoring
498
+ */
499
+ enum ZT_MultipathMonitorStrategy
500
+ {
501
+ /**
502
+ * Use bonding policy's default strategy
503
+ */
504
+ ZT_MULTIPATH_SLAVE_MONITOR_STRATEGY_DEFAULT = 0 ,
505
+
506
+ /**
507
+ * Does not actively send probes to judge aliveness, will rely
508
+ * on conventional traffic and summary statistics.
509
+ */
510
+ ZT_MULTIPATH_SLAVE_MONITOR_STRATEGY_PASSIVE = 1 ,
511
+
512
+ /**
513
+ * Sends probes at a constant rate to judge aliveness.
514
+ */
515
+ ZT_MULTIPATH_SLAVE_MONITOR_STRATEGY_ACTIVE = 2 ,
516
+
517
+ /**
518
+ * Sends probes at varying rates which correlate to native
519
+ * traffic loads to judge aliveness.
520
+ */
521
+ ZT_MULTIPATH_SLAVE_MONITOR_STRATEGY_DYNAMIC = 3
522
+ };
523
+
524
+ /**
525
+ * Strategy for re-balancing protocol flows
526
+ */
527
+ enum ZT_MultipathFlowRebalanceStrategy
528
+ {
529
+ /**
530
+ * Flows will only be re-balanced among links during
531
+ * assignment or failover. This minimizes the possibility
532
+ * of sequence reordering and is thus the default setting.
533
+ */
534
+ ZT_MULTIPATH_FLOW_REBALANCE_STRATEGY_PASSIVE = 0 ,
535
+
536
+ /**
537
+ * Flows that are active may be re-assigned to a new more
538
+ * suitable link if it can be done without disrupting the flow.
539
+ * This setting can sometimes cause sequence re-ordering.
540
+ */
541
+ ZT_MULTIPATH_FLOW_REBALANCE_STRATEGY_OPPORTUNISTIC = 0 ,
542
+
543
+ /**
544
+ * Flows will be continuously re-assigned the most suitable link
545
+ * in order to maximize "balance". This can often cause sequence
546
+ * reordering and is thus only reccomended for protocols like UDP.
547
+ */
548
+ ZT_MULTIPATH_FLOW_REBALANCE_STRATEGY_AGGRESSIVE = 2
549
+ };
550
+
551
+ /**
552
+ * Indices for the path quality weight vector
553
+ */
554
+ enum ZT_MultipathQualityWeightIndex
555
+ {
556
+ ZT_QOS_LAT_IDX ,
557
+ ZT_QOS_LTM_IDX ,
558
+ ZT_QOS_PDV_IDX ,
559
+ ZT_QOS_PLR_IDX ,
560
+ ZT_QOS_PER_IDX ,
561
+ ZT_QOS_THR_IDX ,
562
+ ZT_QOS_THM_IDX ,
563
+ ZT_QOS_THV_IDX ,
564
+ ZT_QOS_AGE_IDX ,
565
+ ZT_QOS_SCP_IDX ,
566
+ ZT_QOS_WEIGHT_SIZE
445
567
};
446
568
447
569
/**
@@ -1250,44 +1372,49 @@ typedef struct
1250
1372
uint64_t trustedPathId ;
1251
1373
1252
1374
/**
1253
- * One-way latency
1375
+ * Mean latency
1254
1376
*/
1255
- float latency ;
1377
+ float latencyMean ;
1256
1378
1257
1379
/**
1258
- * How much latency varies over time
1380
+ * Maximum observed latency
1259
1381
*/
1260
- float packetDelayVariance ;
1382
+ float latencyMax ;
1261
1383
1262
1384
/**
1263
- * How much observed throughput varies over time
1385
+ * Variance of latency
1264
1386
*/
1265
- float throughputDisturbCoeff ;
1387
+ float latencyVariance ;
1266
1388
1267
1389
/**
1268
- * Packet Error Ratio (PER)
1390
+ * Packet loss ratio
1391
+ */
1392
+ float packetLossRatio ;
1393
+
1394
+ /**
1395
+ * Packet error ratio
1269
1396
*/
1270
1397
float packetErrorRatio ;
1271
1398
1272
1399
/**
1273
- * Packet Loss Ratio (PLR)
1400
+ * Mean throughput
1274
1401
*/
1275
- float packetLossRatio ;
1402
+ uint64_t throughputMean ;
1276
1403
1277
1404
/**
1278
- * Stability of the path
1405
+ * Maximum observed throughput
1279
1406
*/
1280
- float stability ;
1407
+ float throughputMax ;
1281
1408
1282
1409
/**
1283
- * Current throughput (moving average)
1410
+ * Throughput variance
1284
1411
*/
1285
- uint64_t throughput ;
1412
+ float throughputVariance ;
1286
1413
1287
1414
/**
1288
- * Maximum observed throughput for this path
1415
+ * Address scope
1289
1416
*/
1290
- uint64_t maxThroughput ;
1417
+ uint8_t scope ;
1291
1418
1292
1419
/**
1293
1420
* Percentage of traffic allocated to this path
@@ -1297,7 +1424,9 @@ typedef struct
1297
1424
/**
1298
1425
* Name of physical interface (for monitoring)
1299
1426
*/
1300
- char * ifname ;
1427
+ char ifname [32 ];
1428
+
1429
+ uint64_t localSocket ;
1301
1430
1302
1431
/**
1303
1432
* Is path expired?
@@ -1351,9 +1480,11 @@ typedef struct
1351
1480
unsigned int pathCount ;
1352
1481
1353
1482
/**
1354
- * Whether this peer was ever reachable via an aggregate link
1483
+ * Whether multiple paths to this peer are bonded
1355
1484
*/
1356
- bool hadAggregateLink ;
1485
+ bool isBonded ;
1486
+
1487
+ int bondingPolicy ;
1357
1488
1358
1489
/**
1359
1490
* Known network paths to peer
0 commit comments