Yggdrasil Network

· rtnF

Andaikan mayoritas Internet beneran diblokir pemerintah tanggal 21 Juli 2022. Ku penasaran pengen set-up overlay network bareng circle-circle terdekat, supaya masih bisa chill & hang-out di tengah suasana post-apocalyptic Internet. Minimal masih bisa chatting lah.

Lalu, di HackerNews, ku tidak sengaja menemukan Yggdrasil.

A cross-platform prototype of an end-to-end encrypted IPv6 overlay network, written in Go. It implements a new and experimental compact routing scheme based around a globally-agreed spanning tree.

Intinya, cara kerjanya itu :

  1. Kita masuk ke Yggdrasil Network (YN) melalui node yang sudah bergabung sebelumnya.
  2. Setelah berhasil bergabung, kita akan mendapatkan identitas di YN : public key dan public IPv6 address.
  3. Setiap node di YN bertindak sebagai client, server dan juga router di jaringan.
  4. Setiap paket yang bergerak di network akan di-end-to-end encryption. Node router tidak bisa mengintip paket yang dia antarkan.

Kuncinya, kita harus berhasil connect ke node yang sudah terhubung ke YN global. Minimal satu node. Dan koneksi ke satu node ini, gak boleh diblokir pemerintah. Atau, buat YN lokal khusus untuk Indonesia. Ya, buat "Internet" baru from scratch. Seru gak tuh. Habis itu, YN lokal Indonesia ini, tinggal didaftarin ke Kominfo biar legal. Untuk buat "Internet" baru ini, minimal perlu server yg nyala 24 jam. Supaya "Internet"-nya bisa terus nyala, ketika usernya gak ada. Server ini, kita sebut dengan "router publik".

Sekarang, gimana caranya network ini patuh dengan aturan Kominfo? Ya simpel. Setiap router publik wajib taat aturan Kominfo. Kalau ada node yang nge-hosting konten terlarang, router publik wajib putuskan akses ke node tersebut. Setiap router publik yang tidak taat aturan, akan.. diblok Kominfo.

Yap, proof of conceptnya udah OK sih. Tinggal modal aja, server VPS? Rp 50.000 per bulan, minimal. Pakai ini, kita bisa bikin "Internet lokal Indonesia" from scratch.

# Tutorial : Jadi Client/Server

Sekarang, kita bahas hal teknisnya.

Pertama, buat file konfigurasi config.conf.

{
  "Peers": [
    tcp://sin.yuetau.net:6642
    tls://sin.yuetau.net:6643
    tcp://ygg.puffer.blog:1883
  ],
  "InterfacePeers": {},
  "Listen": [],
  "AdminListen": "tcp://localhost:5000",
  "MulticastInterfaces": [
    {
      "Regex": ".*",
      "Beacon": true,
      "Listen": true,
      "Port": 0
    }
  ],
  "AllowedPublicKeys": [],
  "PublicKey": "c6eb9a1204f0e9d35dee789ef3aab7b0ca788b176ec0f1aec711d89989f",
  "PrivateKey": "fbd4db75526d477a32c5fd5e8354511c08fda2b4607c650feba9e6c14c9a7981c6eb9a1204f0e9d35dee789ef3aab7b0ca788b176ec0f1aec71",
  "IfName": "Yggdrasil",
  "IfMTU": 65535,
  "NodeInfoPrivacy": false,
  "NodeInfo": null
}

Itu konfigurasi yang saya gunakan. Yang penting itu "peers"-nya, daftar node-node "router publik" yang saya gunakan untuk masuk ke YN.

Langkah selanjutnya, jalankan executablenya.

yggdrasil.exe -useconffile config.conf

Hasilnya begini :

2022/07/19 21:33:00 Build name: yggdrasil
2022/07/19 21:33:00 Build version: 0.4.4
2022/07/19 21:33:00 Starting up...
2022/07/19 21:33:00 Startup complete
2022/07/19 21:33:00 Starting multicast module
2022/07/19 21:33:00 TCP admin socket listening on 127.0.0.1:5000
2022/07/19 21:33:00 Listening for TLS on: [fe80::1c89:37d6:1ceb:71%Wi-Fi]:1229
2022/07/19 21:33:00 Using existing driver 0.14
2022/07/19 21:33:00 Creating adapter
2022/07/19 21:33:01 Connected TCP: 200:7d10:e0ec:d85f:d6bb:7003:c2d4:c865@45.66.218.35, source 192.168.145.128
2022/07/19 21:33:01 Your public key is c6eb9a1204f0e9d35dee789ef3aab7b0ca788b176ec0f1aec719b3101d89989f
2022/07/19 21:33:01 Your IPv6 address is 200:7228:cbdb:f61e:2c59:4423:ec2:18aa
2022/07/19 21:33:01 Your IPv6 subnet is 300:7228:cbdb:f61e::/64

Kita akan mendapat IPv6 address public (200:7228:cbdb:f61e:2c59:4423:ec2:18aa), yang bisa diakses oleh siapapun yang sama-sama terhubung ke YN. Jadi, selain jadi client, kamu juga bisa langsung menjadi server di YN.

# Tutorial : Jadi Public Router

Public router adalah node yang menjadi "pintu gerbang" node-node lain untuk terhubung ke YN. Saya sendiri belum coba langsung, bagaimana jadi public router. Tapi, di website resminya Yggdrasil, ada tutorialnya.

The default Yggdrasil configuration does not listen on any external ports for incoming peering connections. In order to accept peering connections from other nodes, you must add a listener entry to the Listen section of the configuration file. You can bind to any TCP port of your choosing in either plain TCP (e.g. tcp://[::]:12345) or in TLS (e.g. tls://[::]:54321) mode.

You can either limit incoming connections to your host using a firewall by limiting or denying connections to the port specified in your Listen configuration option. This is useful if you want to limit peerings from certain IP ranges or on certain interfaces.

Alternatively, you can limit who can peer with you by modifying the AllowedPublicKeys option in your Yggdrasil configuration. When this list is populated, only the nodes with the specified public keys will be able to establish a peering connection with your node. This is useful if you want to ensure that you can only peer from your own devices or to allow peerings from certain users. When this list is empty, any remote node is allowed to peer with you.