Experimenting with Matrix federation over Yggdrasil Bachelor - - PowerPoint PPT Presentation

experimenting with matrix federation over yggdrasil
SMART_READER_LITE
LIVE PREVIEW

Experimenting with Matrix federation over Yggdrasil Bachelor - - PowerPoint PPT Presentation

Experimenting with Matrix federation over Yggdrasil Bachelor Semester Project Timothe Floure Responsible / Prof. Bryan Ford Supervisor / Cristina Basescu EPFL / DEDIS 2020-01-13 Timothe Floure (EPFL / DEDIS) Matrix over Yggdrasil


slide-1
SLIDE 1

Experimenting with Matrix federation

  • ver Yggdrasil

Bachelor Semester Project

Timothée Floure

Responsible / Prof. Bryan Ford Supervisor / Cristina Basescu

EPFL / DEDIS

2020-01-13

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 1 / 20

slide-2
SLIDE 2

Big Picture

Matrix: modern, federated (instant) messaging system. Yggdrasil: experimental P2P overlay network, providing E2EE and compact routing (ish). Aim of this project: have matrix homeservers exchanging over the Yggdrasil network.

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 2 / 20

slide-3
SLIDE 3

Matrix + Yggdrasil

Project discussed with Matthew Hodgson from Matrix.org. Neil Alexander from Yggdrasil was interested to support this project. Personal interest in Matrix and P2P systems.

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 3 / 20

slide-4
SLIDE 4

Matrix 1/2

Figure 1: Three Matrix homeservers, each with one client connected.

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 4 / 20

slide-5
SLIDE 5

Matrix 2/2

Modern feature: media support, message history, end-to-end encryption, VoIP bridging to other IM services. 1.0 milestone reached during the first half of 2019. Communications done over HTTP(S). A few rough edges, but active community and going in the right direction!

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 5 / 20

slide-6
SLIDE 6

Yggdrasil 1/3

Experimental P2P, end-to-end encrypted, self-arranging overlay network. Routing inspired from Robert Kleinberg’s Geographic Routing Using Hyperbolic Space. No automatic peering management or naming system.

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 6 / 20

slide-7
SLIDE 7

Yggdrasil 2/3

Can be embedded into applications using Go library (August 2019). Draft specification published (mid-fall 2019).

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 7 / 20

slide-8
SLIDE 8

Yggdrasil 3/3

Figure 2: Representation of Yggdrasil’s spanning tree, 2020-01-05.

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 8 / 20

slide-9
SLIDE 9

Matrix + Yggdrasil

Integration with Matrix homeserver. Yggdrasil address resolution. HTTP over Yggdrasil. Practical Yggdrasil peering.

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 9 / 20

slide-10
SLIDE 10

How does it look?

Figure 3: Overview

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 10 / 20

slide-11
SLIDE 11

Integration with Matrix homeserver

Initially wanted to use Dendrite, next-gen homeserver written in Go. Dendrite federation was not working properly yet. Switched to use Synapse, the reference (python) homeserver implementation. Direct integration was not possible anymore (no python Yggdrasil library). => HTTP-over-Yggdrasil-and-Back proxy

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 11 / 20

slide-12
SLIDE 12

Yggdrasil address resolution

NodeID (sha512sum of encryption key). Falling back to standard DNS insfrastructure.

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 12 / 20

slide-13
SLIDE 13

HTTP over Yggdrasil

Initially wanted to leverage Go’s net/http. Realized that Yggdrasil exposes connections more akin to UDP than TCP. CoAP (COnstrained Application Protocol) as a translation layer.

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 13 / 20

slide-14
SLIDE 14

CoAP as a translation layer

Defined over UDP by RFC7252. Build with low-bandwith, unreliable links in mind. REST-like! Previous low-bandwith experiment by matrix.org. go-ocf/go-coap library.

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 14 / 20

slide-15
SLIDE 15

Practical Yggdrasil peering

No automatic peering update / bootstrapping. Peers discovered from actual traffic (DNS). Periodic routine updating peers based on latency/usage/stability.

Work-in-progress.

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 15 / 20

slide-16
SLIDE 16

Output

go-ocf/go-coap fork adding Yggdrasil support. matrix-org/synapse fork adding federation proxying + yggdrasil NodeID resolution. matrix-yggdrasil-http-proxy.

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 16 / 20

slide-17
SLIDE 17

It works!™

Figure 4: A working proof-of-concept

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 17 / 20

slide-18
SLIDE 18

Future work

Compression! Peer selection. In-browser homeserver & Dendrite integration. Homeserver discovery and name resolution. Extended testing and real-world usage. => Will likely be discussed at FOSDEM.

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 18 / 20

slide-19
SLIDE 19

Thanks

Cristina Basescu from DEDIS. Neil Alexander and Arceliar from Yggdrasil. Matthew Hodgson from the Matrix.org Foundation.

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 19 / 20

slide-20
SLIDE 20

Wrapping up: Matrix over Yggdrasil

Matrix: federated IM system.

Synapse reference (python) homeserver, Dendrite next-gen (Go) homeserver.

Yggdrasil: E2EE, self-arranging P2P overlay network. Routing inspired from Robert Kleinberg’s work. CoAP: low-bandwith REST-like protocol defined over UDP. matrix-yggdrasil-http-proxy: HTTP to CoAP over Yggdrasil and back.

Timothée Floure (EPFL / DEDIS) Matrix over Yggdrasil 2020-01-13 20 / 20