5
Most read
6
Most read
8
Most read
FFMUC: Half a year with WireGuard
VXLAN + B.A.T.M.A.N. and some python included
FFWCW 2021
awlnx
● Annika Wickert
● Senior Network Engineer / OpenSource since 2010
● Twitter @awlnx / Github @awlx
2
Who am I?
3
FFMUC?
• Freie Netze München e.V. since 2014
• Community Freifunk München since 2004
• Wifi
• #FFMEET
• DoH/DoT/DNSCrypt/DNS
• Streaming
4
FFMUC ran on fastd
• FFMUC was built with fastd and B.A.T.M.A.N.
• We got bigger compute nodes and bigger uplinks - we wanted to leverage the
resources
• We didn’t want to change too much at once => not too much risk
• So why not change _only_ the transport network and keep B.A.T.M.A.N.
5
Wireguard vs fastd
• Fastd is a single threaded userspace process
• WireGuard runs in kernel space thus has to be multi threaded
• WireGuard cannot transport Layer 2 protocols - B.A.T.M.A.N. is one ...
• We need another encapsulation which solves this problem => VXLAN
Wireguard
VXLAN
B.A.T.M.A.N.
6
What does it look like in the end?
7
Challenges we already knew
• No systemd-networkd support for B.A.T.M.A.N.
• We are an open network - we don’t want node owners to signup
• WireGuard has a pre-shared key infra
=> we need a daemon which handles incoming keys and programs them
to the gateways
8
WGKex!
9
How does it work?
• WireGuard peers on the gateways are created by wgkex
• Allowed IP is derived from the public key of the node
• VxLAN Forwarding database entries are created by wgkex
10
Get in touch with maintainers
• To get validation data correct for wgkex etc
• We contacted WireGuard maintainers early in the process
• Asked questions about known scaling issues
• Opened PRs early as drafts to see if there is a chance of merging
• systemd-networkd https://github.com/systemd/systemd/pull/17252
• gluon-community-packages
https://github.com/freifunk-gluon/community-packages/pull/6
11
Solve problems upstream!
• We invested much time in systemd-networkd
• We wanted to get our stuff merged in upstream
• No custom solutions for our setup, just upstream compatible which solves many
resource problems in the future
12
Gateways
• Everything is automated with Saltstack
• systemd-networkd takes care of all interfaces
• 800 - 1000 Nodes per gateway are easy
• We are able to run whole FFMUC on just two gateways
13
Debugging … Flamegraphs and Bugs
• WireGuard performs well but we have too much load on our gateways. Why?
14
Upstream fixes!
• B.A.T.M.A.N.
■ https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20201126
153120.1053700-1-sven@narfation.org/
■ https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20201127
173849.19208-4-sw@simonwunderlich.de/
■ https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20201127
173849.19208-2-sw@simonwunderlich.de/
• VxLAN
■ https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20201126
125247.1047977-1-sven@narfation.org/
15
Keep your NTP sync!
• Sync NTP before you try to connect to WireGuard
• If you don’t do that many funky things happen
• OpenWRT defaults its clock to build date of firmware so it works the first few
days after release … because it’s good enough
16
Not enough random during boot
• ERX didn’t have a good enough random seed …
• After flashing, it’s unreachable for … hours … days … maybe weeks?
=> fixed
https://github.com/oszilloskop/UBNT_ERX_Gluon_Factory-Image/issues/
3
17
So is it faster?
18
Lessons learned
• Commit as much stuff as possible upstream
• Work close with upstream
• Get much feedback from all the communities/other people
• Involve as many people as you can
• Start your project anyway ;)
19
What’s next?
• We want to get rid of B.A.T.M.A.N. for gateway uplinks (make broadcast
domains small)
■ Should boost performance by 5x to 7x depending on CPU
■ Maybe VxLAN first, then a fully routed approach
■ https://github.com/freifunkMUC/site-ffm/issues/87
20
Community
• Freifunk Darmstadt and Freifunk Regensburg helped a lot during development
of wgkex!
• B.A.T.M.A.N. developers helped a lot during debugging the performance issue
and created many bugfixes
• Everything is opensource and available on Github
https://github.com/freifunkMUC
• More background and all fixes:
https://ffmuc.net/freifunkmuc/2020/12/03/wireguard-firmware/
21
Thanks to everyone involved
• Freifunk Darmstadt @hexa
• Freifunk Regensburg @MoepMan
• Freifunk Hannover @aiyion, @Codefetch
• systemd Yu Watanabe, Lennart Poettering
• WireGuard Jason A. Donenfeld
• B.A.T.M.A.N. @ecsv @T_X
• All the folks of FFMUC for testing
• Everyone else who we forgot and was involved in any way
=> Community rocks! #Together #OpenSource

More Related Content

PDF
기업의 미래를 바꾸는 AI 플랫폼
PDF
데이터 기반 의사결정을 통한 비지니스 혁신 - 윤석찬 (AWS 테크에반젤리스트)
PDF
Proposal for hrm
PDF
Salesforce crm projects
PPT
Cloud deployment models
PDF
Taking conditional access to the next level
PPTX
Google App Engine
PPTX
Microsoft Azure - Introduction
기업의 미래를 바꾸는 AI 플랫폼
데이터 기반 의사결정을 통한 비지니스 혁신 - 윤석찬 (AWS 테크에반젤리스트)
Proposal for hrm
Salesforce crm projects
Cloud deployment models
Taking conditional access to the next level
Google App Engine
Microsoft Azure - Introduction

What's hot (20)

PDF
Microsoft Azure
PPTX
ERPnext HR Module
PDF
Introduction to Azure
PPTX
Privacy in cloud computing
PDF
The journey toward a self-service data platform at Netflix - sf 2019
PPTX
5 - Infrastructure and Cloud Computing
PDF
einstein-cheatsheet.pdf
PPTX
An intro to Azure Data Lake
PPTX
Microsoft Azure Overview
PPTX
Active DirectoryでDHCPを使う ~DHCPサーバーとクライアントの設定~
PDF
M04_失敗しないための Azure Virtual Desktop 設計ガイド
PDF
Plantas Soho Residence
PPTX
Application Modernization using the Strangler Pattern
PDF
Systems Proposal
PDF
AWS reInvent 2022 reCap AI/ML and Data
PDF
Introduction to Microsoft Azure Cloud
PPTX
AWS PPT.pptx
PDF
Azure cosmos db
PPTX
Introduction to Azure monitor
PDF
「開けゴマ!」からYubiKeyへ
Microsoft Azure
ERPnext HR Module
Introduction to Azure
Privacy in cloud computing
The journey toward a self-service data platform at Netflix - sf 2019
5 - Infrastructure and Cloud Computing
einstein-cheatsheet.pdf
An intro to Azure Data Lake
Microsoft Azure Overview
Active DirectoryでDHCPを使う ~DHCPサーバーとクライアントの設定~
M04_失敗しないための Azure Virtual Desktop 設計ガイド
Plantas Soho Residence
Application Modernization using the Strangler Pattern
Systems Proposal
AWS reInvent 2022 reCap AI/ML and Data
Introduction to Microsoft Azure Cloud
AWS PPT.pptx
Azure cosmos db
Introduction to Azure monitor
「開けゴマ!」からYubiKeyへ
Ad

Similar to FFMUC: Half a year with WireGuard (20)

PDF
FFMEET: running a non-profit conference system
PDF
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDN
PDF
FFMUC goes wild - Infrastructure recap 2020 #rc3
ZIP
How we use Twisted in Launchpad
PPTX
Realtime traffic analyser
PDF
Freifunk Munich - How to scale Jitsi
PDF
Three years of OFELIA - taking stock
PDF
Internet Facing VMs and the DDoS Problem, Wido den Hollander, Your.Online
PDF
Balázs Bucsay - XFLTReaT: Building a Tunnel
PPTX
Introducing Container Technology to TSUBAME3.0 Supercomputer
PDF
Docker for Mac and Windows: The Insider's Guide by Justin Cormack
PPTX
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
PDF
Fixing Docker networking - Milos Gajdos at #DOXLON
PDF
NFV Infrastructure Manager with High Performance Software Switch Lagopus
PDF
FFMUC presents #ffmeet - #virtualUKNOF
PDF
Building a Distributed & Automated Open Source Program at Netflix
PDF
Netflix Open Source: Building a Distributed and Automated Open Source Program
PPTX
The internet of $h1t
PDF
Building a Small DC
PDF
Monkey Server
FFMEET: running a non-profit conference system
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDN
FFMUC goes wild - Infrastructure recap 2020 #rc3
How we use Twisted in Launchpad
Realtime traffic analyser
Freifunk Munich - How to scale Jitsi
Three years of OFELIA - taking stock
Internet Facing VMs and the DDoS Problem, Wido den Hollander, Your.Online
Balázs Bucsay - XFLTReaT: Building a Tunnel
Introducing Container Technology to TSUBAME3.0 Supercomputer
Docker for Mac and Windows: The Insider's Guide by Justin Cormack
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Fixing Docker networking - Milos Gajdos at #DOXLON
NFV Infrastructure Manager with High Performance Software Switch Lagopus
FFMUC presents #ffmeet - #virtualUKNOF
Building a Distributed & Automated Open Source Program at Netflix
Netflix Open Source: Building a Distributed and Automated Open Source Program
The internet of $h1t
Building a Small DC
Monkey Server
Ad

More from Annika Wickert (6)

PDF
Digital Helfen: Ehrenamt im Zeitalter der Digitalisierung
PDF
Flow monitoring explained - From packet capture to data analysis - the use of...
PDF
FFMUC jitsi-report after first two weeks
PDF
Bio routing - DKNOG9
PDF
Raspberry PI 4 Freifunk Offloader
PDF
FFMUC pkg-latest
Digital Helfen: Ehrenamt im Zeitalter der Digitalisierung
Flow monitoring explained - From packet capture to data analysis - the use of...
FFMUC jitsi-report after first two weeks
Bio routing - DKNOG9
Raspberry PI 4 Freifunk Offloader
FFMUC pkg-latest

Recently uploaded (20)

PDF
Uptota Investor Deck - Where Africa Meets Blockchain
DOCX
Powerful Ways AIRCONNECT INFOSYSTEMS Pvt Ltd Enhances IT Infrastructure in In...
PPTX
Basic understanding of cloud computing one need
DOCX
Memecoinist Update: Best Meme Coins 2025, Trump Meme Coin Predictions, and th...
PPTX
MY PRESENTATION66666666666666666666.pptx
PPTX
Reading as a good Form of Recreation
PPTX
KSS ON CYBERSECURITY INCIDENT RESPONSE AND PLANNING MANAGEMENT.pptx
PPTX
在线订购名古屋艺术大学毕业证, buy NUA diploma学历认证失败怎么办
PDF
Alethe Consulting Corporate Profile and Solution Aproach
PDF
simpleintnettestmetiaerl for the simple testint
PPTX
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
PPTX
10.2981-wlb.2004.021Figurewlb3bf00068fig0001.pptx
PDF
Containerization lab dddddddddddddddmanual.pdf
PPTX
Cyber Hygine IN organizations in MSME or
PDF
The Evolution of Traditional to New Media .pdf
PPTX
ECO SAFE AI - SUSTAINABLE SAFE AND HOME HUB
PPTX
Partner to Customer - Sales Presentation_V23.01.pptx
PDF
Top 8 Trusted Sources to Buy Verified Cash App Accounts.pdf
PPTX
Artificial_Intelligence_Basics use in our daily life
PDF
BIOCHEM CH2 OVERVIEW OF MICROBIOLOGY.pdf
Uptota Investor Deck - Where Africa Meets Blockchain
Powerful Ways AIRCONNECT INFOSYSTEMS Pvt Ltd Enhances IT Infrastructure in In...
Basic understanding of cloud computing one need
Memecoinist Update: Best Meme Coins 2025, Trump Meme Coin Predictions, and th...
MY PRESENTATION66666666666666666666.pptx
Reading as a good Form of Recreation
KSS ON CYBERSECURITY INCIDENT RESPONSE AND PLANNING MANAGEMENT.pptx
在线订购名古屋艺术大学毕业证, buy NUA diploma学历认证失败怎么办
Alethe Consulting Corporate Profile and Solution Aproach
simpleintnettestmetiaerl for the simple testint
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
10.2981-wlb.2004.021Figurewlb3bf00068fig0001.pptx
Containerization lab dddddddddddddddmanual.pdf
Cyber Hygine IN organizations in MSME or
The Evolution of Traditional to New Media .pdf
ECO SAFE AI - SUSTAINABLE SAFE AND HOME HUB
Partner to Customer - Sales Presentation_V23.01.pptx
Top 8 Trusted Sources to Buy Verified Cash App Accounts.pdf
Artificial_Intelligence_Basics use in our daily life
BIOCHEM CH2 OVERVIEW OF MICROBIOLOGY.pdf

FFMUC: Half a year with WireGuard

  • 1. FFMUC: Half a year with WireGuard VXLAN + B.A.T.M.A.N. and some python included FFWCW 2021
  • 2. awlnx ● Annika Wickert ● Senior Network Engineer / OpenSource since 2010 ● Twitter @awlnx / Github @awlx 2 Who am I?
  • 3. 3 FFMUC? • Freie Netze München e.V. since 2014 • Community Freifunk München since 2004 • Wifi • #FFMEET • DoH/DoT/DNSCrypt/DNS • Streaming
  • 4. 4 FFMUC ran on fastd • FFMUC was built with fastd and B.A.T.M.A.N. • We got bigger compute nodes and bigger uplinks - we wanted to leverage the resources • We didn’t want to change too much at once => not too much risk • So why not change _only_ the transport network and keep B.A.T.M.A.N.
  • 5. 5 Wireguard vs fastd • Fastd is a single threaded userspace process • WireGuard runs in kernel space thus has to be multi threaded • WireGuard cannot transport Layer 2 protocols - B.A.T.M.A.N. is one ... • We need another encapsulation which solves this problem => VXLAN Wireguard VXLAN B.A.T.M.A.N.
  • 6. 6 What does it look like in the end?
  • 7. 7 Challenges we already knew • No systemd-networkd support for B.A.T.M.A.N. • We are an open network - we don’t want node owners to signup • WireGuard has a pre-shared key infra => we need a daemon which handles incoming keys and programs them to the gateways
  • 9. 9 How does it work? • WireGuard peers on the gateways are created by wgkex • Allowed IP is derived from the public key of the node • VxLAN Forwarding database entries are created by wgkex
  • 10. 10 Get in touch with maintainers • To get validation data correct for wgkex etc • We contacted WireGuard maintainers early in the process • Asked questions about known scaling issues • Opened PRs early as drafts to see if there is a chance of merging • systemd-networkd https://github.com/systemd/systemd/pull/17252 • gluon-community-packages https://github.com/freifunk-gluon/community-packages/pull/6
  • 11. 11 Solve problems upstream! • We invested much time in systemd-networkd • We wanted to get our stuff merged in upstream • No custom solutions for our setup, just upstream compatible which solves many resource problems in the future
  • 12. 12 Gateways • Everything is automated with Saltstack • systemd-networkd takes care of all interfaces • 800 - 1000 Nodes per gateway are easy • We are able to run whole FFMUC on just two gateways
  • 13. 13 Debugging … Flamegraphs and Bugs • WireGuard performs well but we have too much load on our gateways. Why?
  • 14. 14 Upstream fixes! • B.A.T.M.A.N. ■ https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20201126 153120.1053700-1-sven@narfation.org/ ■ https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20201127 173849.19208-4-sw@simonwunderlich.de/ ■ https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20201127 173849.19208-2-sw@simonwunderlich.de/ • VxLAN ■ https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20201126 125247.1047977-1-sven@narfation.org/
  • 15. 15 Keep your NTP sync! • Sync NTP before you try to connect to WireGuard • If you don’t do that many funky things happen • OpenWRT defaults its clock to build date of firmware so it works the first few days after release … because it’s good enough
  • 16. 16 Not enough random during boot • ERX didn’t have a good enough random seed … • After flashing, it’s unreachable for … hours … days … maybe weeks? => fixed https://github.com/oszilloskop/UBNT_ERX_Gluon_Factory-Image/issues/ 3
  • 17. 17 So is it faster?
  • 18. 18 Lessons learned • Commit as much stuff as possible upstream • Work close with upstream • Get much feedback from all the communities/other people • Involve as many people as you can • Start your project anyway ;)
  • 19. 19 What’s next? • We want to get rid of B.A.T.M.A.N. for gateway uplinks (make broadcast domains small) ■ Should boost performance by 5x to 7x depending on CPU ■ Maybe VxLAN first, then a fully routed approach ■ https://github.com/freifunkMUC/site-ffm/issues/87
  • 20. 20 Community • Freifunk Darmstadt and Freifunk Regensburg helped a lot during development of wgkex! • B.A.T.M.A.N. developers helped a lot during debugging the performance issue and created many bugfixes • Everything is opensource and available on Github https://github.com/freifunkMUC • More background and all fixes: https://ffmuc.net/freifunkmuc/2020/12/03/wireguard-firmware/
  • 21. 21 Thanks to everyone involved • Freifunk Darmstadt @hexa • Freifunk Regensburg @MoepMan • Freifunk Hannover @aiyion, @Codefetch • systemd Yu Watanabe, Lennart Poettering • WireGuard Jason A. Donenfeld • B.A.T.M.A.N. @ecsv @T_X • All the folks of FFMUC for testing • Everyone else who we forgot and was involved in any way => Community rocks! #Together #OpenSource