Вы находитесь на странице: 1из 6

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/304287577

Experimental performance comparison between TCP vs UDP tunnel using


OpenVPN

Conference Paper · December 2015


DOI: 10.1109/CCCS.2015.7374133

CITATIONS READS
6 312

3 authors, including:

Irfaan Coonjah K.M.s. Soyjaudah


University of Mauritius University of Mauritius
6 PUBLICATIONS   8 CITATIONS    175 PUBLICATIONS   333 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Keystroke View project

All content following this page was uploaded by Irfaan Coonjah on 28 August 2018.

The user has requested enhancement of the downloaded file.


Experimental Performance Comparison between
TCP vs UDP tunnel using OpenVPN
Irfaan Coonjah Pierre Clarel Catherine K. M. S. Soyjaudah
Faculty of Engineering School of Innovative Technologies and Engineering Faculty of Engineering
University of Mauritius University of technology, Mauritius University of Mauritius
Réduit, Mauritius La Tour Koenig, Pointes aux Sables Réduit, Mauritius
irfaan.coonjah@umail.uom.ac.mu ccatherine@umail.utm.ac.mu ssoyjaudah@uom.ac.mu

Abstract—The comparison between TCP and UDP tunnels TCP traffic.


have not been sufficiently reported in the scientific literature. This document is organized into the following sections:
In this work, we use OpenVPN as a platform to demonstrate the
performance between TCP/UDP. The de facto belief has been • Section II covers Virtual Private Network, with different
that TCP tunnel provides a permanent tunnel and therefore layers in the OSI model.
ensures a reliable transfer of data between two end points. • Section III covers Transmission Control Protocol, TCP
However the effects of transmitting TCP within a UDP tunnel
has been explored and could provide a valuable attempt. The
tunnel.
results provided in this paper demonstrates that indeed TCP in • Section IV covers User Datagram Protocol, UDP tunnel.
UDP tunnel provides better latency. Throughout this paper, a • Section V makes a comparison between TCP and UDP.
series of tests have been performed, UDP traffic was sent inside • Section VI details the experimental testing.
UDP tunnel and TCP tunnel successively. The same tests was • Section VII describes the Physical framework.
performed using TCP traffic.
• Section VIII details the performance measures.
I. I NTRODUCTION • We then conclude by giving the results and observations
in section IX.
An IP tunnel [1] is an Internet Protocol (IP) network
communications channel between two networks. It is used to
transport another network protocol through encapsulation. It II. V IRTUAL P RIVATE N ETWORK (VPN)
does so by encapsulating its own network protocol within the
TCP/IP packets carried by the Internet. IP tunnels are used A virtual private network (VPN) [3] makes use of a public
to connect two separate IP networks that are not directly network to connect multiple remote locations. A VPN expands
connected to each other. Tunneling protocol allows a user a private network using a public network, such as the In-
to access a network service which the underlying network ternet by establishing a point-to-point connection and virtual
does not support. Tunneling [2] can hide the nature of the tunneling protocols. It allows a computer to communicate
traffic that is run through the tunnel, using encryption standard across public networks as if it is plugged directly to the
to repackage traffic data into a different form. The tunnel- private network. A VPN is a logical network on top of an
ing protocol works by using the data portion of a packet already existing network. Different VPN solutions work on
(the payload) to carry the packets that provide the service, different layers in the Open System Interconnect (OSI) model
making use of a layered protocol model such as those of [4]. In the tunnels, the traffic is encrypted and sent through
the Open Systems Interconnection model (OSI) or TCP/IP using the lower layers in the OSI model. The VPN traffic
protocol suite. Tunneling is used in all VPNs; one common is split up from any other network traffic by using encrypted
open source application layer solution available is OpenVPN tunnels between the VPN hosts. Inside a tunnel, the forwarded
(Open Virtual Private Network). The popularity of VPNs has traffic is encapsulated into a special packet format on which
increased due to its low cost and the security it provides. The a block cipher is used to encrypt the traffic [5]. As mentioned
trade-offs between TCP and UDP regardless of VPN usage is in the previous paragraph, a VPN can work on different
always said to be the same: Speed is sacrifice for reliability layers of the OSI model. Three common types of VPNs are
as UDP is connectionless and the server sending the data Application Layer VPNs, Network Layer VPNs and Datalink
theoretically does not ensure if it reaches the destination or Layer VPNs. Secure Shell (SSH), Secure Sockets Layer (SSL),
not. UDP is claimed to be faster but TCP is meant to be and OpenVPN are VPNs that work on the Application layer
more reliable. This paper focuses on such comparison and of the OSI model [6]. The tunneled traffic is encapsulated into
evaluates the efficiency between UDP tunnel and TCP tunnel application specific headers before being sent to the other side
using OpenVPN. Throughout this paper, a series of tests have using the available Transport Layer Protocol [7], such as User
been performed, UDP traffic was sent inside UDP tunnel and Datagram Protocol (UDP) or Transmission Control Protocol
TCP tunnel successively. The same tests was performed using (TCP).
III. T RANSMISSION C ONTROL P ROTOCOL (TCP) level, an application may use the Transmission Control Pro-
Transmission Control Protocol/Internet Protocol (TCP/IP) is tocol (TCP) or Stream Control Transmission Protocol (SCTP)
the language with which computers communicate [8]. TCP/IP which are designed for this purpose. Lacking reliability, UDP
is a protocol which determines how two computers address applications must generally be willing to accept some loss,
each other and transfer data to each other. TCP is a connection errors or duplication. Streaming media, real-time multiplayer
oriented protocol [9] which means that a logical connection is games and voice over IP (VoIP) are examples of applications
established between two devices before transferring data. This that make use UDP. In these applications, packet loss is not
is achieved by following a specific set of rules that specify always a fatal problem. Voice and video traffic is transmitted
how a connection should be initiated, negotiated, managed using UDP, real-time video and audio streaming protocols
and eventually terminated. TCP/IP therefore makes use of can have occasional packet lost, so only slight degradation
extensive algorithms to ensure reliable delivery of packets in quality occurs, rather than large delays if the lost packets
with the use of 5 acknowledgments messages. TCP sender has to be retransmitted.
maintains a copy of all transmitted data until the receiver V. C OMPARISON BETWEEN TCP AND UDP
has completed an accurate transfer of the data. TCP drivers
break up data stream into discrete segments, and attach a TCP The adjustments between TCP and UDP regardless of VPN
header to each segment before the packet is transferred for usage is always said to be the same: Speed is sacrifice for
delivery [10]. TCP protocol suite feature automatic recovery reliability as UDP is connectionless and the server sending the
from any dropped or lost data. This protocol must be able data theoretically does not ensure if it reaches the destination
to recover from an outage of any host on any part of the or not.TCP is a connection-oriented protocol [15], which
network and at any point in a data transfer [10]. When means that the end-to-end communications is set up using
TCP packets are transmitted from one end to a remote end handshaking. Once the connection is set up, user data may be
across the network, the data packets are reordered in the same sent bi-directionally over the connection. Compared to TCP,
sequence it was generated by the sender. The protocol detects UDP is a simpler message based connectionless protocol [13],
when segments of the data stream have been discarded by the which means that the end-to-end connection is not dedicated
network, reordered, duplicated, or corrupted. The sender can and information is transmitted in one direction from the
even retransmit damaged segments. This process makes TCP a source to its destination without verifying the readiness or
reliable protocol. The retransmission problems, TCP meltdown state of the receiver. TCP controls message acknowledgment,
and double retransmit, are problems caused by tunneling TCP retransmission and timeout [11]. TCP makes multiple attempts
in TCP. The problems can occur when both of the stacked to deliver messages that get lost along the way, In TCP
connections are retransmitting packets [11]. In previous work, therefore, there is no missing data, and if ever there are
related to TCP in TCP tunneling, it is not entirely clear, how multiple timeouts, the connection is dropped. When a UDP
severe the retransmission problems really are. In this paper message is sent there is no guarantee that the message will
however the double retransmission will be explored in details. reach its destination; it could get lost along the way. There
is no acknowledgment, retransmission, or timeout. If two
IV. U SER DATAGRAM P ROTOCOL (UDP) messages are sent in sequence, the first message will reach
UDP (User Datagram Protocol) [12] is a communication the destination first. When data segments arrive in the wrong
protocol with a limited amount of service when messages order, TCP buffers delay data until all data can be re-ordered
are exchanged between computers in a network that uses the before being delivered; when using UDP the order in which
Internet Protocol (IP). UDP does not provide sequencing of messages arrive cannot be predicted.
data packets which means that the application program that The TCP protocol has extensive algorithms to ensure correct
uses UDP must make sure that the entire message has arrived delivery of the data. Having two TCP connections stacked
and is in the right order. UDP uses a simple connectionless together will thus force the algorithms of both TCP con-
transmission model with a minimum of protocol mechanism nections to work in parallel [16]. TCP was not designed to
which means that UDP do not establish a connection between work this way and problems are likely to occur in different
devices [13]. As soon as a device has data to send to another, it situations. The retransmission problems, TCP meltdown and
just sends it. It has no handshaking dialogues, and thus exposes double retransmit, are problems caused by tunneling TCP
any unreliability of the underlying network protocol to the in TCP. The problems can occur when both of the stacked
user’s program. There is no guarantee of delivery, ordering, connections are retransmitting packets. In previous work,
or duplicate protection. UDP provides checksums for data related to TCP in TCP tunneling, it is not entirely clear, how
integrity. severe the retransmission problems really are. TCP protocol
UDP is best suitable where error checking and correction suite featured automatic recovery from any dropped or lost
is not necessary, there is low processing overhead at the net- data. This protocol must be able to recover from an outage
work interface level [14]. Time-sensitive applications use UDP of any host on any part of the network and at any point in
because dropping packets is preferable compared to delayed a data transfer. When TCP packets are transmitted from one
packets, which may not be suitable in a real-time system. If end to a remote end across the network, the data packets are
error correction facilities are needed at the network interface reordered in the same sequence generated by the sender. The
protocol detects when segments of the data stream have been UDP tunnel based on OpenVPN. The open source VPN soft-
discarded by the network, reordered, duplicated, or corrupted. ware, OpenVPN has been the choice for many companies and
The sender can even retransmit damaged segments [11]. This according to technical discussions, VPN technologies using
process makes TCP a reliable protocol. However, the double UDP tunnel as base are predicted to provide fast speeds when
retransmission creates latency. compared to using OpenVPN using TCP as base. OpenVPN
The design of TCP was to make an efficient protocol with is usually slower than other protocols when used via TCP,
low overhead, a protocol suite that had a minimal amount of although TCP offers advantages in restricted networks. When
’extra’ data being transferred. This extra data called overhead, compared to stability, TCP is prognosticated to be a very
functions as packaging for the data being transferred and stable protocol on all kinds of connection (WLAN, wired,
enables the data transmission. TCP tunnel is a technology mobile) and UDP is deemed to be unstable, susceptible to
that aggregates and transfers packets sent between end hosts disconnect with short network issues. Compression is a built-
as a single TCP connection. By using a TCP tunnel, the in feature in OpenVPN and it has not been tested yet whether
fairness among aggregated flows can be improved and several compression has an impact on transfer time due to processing
protocols can be transparently transmitted through a firewall. power in CPU. In this experiment therefore, compression has
Currently, many applications such as Secure Shell (SSH), been disabled.
Virtual Tunnels (VTun), and Http Tunnel (HTun) use a TCP
tunnel. However, since most applications running on end hosts
generally use TCP, two TCP congestion controls (i.e. end-to-
end TCP and tunnel TCP) operate simultaneously and interfere
each other. Under certain conditions, using a TCP tunnel
severely degrades the end-to-end TCP performance. More
specifically it is known that using a TCP tunnel drastically
degrades the end-to-end TCP throughput for some time [17].
This is called TCP meltdown problem.
VI. E XPERIMENTAL TESTING
The experimental testing procedure consists of four parts
in the evaluation of latency. Two tunnels will be created,
TCP tunnel and UDP tunnel using OpenVPN as base. In the
TCP tunnel, TCP traffic will be sent and the latency will be
recorded in seconds. Then UDP traffic will be sent in the TCP The server is connected to the switch via an Ethernet
tunnel and the same value will be recorded. The same test cable and physical ip address of 10.1.24.19/24. The client is
will be performed but using UDP tunnel. All measurements connected to another port on the switch and has IP address
will take place at the server node because of its processing 10.1.100.21/24. The switch is connected to the router, which
power. The tests will be performed through a Local Area has the gateway IP address for the network. The server and
Network and Wide Area Network environment successively. the client are in two different subnets, therefore they cannot
The compression for OpenVPN will be disabled since it is communicate making use of their physical IP address. A VPN
not part of the tests. During the measurements, the size of will be setup between the client and the server, and two
packets will be increased and two different graphs will be computers will have a logical IP address on the same subnet
plotted with axes; latency of the VPN tunnel vs size of packets. and can then communicate with each other. The setup will
Iperf will be used for monitoring latency. Iperf, is the network be used for measuring latency in the LAN, but for measuring
testing tool that will be used to measure the parameters during traffic in the WAN; the router will be connected to the internet
the experiments. Since iperf can generate TCP and UDP data and have port-forwarding configured, and the client will be
streams, this make iperf suitable for this test. Iperf is also on a remote network with internet access. The client will
flexible and allows the user to set various parameters that therefore access the private network through port-forwarding
can be used in the test or alternatively optimize or tuning the and OpenVPN.
network. Iperf has a client and server functionality, and can
therefore measure the throughput between the two ends, either VIII. PERFORMANCE MEASURES
unidirectionally or bi-directionally. This section provides a comparative view of the conducted
results. Also, the authors attempt to provide a better
VII. E XPERIMENTAL FRAMEWORK DESCRIPTION explanation of the experiment results. But before that, the
In this paper, the authors took into consideration the physi- important characteristics of the LAN that may affect the
cal topology layout, setting up a complete topology by using performance of the connection must be discussed. The switch
two computers, switch and router. The setup is identical to a is configured on a 10Mbps duplex setting. The maximum file
real live scenario and is expected to give more accurate values size has therefore been limited to 10Mbps for this test. All
for the performance evaluation and analysis between TCP and network metrics for the tunnels are remarkably concentrated.
Standard deviation values rendered in both graphs confirm
this remark. Tunneling performance is measured using a set
of criteria or metrics. The latency is used to characterize
the performance of both tunnels. Latency is an expression
of how much time it takes for a packet of data to get from
one designated point to another. Latency through a tunnel is
dependent on the machine hardware, the link speed, and the
encapsulation time.

The snapshot below shows how the tests are performed on


iperf and how the values have being recorded.
C:\iperf-2.0.5-2-win32>iperf.exe -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 64.0 KByte (default)
------------------------------------------------------------
[ 4] local 172.16.1.1 port 5001 connected with 172.16.1.6 port 65410
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.1 sec 21.6 MBytes 17.9 Mbits/sec

Fig. 2. Latency comparison between UDP and TCP inside a UDP tunnel

Fig. 1. Latency comparison between UDP and TCP inside a TCP tunnel
Fig. 3. Latency comparison between UDP and TCP inside a TCP tunnel in
Figure 1 demonstrates the latency comparison between UDP WAN environment
and TCP inside a TCP tunnel in a LAN environment, measured
in seconds and packet size in megabyte. The UDP tunnel gives
increased transfer speed compared to TCP tunnel when the tunnel. The TCP stacking starts when the message size reaches
packet size increases. The latency gap in UDP tunnel becomes 2 MB, since the difference in latency before 2MB is very small
wider when the packet size increases from 4Mb to 10Mb. This when compared to the latency gap after 2MB. On the other
can be explained with the fact that when the VPN uses TCP hand, figure 2 shows the latency comparison between UDP
tunnel, TCP connections will use IP packets sent through the and TCP when using a UDP tunnel in a LAN environment.
VPN, therefore creating the TCP overhead twice. The UDP When using UDP tunnel, we do not have the double stacking
tunnel base VPN thus has the potential for slightly better problem. Compared to figure 1, the latency is smaller for
performance. TCP provides a bidirectional tunnel for data, both TCP and UDP traffic. It was said that encryption, slow
but relies on packets, so there will be some ”administrative” down UDP traffic since when bits of data is missing the
packets, e.g. acknowledges: this is the TCP overhead. For entire message may need to be re-sent again, causing latency.
instance, if the server A sends 10 MB to the client B, client During the tests, it is shown that, UDP message is not affected
B will also send some packets to A confirming reception. by encryption mechanism when the size is between 1MB to
When doing VPN over TCP, the VPN has its own TCP-based 10MB. Sending TCP traffic inside a TCP tunnel does not
overhead, and transports the administrative packets for any create the double TCP stacking problem, this is proved in
connection within the VPN. The graph therefore confirm the figure 2. When we compare the two graphs for example, the
TCP stacking problem when transmitting TCP traffic over TCP time taken to transmit a TCP message size of 2MB is twice
[2] P. Rawat, J. Bonnin, and L. Toutain, “Designing a tunneling header
compression (tucp) for tunneling over ip,” in Wireless Communication
Systems. 2008. ISWCS ’08. IEEE International Symposium on, pp. 273–
278, Oct 2008.
[3] R. Bush and T. Griffin, “Integrity for virtual private routed networks,” in
INFOCOM 2003. Twenty-Second Annual Joint Conference of the IEEE
Computer and Communications. IEEE Societies, vol. 2, pp. 1467–1476
vol.2, March 2003.
[4] Y. Li, W. Cui, D. Li, and R. Zhang, “Research based on osi model,”
in Communication Software and Networks (ICCSN), 2011 IEEE 3rd
International Conference on, pp. 554–557, May 2011.
[5] A. Mayer, B. Collini-Nocker, F. Vieira, J. Lei, and M. Castro, “Analytical
and experimental ip encapsulation efficiency comparison of gse, mpe,
and ule over dvb-s2,” in Satellite and Space Communications, 2007.
IWSSC ’07. International Workshop on, pp. 114–118, Sept 2007.
[6] M. Mimura and H. Tanaka, “Behavior shaver: An application based
layer 3 vpn that conceals traffic patterns using sctp,” in Broadband,
Wireless Computing, Communication and Applications (BWCCA), 2010
International Conference on, pp. 666–671, Nov 2010.
[7] D. Sarkar and H. Narayan, “Transport layer protocols for cognitive net-
works,” in INFOCOM IEEE Conference on Computer Communications
Workshops , 2010, pp. 1–6, March 2010.
[8] I.-S. Yoon, S.-H. Chung, and J.-S. Kim, “Implementation of lightweight
tcp/ip for small, wireless embedded systems,” in Advanced Information
Fig. 4. Latency comparison between UDP and TCP inside a UDP tunnel in Networking and Applications, 2009. AINA ’09. International Conference
WAN environment on, pp. 965–970, May 2009.
[9] N. Morita, I. Inoue, M. Mito, and T. Akaike, “Service specific connection
oriented protocol for the atm adaptation layer,” in Network Protocols,
when using TCP tunnel; the latency in TCP tunnel is around 1993. Proceedings., 1993 International Conference on, pp. 128–135, Oct
1993.
10 seconds whereas in UDP tunnel, the latency is around 5 [10] Y.-T. Li, D. Leith, and R. Shorten, “Experimental evaluation of tcp pro-
seconds. Figure 3 is a replication of the test perform in figure tocols for high-speed networks,” Networking, IEEE/ACM Transactions
1, that is, latency comparison between UDP and TCP inside a on, vol. 15, pp. 1109–1122, Oct 2007.
[11] M.-Y. Park and S.-H. Chung, “Distinguishing the cause of tcp retrans-
TCP tunnel in a WAN environment. The latency gap increases mission timeouts in multi-hop wireless networks,” in High Performance
proportionally when the message size increases. The pattern is Computing and Communications (HPCC), 2010 12th IEEE International
similar to figure 1, except that the latency is higher. The test Conference on, pp. 329–336, Sept 2010.
[12] T. Le, G. Kuthethoor, C. Hansupichon, P. Sesha, J. Strohm, G. Hadynski,
in figure 4 has been performed in a WAN environment, that D. Kiwior, and D. Parker, “Reliable user datagram protocol for airborne
is latency comparison between UDP and TCP inside a UDP network,” in Military Communications Conference, 2009. MILCOM
tunnel in a WAN environment. In a WAN environment, the 2009. IEEE, pp. 1–6, Oct 2009.
[13] E. Bethel and J. Shalf, “Grid-distributed visualizations using connec-
latency graphs for both TCP and UDP are two straight lines tionless protocols,” Computer Graphics and Applications, IEEE, vol. 23,
and the difference in latency is constant. pp. 51–59, Mar 2003.
[14] S. Jung, S. Hong, and K. Kim, “On achieving high performance
wireless mesh networks with data fusion,” in World of Wireless, Mobile
IX. C ONCLUSION and Multimedia Networks, 2007. WoWMoM 2007. IEEE International
Symposium on a, pp. 1–8, June 2007.
This paper addresses performance comparison between TCP [15] Y.-L. Chang and C.-C. Hsu, “Connection-oriented routing in ad hoc
and UDP tunnel connections. Two distinct scenarios were networks based on dynamic group infrastructure,” in Computers and
Communications, 2000. Proceedings. ISCC 2000. Fifth IEEE Symposium
used to test the two VPN tunneling mechanisms. The results on, pp. 587–592, 2000.
disclose that UDP tunnel utilizes the link better and thus [16] D. Lu, Y. Qiao, P. Dinda, and F. Bustamante, “Modeling and taming
provides radically improved transfer times and speed when parallel tcp on the wide area network,” in Parallel and Distributed
Processing Symposium, 2005. Proceedings. 19th IEEE International,
compared with TCP tunnel. The results also demonstrates that pp. 68b–68b, April 2005.
indeed TCP in UDP tunnel provides better latency. [17] K.-C. Leung, V. Li, and D. Yang, “An overview of packet reorder-
As future work it would be good to expand this study by ing in transmission control protocol (tcp): Problems, solutions, and
challenges,” Parallel and Distributed Systems, IEEE Transactions on,
investigating the performance of the tunnels on Mobile net- vol. 18, pp. 522–535, April 2007.
work. OpenVPN can be installed on mobile devices, therefore
another direction is to test the VPN on mobile device, and
detect how much energy is required for this sort of secure
connections, as mobile devices cannot afford batteries with
unlimited capacity.

R EFERENCES
[1] S. Zhou and J. Luo, “A novel ip over udp tunneling based firewall traver-
sal for peer-to-peer networks,” in Service Operations and Logistics, and
Informatics (SOLI), 2013 IEEE International Conference on, pp. 382–
386, July 2013.

View publication stats

Вам также может понравиться