summaryrefslogtreecommitdiff
path: root/node/Packet.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'node/Packet.hpp')
-rw-r--r--node/Packet.hpp122
1 files changed, 85 insertions, 37 deletions
diff --git a/node/Packet.hpp b/node/Packet.hpp
index 27da6fb5..fcb81489 100644
--- a/node/Packet.hpp
+++ b/node/Packet.hpp
@@ -1,6 +1,6 @@
/*
* ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2018 ZeroTier, Inc. https://www.zerotier.com/
+ * Copyright (C) 2011-2019 ZeroTier, Inc. https://www.zerotier.com/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --
*
@@ -45,31 +45,33 @@
/**
* Protocol version -- incremented only for major changes
*
- * 1 - 0.2.0 ... 0.2.5
- * 2 - 0.3.0 ... 0.4.5
- * + Added signature and originating peer to multicast frame
- * + Double size of multicast frame bloom filter
- * 3 - 0.5.0 ... 0.6.0
- * + Yet another multicast redesign
- * + New crypto completely changes key agreement cipher
- * 4 - 0.6.0 ... 1.0.6
- * + BREAKING CHANGE: New identity format based on hashcash design
- * 5 - 1.1.0 ... 1.1.5
- * + Supports echo
- * + Supports in-band world (root server definition) updates
- * + Clustering! (Though this will work with protocol v4 clients.)
- * + Otherwise backward compatible with protocol v4
- * 6 - 1.1.5 ... 1.1.10
- * + Network configuration format revisions including binary values
- * 7 - 1.1.10 ... 1.1.17
- * + Introduce trusted paths for local SDN use
- * 8 - 1.1.17 ... 1.2.0
- * + Multipart network configurations for large network configs
- * + Tags and Capabilities
- * + Inline push of CertificateOfMembership deprecated
- * 9 - 1.2.0 ... CURRENT
+ * 1 - 0.2.0 ... 0.2.5
+ * 2 - 0.3.0 ... 0.4.5
+ * + Added signature and originating peer to multicast frame
+ * + Double size of multicast frame bloom filter
+ * 3 - 0.5.0 ... 0.6.0
+ * + Yet another multicast redesign
+ * + New crypto completely changes key agreement cipher
+ * 4 - 0.6.0 ... 1.0.6
+ * + BREAKING CHANGE: New identity format based on hashcash design
+ * 5 - 1.1.0 ... 1.1.5
+ * + Supports echo
+ * + Supports in-band world (root server definition) updates
+ * + Clustering! (Though this will work with protocol v4 clients.)
+ * + Otherwise backward compatible with protocol v4
+ * 6 - 1.1.5 ... 1.1.10
+ * + Network configuration format revisions including binary values
+ * 7 - 1.1.10 ... 1.1.17
+ * + Introduce trusted paths for local SDN use
+ * 8 - 1.1.17 ... 1.2.0
+ * + Multipart network configurations for large network configs
+ * + Tags and Capabilities
+ * + Inline push of CertificateOfMembership deprecated
+ * 9 - 1.2.0 ... 1.2.14
+ * 10 - 1.4.0 ... CURRENT
+ * + Multipath capability and load balancing
*/
-#define ZT_PROTO_VERSION 9
+#define ZT_PROTO_VERSION 10
/**
* Minimum supported protocol version
@@ -150,7 +152,7 @@
*
* In cryptography, a "break" means something different from what it means in
* common discussion. If a cipher is 256 bits strong and someone finds a way
- * to reduce key search to 254 bits, this constitues a "break" in the academic
+ * to reduce key search to 254 bits, this constitutes a "break" in the academic
* literature. 254 bits is still far beyond what can be leveraged to accomplish
* a "break" as most people would understand it -- the actual decryption and
* reading of traffic.
@@ -249,7 +251,7 @@
*/
#define ZT_PROTO_MIN_FRAGMENT_LENGTH ZT_PACKET_FRAGMENT_IDX_PAYLOAD
-// Field incides for parsing verbs -------------------------------------------
+// Field indices for parsing verbs -------------------------------------------
// Some verbs have variable-length fields. Those aren't fully defined here
// yet-- instead they are parsed using relative indexes in IncomingPacket.
@@ -419,7 +421,7 @@ public:
template<unsigned int C2>
Fragment(const Buffer<C2> &b) :
- Buffer<ZT_PROTO_MAX_PACKET_LENGTH>(b)
+ Buffer<ZT_PROTO_MAX_PACKET_LENGTH>(b)
{
}
@@ -734,7 +736,7 @@ public:
* Credentials can be for any number of networks.
*
* The use of a zero byte to terminate the COM section is for legacy
- * backward compatiblity. Newer fields are prefixed with a length.
+ * backward compatibility. Newer fields are prefixed with a length.
*
* OK/ERROR are not generated.
*/
@@ -751,11 +753,11 @@ public:
* This message requests network configuration from a node capable of
* providing it.
*
- * Respones to this are always whole configs intended for the recipient.
+ * Responses to this are always whole configs intended for the recipient.
* For patches and other updates a NETWORK_CONFIG is sent instead.
*
* It would be valid and correct as of 1.2.0 to use NETWORK_CONFIG always,
- * but OK(NTEWORK_CONFIG_REQUEST) should be sent for compatibility.
+ * but OK(NETWORK_CONFIG_REQUEST) should be sent for compatibility.
*
* OK response payload:
* <[8] 64-bit network ID>
@@ -884,7 +886,7 @@ public:
* <[6] MAC address of multicast group>
* <[4] 32-bit ADI for multicast group>
* <[1] flags>
- * [<[...] network certficate of membership (DEPRECATED)>]
+ * [<[...] network certificate of membership (DEPRECATED)>]
* [<[...] implicit gather results if flag 0x01 is set>]
*
* OK flags (same bits as request flags):
@@ -930,7 +932,53 @@ public:
*/
VERB_PUSH_DIRECT_PATHS = 0x10,
- // 0x11, 0x12 -- deprecated
+ // 0x11 -- deprecated
+
+ /**
+ * An acknowledgment of receipt of a series of recent packets from another
+ * peer. This is used to calculate relative throughput values and to detect
+ * packet loss. Only VERB_FRAME and VERB_EXT_FRAME packets are counted.
+ *
+ * ACK response format:
+ * <[4] 32-bit number of bytes received since last ACK>
+ *
+ * Upon receipt of this packet, the local peer will verify that the correct
+ * number of bytes were received by the remote peer. If these values do
+ * not agree that could be an indicator of packet loss.
+ *
+ * Additionally, the local peer knows the interval of time that has
+ * elapsed since the last received ACK. With this information it can compute
+ * a rough estimate of the current throughput.
+ *
+ * This is sent at a maximum rate of once per every ZT_PATH_ACK_INTERVAL
+ */
+ VERB_ACK = 0x12,
+
+ /**
+ * A packet containing timing measurements useful for estimating path quality.
+ * Composed of a list of <packet ID:internal sojourn time> pairs for an
+ * arbitrary set of recent packets. This is used to sample for latency and
+ * packet delay variance (PDV, "jitter").
+ *
+ * QoS record format:
+ *
+ * <[8] 64-bit packet ID of previously-received packet>
+ * <[1] 8-bit packet sojourn time>
+ * <...repeat until end of max 1400 byte packet...>
+ *
+ * The number of possible records per QoS packet is: (1400 * 8) / 72 = 155
+ * This packet should be sent very rarely (every few seconds) as it can be
+ * somewhat large if the connection is saturated. Future versions might use
+ * a bloom table to probabilistically determine these values in a vastly
+ * more space-efficient manner.
+ *
+ * Note: The 'internal packet sojourn time' is a slight misnomer as it is a
+ * measure of the amount of time between when a packet was received and the
+ * egress time of its tracking QoS packet.
+ *
+ * This is sent at a maximum rate of once per every ZT_PATH_QOS_INTERVAL
+ */
+ VERB_QOS_MEASUREMENT = 0x13,
/**
* A message with arbitrary user-definable content:
@@ -954,7 +1002,7 @@ public:
*
* This message contains a remote trace event. Remote trace events can
* be sent to observers configured at the network level for those that
- * pertain directly to actiity on a network, or to global observers if
+ * pertain directly to activity on a network, or to global observers if
* locally configured.
*
* The instance ID is a random 64-bit value generated by each ZeroTier
@@ -999,7 +1047,7 @@ public:
template<unsigned int C2>
Packet(const Buffer<C2> &b) :
- Buffer<ZT_PROTO_MAX_PACKET_LENGTH>(b)
+ Buffer<ZT_PROTO_MAX_PACKET_LENGTH>(b)
{
}
@@ -1251,7 +1299,7 @@ public:
* Encrypt/decrypt a separately armored portion of a packet
*
* This is currently only used to mask portions of HELLO as an extra
- * security precation since most of that message is sent in the clear.
+ * security precaution since most of that message is sent in the clear.
*
* This must NEVER be used more than once in the same packet, as doing
* so will result in re-use of the same key stream.