From: Etienne Dechamps Date: Sun, 21 Sep 2014 17:17:02 +0000 (+0100) Subject: Introduce node IDs. X-Git-Tag: release-1.1pre11~38 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=55a78da4e0b496fc599704473f41d5ea52669737;hp=55a78da4e0b496fc599704473f41d5ea52669737;p=tinc Introduce node IDs. This introduces a new type of identifier for nodes, which complements node names: node IDs. Node IDs are defined as the first 6 bytes of the SHA-256 hash of the node name. They will be used in future code in lieu of node names as unique node identifiers in contexts where space is at a premium (such as VPN packets). The semantics of node IDs is that they are supposed to be unique in a tinc graph; i.e. two different nodes that are part of the same graph should not have the same ID, otherwise things could break. This solution provides this guarantee based on realistic probabilities: indeed, according to the birthday problem, with a 48-bit hash, the probability of at least one collision is 1e-13 with 10 nodes, 1e-11 with 100 nodes, 1e-9 with 1000 nodes and 1e-7 with 10000 nodes. Things only start getting hairy with more than 1 million nodes, as the probability gets over 0.2%. ---