Software:Yggdrasil (Mesh)

From HandWiki
Yggdrasil
Written inGo
Operating systemLinux, Illumos, OS X, FreeBSD
Platformx86, amd64, MIPS, ARM, PowerPC
Available inEnglish
TypeNetwork
LicenseGPLv3
Websitehttps://yggdrasil-network.github.io/installation.html

Yggdrasil — an encrypted IPv6 network running in the 200::/7 address range. It is an experimental/toy network, so failure is acceptable, as long as it's instructive to see how it breaks if/when everything falls apart.

IP addresses are derived from cryptographic keys, to reduce the need for public key infrastructure. A form of locator/identifier separation (similar in goal to LISP) is used to map static identifiers (IP addresses) onto dynamic routing information (locators), using a distributed hash table (DHT). Locators are used to approximate the distance between nodes in the network, where the approximate distance is the length of a real worst-case-scenario path through the network. This is (arguably) easier to secure and requires less information about the network than commonly used routing schemes.

While not technically a compact routing scheme, tests on real-world networks suggest that routing in this style incurs stretch comparable to the name-dependent compact routing schemes designed for static networks. Compared to compact routing schemes, Yggdrasil appears to have smaller average routing table sizes, works on dynamic networks, and is name-independent. It currently lacks the provable bounds of compact routing schemes, and there's a serious argument to be made that it cheats by stretching the definition of some of the above terms, but the main point to be emphasized is that there are trade-offs between different concerns when trying to route traffic, and we'd rather make every part good than try to make any one part perfect. In that sense, Yggdrasil seems to be competitive, on what are supposedly realistic networks, with compact routing schemes.

Addressing

Yggdrasil uses a truncated version of a NodeID to assign addresses. An address is assigned from the 200::/7 prefix, according to the following:

  1. Begin with 0x02 as the first byte of the address, or 0x03 if it's a /64 prefix.
  2. Count the number of leading 1 bits in the NodeID.
  3. Set the second byte of the address to the number of leading 1 bits in the NodeID (8 bit unsigned integer, at most 255).
  4. Append the NodeID to the remaining bits of the address, truncating the leading 1 bits and the first 0 bit, to a total address size of 128 bits.

The last bit of the first byte is used to flag if an address is for a router (200::/8), or part of an advertised prefix (300::/8), where each router owns a /64 that matches their address (except with the eight bit set to 1 instead of 0). This allows the prefix to be advertised to the router's LAN, so unsupported devices can still connect to the network (e.g. network printers).

The NodeID is a sha512sum of a node's public encryption key. Addresses are checked that they match NodeID, to prevent address spoofing. As such, while a 128 bit IPv6 address is likely too short to be considered secure by cryptographer standards, there is a significant cost in attempting to cause an address collision. Addresses can be made more secure by brute force generating a large number of leading 1 bits in the NodeID.

When connecting to a node, the IP address is unpacked into the known bits of the NodeID and a matching bitmask to track which bits are significant. A node is only communicated with if its NodeID matches its public key and the known NodeID bits from the address.

It is important to note that only NodeID is used internally for routing, so the addressing scheme could in theory be changed without breaking compatibility with intermediate routers. This has been done once, when moving the address range from the fd00::/8 ULA range to the reserved-but-deprecated 200::/7 range. Further addressing scheme changes could occur if, for example, an IPv7 format ever emerges.[1]


See also

External links

References