Sie sind auf Seite 1von 6

Performance Evaluation of Open-Source

VPN Software Implementations


Hasan Redžović, Graduate Student Member, IEEE, Aleksandra Smiljanić, Member, IEEE,
and Slavko Gajin

Abstract—VPN software implementations provide high two or more VPN gateways which have private networks
flexibility and low cost of development. There are different behind them. The VPN gateway is usually a router with VPN
approaches for VPN software implementations. One type of VPN features that can be realized as hardware or software solution.
software solution utilizes built-in kernel implementation of AH VPN hardware solutions are provided by several vendors such
and ESP protocols. The second approach are software VPN as Cisco, Nortel, IBM, and Checkpoint. Their advantages with
solutions that use full user-space IPsec implementation. In this
paper, we analyze these two approaches and compare their
respect to software solutions are better performance and lower
performances on 10Gbps links. energy consumption achieved by the specialized hardware [2].
On the other hand, software solutions are highly flexible. It is
Index Terms— IPsec protocol; strongSwan; Rockhopper VPN; easier and faster to build and test new features in software
performance evaluation; software VPN. environment. In this paper we evaluate performance of two
different approaches for implementation of VPNs using IPsec
protocol:
I. INTRODUCTION
• VPN software solutions that use kernel implementation
A virtual private network (VPN) extends a private network of AH and ESP protocols. The examples are:
across public network, such as the Internet. VPN enables strongSwan, Openswan, Libreswan;
users to send and receive data across unsecured public
networks as if their computing devices were connected to the • Full user-space IPsec implementation. Open source
same cohesive private network. VPNs provide benefit for software Rockhopper VPN implements IKE and ESP
everyone who wants to communicate without a fear of protocol in user space.
disclosing private information. VPN can be implemented with
Our focus is on strongSwan [3] and Rockhopper VPNs [4]
various protocols which operate at different levels of OSI
as these are two most commonly used software solutions.
model. IP layer VPN implementation using Internet Protocol
StrongSwan is open source IPsec based VPN solution with
security (IPsec) [1] protocol provides protection for all user-
many different features. StrongSwan runs on Linux 2.6, 3.x
space applications using particular routes. IPsec protocol
and 4.x kernels, Android, Maemo, FreeBSD and Mac OS X.
comprises a set of security protocols which have different
Rockhopper VPN is IPsec/IKEv2-based VPN software that
functionalities:
provide simple and intuitive interfaces for fast and easy VPN
• Internet Key Exchange (IKE) - handles authentication configuration. In addition, Rockhopper VPN provides a large
and periodical exchange of symmetric keys. It provides variety of functions: Virtual Ethernet (Ethernet over IPsec),
different methods of authentication such as Pre-Shared Routing-based VPN, Role-based ID management and
Key and X.509 certificates; configuration, AJAX-based (Comet) Web management
interface for configuring and monitoring, and so on.
• Authentication Header (AH) - provides data integrity; Linux kernel generally cannot achieve I/O speeds of
• Encapsulating Security Payload (ESP) - provides data 10Gbps for IP packet smaller than 512 bytes. Implementation
integrity and confidentiality. of IPsec protocol have additional negative impact on
performance. Our tests of strongSwan and Rockhopper will
IPsec protocol works in two modes: transport and tunnel. show extent of the performance degradation due to processing
Transport mode protects only IP payload, and tunnel mode associated with VPN functionalities. AH and ESP protocols
protects entire IP packet which includes IP header and were implemented in kernel to achieve better performance
payload. The common way to implement VPN is to connect comparing to the user-space implementations. When IPsec is
implemented in user space, IP packet must travel full path
Hasan Redžović is with the Innovation Center of School of Electrical
Engineering, University of Belgrade, 73 Bulevar kralja Aleksandra, 11020 through kernel network stack before being processed by VPN
Belgrade, Serbia (e-mail: hasanetf@live.com). software and transformed into IPsec packet.
Aleksandra Smiljanić is with the School of Electrical Engineering, Kernel ESP/AH protocol implementation is advantageous
University of Belgrade, 73 Bulevar kralja Aleksandra, 11020 Belgrade, Serbia
(e-mail: aleksandra@etf.rs). with respect to performance, but implementing security
Slavko Gajin is with the School of Electrical Engineering, University of functions in kernel space is intricate as it needs to fit
Belgrade, 73 Bulevar kralja Aleksandra, 11020 Belgrade, Serbia (e-mail: coherently resource management and protection functions
slavko.gajin@etf.bg.ac.rs).
provided by limited kernel environment. Moreover, AH and ESP defined by IPsec both add frames to the
developing modules in kernel space, such as device drivers, TCP/IP packet itself, ESP also adds an Initialization Vector
generally requires more complicated debugging steps than (IV) and a trailer. The size of this additional data depends on
implementing applications in user space. the IPsec protocol and used mode. Fig. 2 shows ESP protocol
Software solutions, like netmap [5] and Intel DPDK [6], overhead for tests that we conducted.
bypass kernel network stack and provide network interfaces
directly to the user space applications. These platforms Outer IP
ESP header IP packet ESP trailer
improve system I/O performance as they achieve 10Gbps line header
speeds for minimal sized packets. These software tools will be 20 Bytes 16 Bytes 42 - 1500 Bytes 14 - 45 Bytes
used to determine capabilities of IPsec packet processing.
The paper is organized as follows. Impact of the IPsec Fig. 2. IPsec overhead with ESP protocol in tunnel mode.
overhead on performance is examined in Section 2. Sections 3
and 4 describe main features of strongSwan and Rockhopper ESP provides confidentiality protection of different
VPN solutions. Section 5 presents testing environment, and encryption algorithms. In our tests we used AES (Advanced
Section 6 presents results of the performance evaluation. Encryption Standard) algorithm with 256 bits long cipher
Finally, Section 7 concludes the paper. blocks. For every packet, ESP trailer is expanding to a size
that fits the AES cipher block size.
II. IPSEC PROTOCOL OVERHEAD
IPsec protocol encapsulates IP packet with AH or ESP
fields which imposes additional overhead in 10Gbps data
transfers. In this section, we analyse the influence of this
overhead on the transfer rates of IP packets.

Start of Ethernet Ethernet Interpacket


Layer Preambule frame IP packet
delimiter header trailer gap

7 Bytes 1 Byte 14-18 Bytes 42 - 1500 Bytes 4 Bytes 12 Bytes


Ethernet
Layer
← 60 – 1522 Bytes →

Physical
layer
← 68 – 1530 Bytes →

Fig. 1. IP packet encapsulation in Ethernet frame.

Fig. 1 depicts an IP packet encapsulated in Ethernet frame.


Fig. 3. Comparison of maximal PPS with and without ESP protocol
After adding all necessary fields for transferring IP packet overhead.
between two peers in the same network medium, IP packet is
encapsulated into a frame on physical layer which size vary Due to the alignment, ranges of slightly different IP
between 68 and 1530 bytes. Every packet transmitted on packets will have the same IPsec packet sizes. Equation (2)
physical layer is followed by an interpacket gap, which defines IPsec packet size with ESP protocol in tunnel mode:
represents idle time between packet transmissions. For 42
bytes long IP packet, it is necessary to send 80 bytes (or 84  Pl + Bsize − Pl mod Bsize + X , Pl mod Bsize ≠ 0
bytes for 802.1Q standard) on physical layer. Pipsec =  (2)
 Pl + X , Pl mod Bsize = 0
Operating system communicates with the NIC (Network
Interface Controller) to send or receive Ethernet packets.
Parameter Packets per Second, PPS, can be calculated using In (2), IPsec packet size is defined as Pipsec , Pl represents
equation: data intended for encryption, Bsize is cipher block size, and
parameter X represents combined overhead which includes
Bm ESP header, outer IP header and static fields in ESP trailer.
PPS = (1)
(20 + Psize ) *8 For observed case of cipher block size of 256 bits, IPsec
overhead vary between 50 and 81 bytes. PPS can calculated
where parameter Bm is the maximal bit rate of the port, as:
and Psize is the Ethernet packet size. In Equation (1), 20 bytes
Bm
are added fields on physical layer which represent preamble, PPSipsec = (3)
start of frame delimiter and interpacket gap. (20 + Pip sec ) *8
Equation (3) shows that every packet has additional systems. The TUN/TAP device driver emulates virtual
overhead between 70 and 101 bytes. Fig. 3 shows comparison Ethernet functionality. Using TUN/TAP, the ESP protocol
between PPS and PPSipsec for different packet sizes on stack is connected to the TCP/IP network stack in kernel space.
The network processing by TCP/IP stacks, such as IP routing
10Gbps link. The largest packet throughput, PPS, is and MAC address resolution, is already completed for the
14.88Mpps which is achieved for shortest packets 64 bytes packet that reaches a virtual Ethernet interface. Rockhopper
long. The largest PPSipsec value, in the case of IPsec, is VPN encapsulates packets and send them to the appropriate
IPsec tunnel by searching the mapping table storing the
8.56Mpps for shortest packets of 64 bytes, which is about
destination MAC address and Security Parameter Index (SPI).
42.5% slower than the maximal packet throughput with no This design decision enables more flexible and useful
IPsec. development platform for advanced or experimental IPsec
functions.
III. STRONGSWAN
Rockhopper VPN run two independent processes during
StrongSwan was originally based on a discontinued the execution. One of these processes is using privileged
FreeS/WAN project. StrongSwan has IKE daemon that has administrator capabilities, and it is used to process protected
been written in a modern object-oriented coding style. services, such as the key store service that manages
Initially, strongSwan IKE daemon only supported IKEv2. authentication information like public/private key pairs, digital
IKEv1 was handled by an extended version of FreeS/WAN's certificates, and Pre-shared Keys (PSK), as well as the
Pluto daemon. Support for IKEv1 was added to the new configuration service for provisioning network stacks such as
daemon with strongSwan 5.0.0, because adoption of IKEv2 network interfaces and routing tables.
by other vendors took longer than it was anticipated. The other Rockhopper process is used for components that
IKE daemon operates in user space. Also this daemon are executed with restricted user capabilities. These
configures AH and ESP protocols in kernel, and components handle communication with external entities, such
communicates with them through kernel. This is some of the as the IKE protocol stack or a Web-based management
strongSwan advanced features: interface using the socket API. Both processes interact with
each other to provide the VPN service as a whole.
• Fully tested support of IPv6 IPsec tunnel and transport This software contains a different functionalities: Virtual
connections; Ethernet (Ethernet over IPsec), Routing-based VPN, Role-
• NAT-Traversal via UDP encapsulation and port floating based ID management and configuration, AJAX-based
(Comet) Web management interface for configuring and
(RFC 3947);
monitoring, and so on.
• Secure IKEv2 EAP (Extensible Authentication Protocol) Users or developers can use Web management interface to
user authentication; easily develop or customize their original management tools
• Authentication based on X.509 certificates or preshared or consoles on Web browsers.
keys;
V. TESTING ENVIRONMENT
• Retrieval and local caching of Certificate Revocation
Tests were performed using three physical machines
Lists via HTTP or LDAP;
connected with 10Gbps links, shown in Fig. 4. Machine R1
• Full support of the OCSP (Online Certificate Status generate IP traffic toward the VPN gateway. Using ESP
Protocol - RFC 2560); protocol, IPsec tunnel was established between VPN gateway
and physical machine R2. VPN gateway encapsulates all
• Certificate Authority management (OCSP and CRL incoming IP packets from R1 and sends them to R2. Physical
URIs, default LDAP server); machine R2 decapsulates received ESP packets and measures
• Support of Diffie-Hellman Elliptic Curve groups and data rates on NIC interfaces ens6f1.
Elliptic Curve Digital Signature Algorithm certificates
(Suite B, RFC 4869).
EPS tunnel
The focus of strongSwan is on: (i) Simplicity of eth0 10Gbit/s enp1s0f0 enp1s0f2 10Gbit/s ens6f1

configuration; (ii) Strong encryption and authentication


methods; (iii) Powerful IPsec policies supporting large and R1 R2
complex VPN networks; (iv) Modular design with great VPN Gateway
expandability.
Fig. 4. The testing environment.
IV. ROCKHOPPER VPN
VPN gateway and R2 have strongSwan and Rockhopper
Rockhopper VPN software implements all components of VPNs installed, respectively. IPsec tunnel is established using
IPsec protocol in user space only, including ESP protocol the same VPN software on both sides. ESP protocol uses the
stack. This is implemented using the standard TUN/TAP
following configuration for the established IPsec tunnel:
device driver supported by the most recent Linux operating
• Encryption Algorithm - 256 bit key AES-CBC PPS value is around 2Mpps.
(Advanced Encryption Standard - Cipher Block The second and third tests were conducted for strongSwan
Chaining); and Rockhopper VPN with 4 data flows. Fig. 6 shows
throughput measured by packets per second for strongSwan
• Integrity Algorithm - 256 bit key SHA2_512_256 and Rockhopper VPNs together with the maximal possible
HMAC (Secure Hash Algorithm 2 Hash-based Message throughput. This figure also show experimental and maximal
Authentication Code); throughputs when the IPsec is disabled.
• Pseudo-random Function - SHA2_512 PRF;
• Diffie Hellman Group - 2048 bit, DH Group 14,
modp2048.
StrongSwan and Rockhopper VPNs are using this
configuration, so that the parameters of the testing
environment are as similar as possible.
We use fixed size packets in our tests, which can belong to
one or multiple flows. A data flow is a sequence of packets
from a source to a destination peer, with the same IP/TCP
headers. Many modern NICs have RSS (Receive Side
Scaling) feature that enables kernel-mode network processing
load across multiple processor cores. When RSS is enabled,
the data flows are distributed across different processing
cores, providing parallel packet processing in kernel space.
Generating multiple data flows enable us to evaluate RSS
feature on the overall system network performance, with or
without IPsec tunnel.
Regardless of the RSS feature, Linux kernel packet
processing on 10Gbps links is very demanding due to data
copying, meta-data management and system call overhead.
Fig. 5. PPS values on R2 interface for different number of flows comparted
The highest PPS value on 10Gbps links is 14.88Mpps. Our with maximal theoretical PPS values.
preliminary tests show that Linux kernel network stack can
achieve 2.5 Mpps at best. Thus, R1 is using Intel DPDK
packet generator. This packet generator can process
14.88Mpps by using a single CPU core.
R1 sends IP packet to VPN Gateway, where strongSwan or
Rockhopper VPN encapsulates the IP packet into ESP packet.
Same VPN software decapsulates ESP packets on R2. Also,
R2 is measuring data rate for received and decapsulated IP
packets. From measured data rates we were able to calculate
PPS.

VI. PERFORMANCE EVALUATION


We conducted three tests. For all tests, R1 generated
packets between 64B and 1500B in range from one to six data
flows. Every stream of packets was measured for 30 second in
which the average packet throughput, PPS, was calculated and
recorded. The measured data rates and PPS were used to
compare the performance of strongSwan and Rockhopper.
In the first test, IPsec was disabled. The purpose of this test
is to determine capabilities of kernel in our testing
environment. Fig. 5 shows PPS values for different numbers
of data flows measured on the R2 interface. The PPS values in
Fig. 5 have small variance for different measurements, and the
best overall PPS is achieved for 4 data flows. Our physical
Fig. 6. StrongSwan and Rockhopper VPN PPS values for 4 data flows,
machines use CPUs with 4 cores, and the best mapping with together with the maximal possible throughput.
RSS features is achieved for 4 data flows. The maximal PPS
value that we measured is 2.5Mpps, and the maximal average Packet throughput of StrongSwan does not change
significantly as packet sizes vary. The maximal strongSwan implemented in kernel space. Depending on the CPU type,
packet throughput is 0.35Mpps, which is much smaller than kernel can use different cryptographic optimization
the maximal theoretical IPsec packet throughput for 10Gbps mechanisms such as Intel AES-NI [11]. This can partially
links, as shown in Fig.6. The maximal packet throughput of improve performance of IPsec packet processing. In addition
Rockhopper VPN is unacceptably low, equal to, 0.054Mpps. to the performance optimization, kernel space provides faster
network processing environment, because packets do not
travel to user space. All mentioned optimization mechanisms
give advantage to strongSwan when compared to the
Rockhopper VPN.
However, software platform that bypass kernel, such as
DPDK and netmap, provide very fast I/O interface to user
space with unnoticeable impact on CPU performance. User
space application such as Rockhopper VPN could be
significantly improved with fast I/O interface and encryption
algorithms optimizations mentioned in [8] and [10].

VII. CONCLUSION
We looked how IPsec overhead affects maximal packet
throughputs on 10Gbps links. IPsec protocol overhead
depends on used protocols (AH or ESP) and encryption
algorithms. We presented and tested two different types of
VPN software implementations, strongSwan and Rockhopper.
These two IPsec softwars comprise a complete set of IPsec
algorithms and options, and can be used in practice. The
extent of performance degradation caused by IPsec
functionality of strongSwan and Rockhopper was analyzed.
Fig. 7. StrongSwan and Rockhopper Gbps values for 4 data flows, together Both protocols have unacceptably low performance for
with the maximal possible throughput shortest packets which is less than 0.5Mpps. However,
strongSwan can achieve 4Gbps for largest packets.
The throughputs of Fig.6 measured in Gbps are presented in
StrongSwan has much better performance than Rockhopper as
Fig.7. StrongSwan minimal and maximal data rates are
it is implemented in kernel. Performance of Rockhopper
0.9Gbps for 64B packet size and 4.2Gbps for 1500, packet
which is implemented in user space, might be improved by
size respectively. Rockhopper minimal and maximal data
bypassing of kernel with softwares such as DPDK and
rates are 0.01Gbps for 64B packet size, and 0.64Gbps for
netmap, and by utilization of different encryption algorithms
1500 packet size respectively. The maximal network kernel
optimization mechanisms.
performance degradation caused by strongSwan is 84.5 %,
and the maximal degradation caused by Rockhopper is 98.7%.
ACKNOWLEDGMENT
The encryption algorithms used in IPsec protocol require
intensive processing, and many commercial IPsec routers use This work was supported by the Serbian Ministry of
hardware acceleration modules to achieve required speeds. Science and Education (project TR-32022), and companies
Also, there are software routers that use IPsec optimization Telekom Srbija, and Informatika.
with GPU cards which are well suited for cryptographic
processing [7]. Paper [8] explores PacketShader, a high- REFERENCES
performance software router framework, in combination with [1] "RFC4301: Security Architecture for the Internet Protocol," Network
massively-parallel processing power of GPU to address the Working Group of the IETF, 2005. [Online]. Available:
http://tools.ietf.org/html/rfc4301#page-4. [Accessed 2016].
CPU bottleneck in current software routers. The results of [2] E. Guillen, A. M. Sossa and E. P. Estupiñán, "Performance Analysis
initial tests with CPU-only IPsec packet processing with over Software Router vs. Hardware Router: A Practical Approach," in
optimized RouteBricks software framework is 1.9Gbps for World Congress on Engineering and Computer Science WCECS, San
Francisco, 2012.
64B and 6.1Gbps [9]. They were able to outperform [3] A. Steffen, "strongSwan," Institute for Internet Technologies and
RouteBricks by factor of 3.5 regardless of packet sizes. Paper Applications, 2005. [Online]. Available: https://www.strongswan.org/.
[10] proposed exploiting parallelism to scale RouteBricks [Accessed 2016].
[4] T. Hanada, "Rockhopper VPN," 2011. [Online]. Available:
software router, and achieved 1.4Gbps for 64B on a single http://rockhoppervpn.sourceforge.net/. [Accessed 2016].
RouteBricks router. In all these cases, simplified IPsec [5] L. Rizzo, "netmap: a novel framework for fast packet I/O," in USENIX
processing was assumed, and it was shown that it demands Annual Technical Conference, 2012.
[6] "DPDK - Data Plane Development Kit," Intel, 2011. [Online].
large computing resources, so that CPU becomes a bottleneck Available: http://dpdk.org/. [Accessed 2016].
in packet processing path through system.
StrongSwan uses AH and ESP protocol that are
[7] O. Harrison and J. Waldron, "Practical Symmetric Key Cryptography on [10] M. Dobrescu, N. Egi and K. Argyraki, "RouteBricks: Exploiting
Modern Graphics Hardware," in USENIX Security Symposium, Dublin, Parallelism To Scale Software Routers," Intel Labs Berkeley, Lausanne,
2009. 2008.
[8] S. Han, K. Jang, K. Park and S. Moon, "PacketShader: a GPU- [11] "Intel® Data Protection Technology with AES-NI and Secure Key,"
Accelerated Software Router," in SIGCOMM, New Delhi, 2010. Intel Corporation, 2016. [Online]. Available: http://goo.gl/N6lsPi.
[9] "RouteBricks," 2009. [Online]. Available: http://routebricks.org/. [Accessed 2016].
[Accessed 2016].

Das könnte Ihnen auch gefallen