Wiregurad Control Plane
Wiregurad Control Plane
Wiregurad Control Plane
Jordi Paillisse∗† , Alejandro Barcia∗ , Albert Lopez∗ , Alberto Rodriguez-Natal† , Fabio Maino† , Albert Cabellos∗
∗ Computer Architecture Department, UPC-BarcelonaTech, Barcelona, Spain
Email {jordip, alopez, acabello}@ac.upc.edu, [email protected]
† Cisco, San Jose, CA, USA. Email: {natal, fmaino}@cisco.com
Abstract—WireGuard is a VPN protocol that has gained WireGuard only supports one cipher suite, specifically -at the
significant interest recently. Its main advantages are: (i) simple time of this writing- ChaCha20 and Poly1305 (RFC 8439).
configuration (via pre-shared SSH-like public keys), (ii) mobility This greatly simplifies the architecture as well as the code,
support, (iii) reduced codebase to ease auditing, and (iv) Linux
kernel implementation that yields high performance. However, providing also important performance advantages.
WireGuard (intentionally) lacks a control plane. This means that In short, in WireGuard users only have to exchange the
each peer in a WireGuard network has to be manually configured public keys of the endpoints and the IP address of one of
with the other peers’ public key and IP addresses, or by other them to start exchanging data. In fact, the setup is very similar
means. to that of SSH. The underlying implementation takes care of
In this paper we present an architecture based on a centralized
server to automatically distribute this information. In a nutshell, the cryptography aspects of a typical VPN: key derivation,
first we manually establish a WireGuard tunnel to the centralized re-keying timers, anti-replay protection, etc. In addition, Wire-
server, and ask all the peers to store their public keys and IP Guard supports mobility and sends keepalives to maintain NAT
addresses in it. Then, WireGuard peers use this secure channel holes open.
to retrieve on-demand the information for the peers they want to With its ease of deployment, native mobility support and
communicate to. Our design strives to: (i) offer a key distribution
scheme simpler than PKI-based ones, (ii) limit the number of performance, WireGuard is gaining popularity and it is becom-
public keys sent to the peers, and (iii) reduce tunnel establishment ing the de facto VPN standard for certain Internet communi-
latency by means of an UDP-based protocol. We argue that ties. However, WireGuard lacks some critical features to enter
such automation can help the deployment in enterprise or ISP Internet professional scenarios, such as ISPs or Enterprise
scenarios. We also describe in detail our implementation and networks. On the other side, end users that would like to add
analyze several performance metrics. Finally, we discuss possible
improvements regarding several shortcomings we found during confidentiality to their connections usually have to rely on
implementation. deploying IPsec in the underlay, with its associated complexity.
Index Terms—dynamic VPN, wireguard, secure overlays, con- One of the main limitations is that WireGuard lacks a
trol plane control plane. Hence, users have to manually setup the public
keys and IP addresses in all of their endpoints, i.e. when we
I. I NTRODUCTION add a new device to the network we have configure its public
Virtual Private Networks (VPN) are one of the most per- key in all the existing devices. This process is time-consuming
vasive services offered in the Internet. As such, VPNs are and error-prone.
considered a mature technology with well-understood mech- Taking this into account, in this paper we aim to de-
anisms and widely deployed and accepted protocols. Notable sign, prototype and evaluate a control plane for WireGuard.
examples of current VPNs are OpenVPN [1], IKEv2 (RFC Specifically, we focus on three key points. First, automate
4306), or IPSec (RFC 4301). the distribution of WireGuard keys without relying on PKI-
Surprisingly, WireGuard (WG, [2]) is a recent VPN protocol based schemes or DNS-based schemes (e.g. IETF DANE
that has managed to disrupt this mature field [3]–[6]. One [7], [8]). These systems require complex configuration or
of the main reasons behind WireGuard’s success is that it additional infrastructure like a DNS server. On the other
tradeoffs flexibility for simplicity. As opposed to traditional hand, although there exist commercial systems that can offer
VPNs that support a large set of cipher suites and that nego- equivalent functionality, such as Dynamic Multipoint VPN [9],
tiate its capabilities before establishing the secure connection, or modern SD-WAN systems [10], their details are not public.
Second, reduce as much as possible the number of public
This work was partially supported by the Spanish MINECO under contract keys stored in the endpoints, in order to reduce communi-
TEC2017-90034-C2-1-R (ALLIANCE) and the Catalan Institution for cation overhead and avoid sharing unnecessary cryptographic
Research and Advanced Studies (ICREA).
information. Also, we want to be as fast as possible when
Cite as: J. Paillisse, A. Barcia, A. Lopez, A. Rodriguez-Natal, F. Maino, and creating new tunnels. And third, understand and pinpoint
A. Cabellos, “A control plane for wireguard,” in 2021 International Conference other potential limitations of the WireGuard protocol to be
on Computer Communications and Networks (ICCCN), 2021, pp. 1–8, doi:
10.1109/ICCCN52240.2021.9522315.
considered for Enterprise or ISP scenarios.
The proposed control plane works as follows: we store the
public keys of all peers in a central server, that sends them to
the WireGuard peers upon request (fig. 1). This way, users only
© 2021 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future
media, including reprinting/republishing this material for advertising or promotional purposes,creating new collective works, for resale or
redistribution to servers or lists, or reuse of any copyrighted component of this work in other works. http://dx.doi.org/10.1109/
ICCCN52240.2021.9522315
Table I
C OMPARISON OF COMMON DATAPLANE ENCRYPTION PROTOCOLS
Device IP Public key Endpoint IP
Protocol NAT-trav. Mobility Overhead (Bytes)
Dev 1 Key 1 IP A
IPsec tunnel ESP × × 28
Dev 2 Key 2 IP B OpenVPN DTLS
√
× 38
√ √
Dev N Key 3 IP C WireGuard 38
Central
Server Encrypted data
UDP Crypto
Outer IP header Inner IP header Payload
header header
(0) (1) Device N
(2) Internet Mobility Internetworking Access Control
Authentication,
Confidentiality
(3) IP B
IP A Device 2
Device 1 Figure 2. WireGuard header structure
Figure 4. Simplified prototype operation diagram. Solid lines represent data plane traffic flow, dashed lines control plane traffic.
B. Central Server
1
We implemented the aforementioned centralized server as a 0.9
LISP Mapping System, more specifically a single Map Server. 0.8
In other words, all peers send their requests to the same Map 0.7
Server. This Map Server is running a modified version of the 0.6
CDF
Kernel Space
Number of Entries
Physical
Linux Routing Figure 8. Central Server Response Delay
Interface
we artificially generated LISP messages towards the central
Figure 6. Out of the box OOR implementation diagram. Solid lines represent server using LIG, a tool that can create different kinds of LISP
data plane traffic flow, dashed lines control plane traffic. As opposed to the
OOR+WG implementation in fig. 4, data plane traffic is copied between kernel messages [25]. Note that we are measuring the performance of
and userspace, adding overhead. the central server, in other words, both OOR and OOR+WG
messages were unencrytped and there were no tunnels between
1 the central server and the machine sending the requests. We
0.9 repeated this experiment 50 times for each number of elements
0.8 in the server. We can appreciate that the delay does not depend
0.7 on the number of elements because the server implementation
0.6 uses a Patricia Trie [26]. In other words, the maximum number
CDF
0.5 of peers a single server can handle will be limited by its CPU,
0.4 not the database size. Additionally, this experiment quantifies
0.3 OOR the overhead of adding a public key in the central server
0.2 OOR+WG database. We can see that it increases the delay on average 40
0.1 gRPC+WG µs. Again, this modest increase is due to the aforementioned
0 extra 32 bytes.
0 1 2 3 4 5 6 7 8 9 10
Delay to add a new endpoint (ms) D. Handover Delay
Regarding mobility events, figure 9 presents the handover
Figure 7. Delay to request and configure a new endpoint delay for OOR and OOR+WireGuard. We modified the setup
of sec. VI-A by connecting one of the two peers via WiFi
from the central server. We repeated the experiment 150 times
through two possible access points (fig. 10), and we triggered
for the three scenarios. We can appreciate that OOR with
handovers by manually changing the access point of this peer.
WireGuard takes approximately 1.5 ms more than OOR to
We ran a ping of 10 requests/ms between the two machines and
complete this operation. This is due to the fact that we are
measured the amount time without ICMP replies. We repeated
retrieving more information (WireGuard needs the public key,
this experiment 20 times. This test shows that WireGuard
apart from the endpoint IP address) and the overhead of
presents a handover delay nearly one order of magnitude less
configuring the WireGuard interface (as opposed to OOR, in
than OOR. This is due to the fact that the WireGuard handover:
which we can start sending packets directly). Nevertheless,
(i) operates in kernel space, and (ii) it does not require control
since the WireGuard public keys are 32 bytes, the performance
plane signaling, as opposed to OOR, that issues a new Map
penalty of downloading this extra information is negligible
Request / Map Register in this situation.
compared to typical Internet latency [24]. On the other hand,
From an architecture point of view, we observe that adding
the gRPC prototype presents a delay double to OOR+WG, due
a security association simplifies mobility, because we can
to the overhead of its HTTP/2 transport.
learn new endpoints through the data plane with virtually no
signalling. In addition, if the endpoint IP address is spoofed,
C. Central Server Scalability
the payload is protected by the WG crypto header. On the
We also evaluated the scalability of the centralized server. other hand, this technique does not cover corner cases such
Figure 8 presents the delay to answer a request for endpoint as double jump. This is in line with the design philosophy of
data for both OOR and OOR with WireGuard, depending on WireGuard, that sacrifices flexibility for simplicity.
the number of elements in the central server. Specifically,
we measured the processing delay of the central server, i.e. E. Data Plane Performance
the time since it receives a data request until it generates Finally, we measured the data plane throughput. Fig. 11
the corresponding response. To perform this measurement, presents the input and output rate for our OOR+WireGuard
10 1000
9
Handover Delay (s)
900
8 800
7
Output (Mbps)
6 700
OOR 600
5
4 WG 500
3 400
2 300
1 OOR+WG
0 200 OOR
0 2 4 6 8 10 12 14 16 18 20 100 IPsec
0
Test # 0 200 400 600 800 1000
Figure 9. Handover delay Input (Mbps)