title: Distributed secure routing in permissionless flat networks class: animation-fade layout: true .bottom-bar[ {{title}} ] --- class: impact .big[{{title}}] .soft[.small[Benedict Lau // Radical Networks 2018]] --- class: impact .col-3[
] .col-3[
] .col-3[
] .col-3[
] .soft[
] -- .big[.big[.big[IP .hi1[
] address .hi2[
] packet]]] .soft[
] -- .col-2[ .big[.big[
]] ] .col-2[ .big[.big[
]] ] .col-2[ .big[.big[
]] ] .col-2[ .big[.big[
]] ] .col-2[ .big[.big[
]] ] .col-2[ .big[.big[
]] ] --- class: alt-bg center # Internet BGP inter-domain routing
.soft[.small[.small[_
https://csperkins.org/research/thesis-phd-strowes.pdf_]]] --- class: impact .small[For a large network to scale, it must be subnetted into smaller, more easily manageable networks, which then must in turn be networked together (to form a network of networks from inter-network connections, i.e. the internet). This requires some level of expertise and planning to do, and ] .big[tends to favor hierarchies wherein small networks are largely at the mercy of a larger network] .small[(e.g. the only connection your LAN has to another network is your connection to an ISP, and “peering” or directly connecting to your neighbor’s LAN is virtually unheard of).] .soft[.small[.small[_
Arceliar, Yggdrasil: The World Tree, https://yggdrasil-network.github.io/2018/07/17/world-tree.html_]]] --- class: impact .big[.hi1[Distributed] .hi2[secure] routing in .hi3[permissionless] .hi4[flat] networks] --- class: dark-slide middle .big[.hi1[Distributed] .small[every node is capable of _compact routing_]] -- .big[.hi2[Secure] .small[end-to-end encryption • route around malicious nodes]] -- .big[.hi3[Permissionless] .small[IP address self-assignment • autonomous network]] -- .big[.hi4[Flat] .small[random IP addresses • no subnet hierarchy]] --- class: dark-slide ## Compact routing
in comparison to BGP inter-domain routing -- - Keep small amounts of routing state at each router, rather than piling all that work onto the core network infrastructure -- - Without the full network view, a node cannot always determine shortest path .em[
e.g.
Dijkstra's algorithm as in OSPF] -- - Have routing table grow sublinearly with number of nodes, while getting close to shortest path routing with upper bound -- - Name-independent schemes that require no pre-processing are suitable for an unmanaged permissionless network --- class: dark-slide .col-7[ #
Hyperboria
.small[_
https://www.fc00.org_] ] .col-5[ ### cjdns - Auto-configure overlay network - Secure all network traffic with end-to-end encryption: - .alt[Curve25519] .small[encryption keys] - .alt[Ed25519] .small[signatures] - .alt[XSalsa20] .small[stream cipher] - .alt[Poly1305] .small[MAC] - Self-assign IPv6 in `fc00::/8` from cryptographic keys - Source route with Kademlia-like distributed hash table ] --- class: dark-slide ## Self-assignment of IP addresses
for permissionless network participation -- - Perform two rounds of SHA-512 on .alt[Curve25519 public key] then truncate to derive IPv6 address - `fc00::/8` address space has 2
120
addresses --
### Birthday problem >1 in 1,329,227,995,784,915,872,903,807,060,280,344,576 chance of generating the same IPv6. Feeling Lucky? .small[_
https://github.com/cjdelisle/cjdns/blob/master/doc/notes/arc-workings.md_] --- class: dark-slide middle .big[.hi1[Distributed] .small[.soft[every node is capable of _compact routing_]]] .big[.hi2[Secure] .small[end-to-end encryption .soft[• route around malicious nodes]]] .big[.hi3[Permissionless] .small[IP address self-assignment .soft[•] autonomous network]] .big[.hi4[Flat] .small[random IP addresses .soft[• no subnet hierarchy]]] --- class: alt-bg .col-8[ ## The Kademlia DHT ### Laying out IP addresses
] .col-4[ - Node .code[.hi1[0011]] has physical peers to _some_ neighbourhoods - Node .code[.hi1[0011]] learns paths to _every_ neighbourhood - Each node keeps a routing table at each .alt[XOR distance] - Each node knows its neighbourhood well relative to distant ones ] .small[_
https://pdos.csail.mit.edu/~petar/papers/maymounkov-kademlia-lncs.pdf_] --- class: alt-bg .col-7[ ### Searching the DHT
.small[_
https://pdos.csail.mit.edu/~petar/papers/maymounkov-kademlia-lncs.pdf_] ] .col-5[ #### Node .code[.hi1[0011]] searches .code[.hi2[1110]]: - .code[.hi1[0011]] knows path to .code[.hi3[101]] and makes first query to learn .code[.em[1101]] - .code[.hi1[0011]] makes successive queries .code[1] to .code[4] to reach .code[.hi2[1110]] - .code[.hi1[0011]] calculates XOR distance: >.code[.hi1[0011]] >.code[.hi2[1110]] >.code[.em[----.small[
]]] >.code[.alt[**1**101]] .em[.small[
XOR distance]] - .code[.hi1[0011]] adds newly learnt path to its routing table at .code[.alt[**1**---]] bucket ] --- class: dark-slide middle .big[.hi1[Distributed] .small[every node is capable of _compact routing_]] .big[.hi2[Secure] .small[.soft[end-to-end encryption • route around malicious nodes]]] .big[.hi3[Permissionless] .small[.soft[IP address self-assignment • autonomous network]]] .big[.hi4[Flat] .small[.soft[random IP addresses •] no subnet hierarchy]] --- class: impact #
.big[.hi1[Rick .code[1101]] wants to send a packet to .hi2[.code[1110]]] --- class: dark-slide ## Source routing #### Rick assembles the set of directors and sends
to his peer Morty | | | | | | | | |:--|:--|:--|:--|:--|:--|:--| | `0000000000000000000000000` | `0001` | `101011` | `011010` | `100101101` | `10111` | .code[.hi1[**0100011**]] | | .big[
] unused space | .big[
] | .big[
] | .big[
] | .big[
] | .big[
] | .big[.hi1[
]] | -- .small[
] #### Morty pops the .hi1[
] director and sends it down the .hi1[
] network interface | | | | | | | | |:--|:--|:--|:--|:--|:--|:--| | .code[.hi1[**1000000**]] | `0000000000000000000000000` | `0001` | `101011` | `011010` | `100101101` | .code[.hi2[**10111**]] | | .big[.hi1[
]] | .big[
] unused space | .big[
] | .big[
] | .big[
] | .big[
] | .big[.hi2[
]] | -- .small[
] #### The
reaches Morty's .hi1[
] peer, Summer, and she sees the .hi2[
] director --- class: dark-slide middle .big[.hi1[Distributed] .small[every node is capable of _compact routing_]] .big[.hi2[Secure] .small[.soft[end-to-end encryption •] route around malicious nodes]] .big[.hi3[Permissionless] .small[.soft[IP address self-assignment • autonomous network]]] .big[.hi4[Flat] .small[.soft[random IP addresses • no subnet hierarchy]]] --- class: dark-slide #
Hyperboria
with more than 1000 nodes mostly tunneled over Internet links -- ### DHT source routing limitations - XOR address space distance and DHT does not resemble physical network topology - Nodes lack local visibility to link quality typical of wireless links - 64-bit packet header cannot fit all the directors for long paths with many hops -- ### Supernodes - Supernodes have full network view and offer path discovery service to subnodes - Traffic is still source routed and distributed throughout the mesh --- class: alt-bg #
Yggdrasil Network .col-4[
] .col-8[ ### Yggdrasil
the mythical world tree of Norse cosmology - Auto-configure a self-addressing encrypted network similar to cjdns - Route traffic via paths resembling physical topology - Allow all nodes to make the same assumptions about the network topology without keeping a full view - Guarantee a path to every node, which although unbound in theory, is usually close to the shortest path ] .small[_
https://en.wikipedia.org/wiki/Yggdrasil#/media/File:The_Ash_Yggdrasil_by_Friedrich_Wilhelm_Heine.jpg_] --- class: dark-slide ## Routing in Yggdrasil - Switch layer creates a .alt[globally agreed spanning tree
] -- - A DHT is used to look up the .alt[
] coordinates for a given IP address -- - .alt[
] edges are always direct peers, selected based on peering stability -- - .alt[
] coordinates are shared with peers and cryptographically verifiable from .alt[
] root -- - Switch layer uses .alt[
] coordinate system for greedy embedded routing -- - Each node keeps a partial view of .alt[
] where locally stored state information scale at `O(p*log(n))` for `p` peers in a network with `n` nodes -- - Routing traffic by walking .alt[
] represents a worst-case path with guaranteed reachablity, since greedy routing often take shortcuts not shown on .alt[
] --- class: alt-bg ## Yggdrasil global spanning tree
view from node .hi2[.code[**3efd**] .small[
.code[[ 3 ]]]] .center[
] --
to .hi1[.code[**d40c**] .small[
.code[[ 3 5 2 ]]]] -- - Tree path: .hi2[.code[[ 3 ]]] .small[
] .em[.code[[ 3 5 ]]] .small[
] .hi1[.code[[ 3 5 2 ]]] -- - Greedy path: .hi2[.code[[ 3 ]]] .small[
] .hi1[.code[[ 3 5 2 ]]] --- class: impact .col-3[
] .col-3[
] .col-3[
] .col-3[
] .soft[
] .big[.big[.big[.hi1[
] cjdns .hi2[
] Yggdrasil]]] .soft[
] .col-2[ .big[.big[
]] ] .col-2[ .big[.big[
]] ] .col-2[ .big[.big[
]] ] .col-2[ .big[.big[
]] ] .col-2[ .big[.big[
]] ] .col-2[ .big[.big[
]] ] --- class: impact alt-bg
.code[.soft[.big[**\#tomesh:tomesh.net**] .small[.small[
] **freenode/\#tomesh**]]] .soft[.small[
]] .code[.soft[**\#cjdns:matrix.org** .small[.small[
] **efnet/\#cjdns**]]] .code[.soft[**\#yggdrasil:matrix.org** .small[.small[
] **freenode/\#yggdrasil**]]]