{"id":20105,"date":"2022-03-28T16:23:00","date_gmt":"2022-03-28T14:23:00","guid":{"rendered":"http:\/\/www.firewallhardware.it\/openvpn-e-pfsense-opnsense-ottimizzazione-della-crittografia-e-compressione-del-traffico-per-ottimizzare-hardware-e-migliorare-la-sicurezza\/"},"modified":"2022-03-28T16:24:32","modified_gmt":"2022-03-28T14:24:32","slug":"encryption","status":"publish","type":"post","link":"https:\/\/blog.miniserver.it\/en\/pfsense\/encryption\/","title":{"rendered":"OpenVPN: Encryption and traffic compression (optimize hardware and improve security)"},"content":{"rendered":"\n<p>In this guide we will make considerations on the configuration and optimizations of the <strong>OpenVPN<\/strong> service, based on the tests we have performed on <strong>hardware devices.<\/strong><\/p>\n\n\n\n<p>In particular on the encryption and traffic compression settings, 2 essential parameters for the optimization of this tool.<br>For the drafting of the guide we will refer to the OS <strong><a href=\"https:\/\/blog.miniserver.it\/en\/pfsense\/\" target=\"_blank\" rel=\"noreferrer noopener\">pfSense<\/a>\u00ae<\/strong> and <strong>OPNsense\u00ae,<\/strong> however the same speech can be extended to all <strong>OpenVPN<\/strong> implementations.<\/p>\n\n\n\n<p>These considerations can help us understand how the protocols used by OpenVPN, used to encrypt and compress traffic, can affect the traffic capacity of the system used and therefore how to size our equipment. In the conclusions, we will make some considerations on the security of the traffic encryption protocol in relation to the performances.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Hardware and software environment used<\/h3>\n\n\n\n<p>We carried out the tests in the laboratory with two different hardware devices and with the <strong>pfSense <\/strong>system.<br>The hardware selected for the tests are:<\/p>\n\n\n\n<p><strong>Firewall Entry Level:<\/strong><br>Firewall <a title=\"APU 3 NIC\" href=\"https:\/\/www.miniserver.it\/firewall\/corporate\/compact-small-utm-3\" target=\"_blank\" rel=\"noopener noreferrer\">APU 3 NIC<\/a><\/p>\n\n\n\n<p><strong>Firewall Datacenter tested:<\/strong><br>Firewall <a title=\"A1 Server\" href=\"https:\/\/www.miniserver.it\/firewall\/datacenter\/appliance-a1-server-aluminum\" target=\"_blank\" rel=\"noopener noreferrer\">A1 Server<\/a><\/p>\n\n\n\n<p>All hardware tested and produced by us have strictly Intel NIC chipsets.<br>The software used on the appliance is <strong>pfSense\u00ae version 2.4.X<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Introduction<\/h3>\n\n\n\n<p>Since the actual traffic capacity depends on multiple factors, in our tests we evaluate the theoretical capabilities of the devices, so that we can understand if and when the <strong>device<\/strong> can be a bottleneck when using a <strong>VPN<\/strong>.<\/p>\n\n\n\n<p>The tests were carried out on two different <strong>hardware appliances<\/strong>, with <strong>different computing power<\/strong> (different CPU), while RAM and network cards are not very different, however, having Intel <strong>NIC chipsets<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Preliminary considerations on VPN protocols and specifications:<\/h3>\n\n\n\n<p>The <strong>TCP protocol<\/strong> is a handshake protocol (3-way); this system makes it a &#8220;reliable&#8221; protocol. This means that if a stable connection exists between two hosts, the TCP protocol ensures that all packets will arrive at their destination.<br>In particular, the client sends a packet with a unique identifier and with a syn request, the server replies with a syn-ack packet, then the client sends an ack packet. If the communication is not closed, the packet is sent again until success or after a time out and all communication is interrupted and defined closed.<\/p>\n\n\n\n<p>Conversely, the UDP protocol is a connection less protocol, that is, there are no requests for verification or reordering of packets. This makes it less reliable since some packets may be lost and will not be retransmitted, however this mechanism also makes it much faster.<br>For the implementation of VPNs it is better to use the UDP protocol as it is faster. We don&#8217;t have to worry about reliability as the VPN encapsulates the protocols that travel in the tunnel, and if, for example, the encapsulated protocol is TCP, he will worry about getting all the packets coming. To implement a VPN you can use the TCP protocol, but normally it is used due to restrictions or blockages that prevent the use of UDP.<\/p>\n\n\n\n<p>When implementing a VPN some operations are carried out, the first consists in establishing a tunnel, subsequently the data can be encrypted and \/ or compressed<br>In particular, the client sends a packet with a unique identifier and with a syn request, the server replies with a syn-ack packet, then the client sends an ack packet. If the communication is not closed, the packet is sent again until success or after a time out and all communication is interrupted and defined closed.<\/p>\n\n\n\n<p>Conversely, the UDP protocol is a connection less protocol, that is, there are no requests for verification or reordering of packets. This makes it less reliable since some packets may be lost and will not be retransmitted, however this mechanism also makes it much faster.<br>For the implementation of VPNs it is better to use the UDP protocol as it is faster. We don&#8217;t have to worry about reliability as the VPN encapsulates the protocols that travel in the tunnel, and if, for example, the encapsulated protocol is TCP, he will worry about getting all the packets coming. To implement a VPN you can use the TCP protocol, but normally it is used due to restrictions or blockages that prevent the use of UDP.<\/p>\n\n\n\n<p>When implementing a VPN some operations are carried out, the first consists in establishing a tunnel, subsequently the data can be encrypted and \/ or compressed.<\/p>\n\n\n\n<p>We talked about it in depth in this guide: <a title=\"differences and insights on the security of IPsec and OpenVPN\" href=\"https:\/\/blog.miniserver.it\/en\/pfsense-and-vpn-differences-and-insights-on-ipsec-and-openvpn-security\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/blog.miniserver.it\/en\/pfsense-and-vpn-differences-and-insights-on-ipsec-and-openvpn-security\/<\/a><\/p>\n\n\n\n<p>The creation of a tunnel is not part of this guide, we will only say that it is the fundamental part for making the VPN work, allowing direct communication between the two remote networks, even private ones.<br><strong>Encryption is optional<\/strong>, but strongly recommended, and in fact protects our data as they pass through the VPN tunnel, through the use of keys.<br><strong>Compression is optional<\/strong> and takes care of optimizing the communication speed by compressing the data passing through the tunnel.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Introduction to made tests<\/h3>\n\n\n\n<p>Having mainly to verify the impact of the <strong>VPN system on the performance of hardware<\/strong> and network traffic, the parameter that interests us mainly at this moment is the <strong>Encryption Algorithm<\/strong> and in part compression. The other parameters are of less interest.<\/p>\n\n\n\n<p>The parameters covered by this guide can be set on <strong>PFSenese and OPNSense<\/strong> through a graphical interface. In particular:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Parameters for data <strong>encryption with PFSense<\/strong>:<br>From VPN\u2192OpenVPN\u2192Server (<strong>it is assumed that at least one OpenVpn server has already been created<\/strong>), eedit the desired OpenVpn server, in the Cryptographics setting section, select the data cryptographic parameter from the drop-down menu Encryption algorithms and\/or NCP Algoritm ( negotiation system by the cryttography algorithm).<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"634\" height=\"800\" src=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-1.jpg\" alt=\"Openvpn Compression And Encryption R3\" class=\"wp-image-20062\" srcset=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-1-238x300.jpg 238w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-1.jpg 634w\" sizes=\"(max-width: 634px) 100vw, 634px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Parameters for data compression with pfSense:<br>On the same page where we configured the encryption, under tunnel settings, select the desired compression from the &#8220;compression&#8221; menu.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"610\" height=\"600\" src=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-2.jpg\" alt=\"Openvpn Compression And Encryption R3\" class=\"wp-image-20064\" srcset=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-2-36x36.jpg 36w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-2-71x71.jpg 71w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-2-300x295.jpg 300w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-2.jpg 610w\" sizes=\"(max-width: 610px) 100vw, 610px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Parameters for data compression with OPNSense:<br>From <strong>VPN<\/strong>\u2192<strong>OpenVpn<\/strong>\u2192<strong>Server<\/strong> (assuming an OpenVpn server has already been created), edit the desired <strong>OpenVpn server<\/strong>.<br>Look for the &#8220;Compression&#8221; drop-down menu, select the desired compression. For the possible choices, from the figure below see information notes.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"800\" height=\"170\" src=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-3.jpg\" alt=\"Openvpn Compression And Encryption R3\" class=\"wp-image-20066\" srcset=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-3-300x64.jpg 300w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-3-768x163.jpg 768w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-3.jpg 800w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Parameters for data cryptography with OPNSense:<br>Also from this web page Use the &#8220;Encryption Algoritm&#8221; menu to select the type of encryption to be used for the data<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"800\" height=\"680\" src=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-4.jpg\" alt=\"Openvpn Compression And Encryption R3\" class=\"wp-image-20068\" srcset=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-4-300x255.jpg 300w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-4-768x653.jpg 768w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenvpnCompressionAndEncryptionR3-4.jpg 800w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Made tests:<\/h3>\n\n\n\n<p>The tests were carried out using and processing the results through the use of a pfSense shell and with the commands:<\/p>\n\n\n\n<p>[&#8220;openssl speed&#8221;] and [&#8220;OpenVPN&#8221;+&#8221;time&#8221;]<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>openssl speed md5 sha1 \u2026.<br>openssl is the system (library) used by OPENVPN for the implementation of the VPNs, the command actually tests the execution speed of the command for data compression and decompression. The result is the maximum speed that the openssl library can have for data cryptography.<br>Literally: This command is used to test the performance of cryptographic algorithms<\/li><li># OpenVPN &#8211;genkey &#8211;secret \/tmp\/secret<br># time OpenVPN &#8211;test-crypto &#8211;secret \/tmp\/secret &#8211;verb 0 &#8211;tun-mtu 20000 &#8211;cipher aes-256-cbc<br>OpenVPN, used with time, performs a speed test directly with OpenVPN&#8217;s compression and decompression tools through a static key generated with OpenVPN itself; therefore time generates a result that obeys the following formula(3200 \/ tempoDiEecreationInSeconds) = Maximum projection of OpenVPN performance in Mbps<\/li><\/ol>\n\n\n\n<p><strong>Note:<\/strong> We also carried out tests by changing the &#8220;Cryptographic Hardware&#8221; parameter<br>On PPSense you can find it in: System \u2192 Advanced \u2192 Miscellaneous<br>However, changing this parameter did not make any significant difference.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Hardware test: A1Server<\/h3>\n\n\n\n<p>Now let&#8217;s move on to the actual test and data analysis.<\/p>\n\n\n\n<p>Intel(R) Atom(TM) CPU C2758 @ 2.40GHz<\/p>\n\n\n\n<p>8 CPUs: 1 package(s) x 8 core(s)<br>AES-NI CPU Crypto: Yes (inactive)<\/p>\n\n\n\n<p><strong>Theoretical results using the following commands<\/strong><br># OpenVPN &#8212; genkey &#8212; secret \/tmp\/secret<br># time OpenVPN &#8212; test-crypto &#8212; secret\/tmp\/secret &#8212; verb 0 &#8212; tun-mtu 20000 &#8212; cipher aes-256-cbc<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th scope=\"col\">Theoretical Mbps<\/th><th scope=\"col\">Algorithm used<\/th><\/tr><\/thead><tbody><tr><td>146,838022674072<br>140,765373449459<br>139,752030035798<br>138,90789131001<br>103,908045977011<br>91,1830408023706<br>69,338071197972<br>69,2795289227572<br>103,177714727882<br>116,2342002034<br>91,1596638655462<br>116,47534121929<br>91,1077580071174<\/td><td>no encryption<br>aes-128-cbc<br>AES-192-CBC<br>Aes-256-cbc<br>DES-CBC<br>RC2-CBC<br>DES-EDE-CBC<br>DES-EDE3-CBC<br>DESX-CBC<br>BF-CBC<br>RC2-40-CBC<br>CAST5-CBC<br>RC2-64-CBC<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Results obtained with the following command<\/strong><br>#openssl speed md5 sha1 sha256 sha512 des des-ede3 aes-128-cbc aes-192-cbc aes-256-cbc rsa2048<br>dsa2048<br>The &#8216;numbers&#8217; are in 1000s of bytes per second processed.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th scope=\"col\">type<\/th><th scope=\"col\">16 bytes<\/th><th scope=\"col\">64 bytes<\/th><th scope=\"col\">256 bytes<\/th><th scope=\"col\">1024 bytes<\/th><th scope=\"col\">8192 bytes<\/th><\/tr><\/thead><tbody><tr><td>md5<br>sha1<br>des cbc<br>des ede3<br>aes-128 cbc<br>aes-192 cbc<br>aes-256 cbc<br>sha256<br>sha512<\/td><td>21190.45k<br>21710.91k<br>41221.46k<br>15988.63k<br>38312.81k<br>32731.46k<br>28285.92k<br>21627.88k<br>13847.41k<\/td><td>70594.55k<br>65473.75k<br>44227.26k<br>16365.97k<br>43219.39k<br>36044.84k<br>30700.84k<br>49864.17k<br>55176.02k<\/td><td>182172.84k<br>148563.20k<br>45445.11k<br>16509.70k<br>44714.80k<br>37102.34k<br>31754.84k<br>87007.91k<br>85171.11k<\/td><td>300125.18k<br>217115.81k<br>45549.91k<br>16545.79k<br>119669.42k<br>102306.47k<br>88846.97k<br>107239.77k<br>119439.36k<\/td><td>369085.06k<br>250563.24k<br>45544.79k<br>16599.26k<br>122071.72k<br>103322.97k<br>89260.03k<br>115149.48k<br>135876.83k<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>sign verify sign\/s verify\/s<br>rsa 2048 bits 0.005019s 0.000179s 199.3 5580.9<\/p>\n\n\n\n<p>sign verify sign\/s verify\/s<br>dsa 2048 bits 0.001918s 0.001778s 521.3 562.3<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Test performed with HardWare MINISERVER: AMD GX-412TC SOC<\/h3>\n\n\n\n<p>4 CPUs: 1 package(s) x 4 core(s)<br>AES-NI CPU Crypto: Yes (inactive)<\/p>\n\n\n\n<p><strong>Theoretical results using the following commands<\/strong><br># OpenVPN &#8212; genkey &#8212; secret \/tmp\/secret<br># time OpenVPN &#8212; test-crypto &#8212; secret \/tmp\/secret &#8212; verb 0 &#8212; tun-mtu 20000 &#8212; cipher aes-256-cbc<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th scope=\"col\">Theoretical Mbps<\/th><th scope=\"col\">Algorithm used<\/th><\/tr><\/thead><tbody><tr><td>43,4804334247617<br>43,4804334247617<br>43,2800972841508<br>43,474532577135<br>32,3910582908885<\/td><td>none<br>aes-128-cbc<br>AES-192-CBC<br>Aes-256-cbc<br>DESX-CBC<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Results obtained with the following command<\/strong><br># openssl speed md5 sha1 sha256 sha512 des des-ede3 aes-128-cbc aes-192-cbc aes-256-cbc rsa2048 dsa2048<br>The &#8216;numbers&#8217; are in 1000s of bytes per second processed.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th scope=\"col\">type<\/th><th scope=\"col\">16 bytes<\/th><th scope=\"col\">64 bytes<\/th><th scope=\"col\">256 bytes<\/th><th scope=\"col\">1024 bytes<\/th><th scope=\"col\">8192 bytes<\/th><\/tr><\/thead><tbody><tr><td>md5<br>sha1<br>des cbc<br>des ede3<br>aes-128 cbc<br>aes-192 cbc<br>aes-256 cbc<br>sha256<br>sha512<\/td><td>6091.10k<br>6273.40k<br>14113.51k<br>5392.94k<br>15351.43k<br>12678.31k<br>11186.83k<br>7626.93k<br>5065.17k<\/td><td>20796.97k<br>20775.26k<br>14949.49k<br>5503.06k<br>16479.76k<br>13439.26k<br>11697.27k<br>18208.54k<br>20386.18k<\/td><td>55149.83k<br>49754.39k<br>15007.49k<br>5499.17k<br>16752.60k<br>13956.93k<br>11974.06k<br>31935.64k<br>32140.75k<\/td><td>102651.56k<br>75995.34k<br>15168.85k<br>5542.91k<br>42753.73k<br>36587.81k<br>31814.29k<br>39095.85k<br>46066.56k<\/td><td>135633.57k<br>90409.66k<br>15192.41k<br>5480.00k<br>43496.29k<br>36842.15k<br>31850.50k<br>41115.50k<br>51883.22k<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>sign verify sign\/s verify\/s<br>rsa 2048 bits 0.010064s 0.000284s 99.4 3517.3<\/p>\n\n\n\n<p>sign verify sign\/s verify\/s<br>dsa 2048 bits 0.003835s 0.003517s 260.8 284.3<\/p>\n\n\n\n<p>Looking at the result of the tests carried out, the large speed difference in Mbs is immediately noticeable, which can be seen from the two tests depending on the CPU used.<br>i.e. con openssl e algoritmo di crittografia aes-128<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>First test: 140Mbps aes-128-cbc<\/li><li>Second test: 43Mbps aes-128-cbc<\/li><\/ul>\n\n\n\n<p>Even the use of algorithms other than quite different results, however less evident.<br>i.e From the first test, the result of the encryption algorithm between aes-256 and DES-EDE<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>138Mbps Aes-256-cbc<\/li><li>69Mbps DES-EDE-CBC<\/li><\/ul>\n\n\n\n<p>Unlike what we would have expected, using the same algorithm but increasing the number of encryption bits, the differences are not very large.<br>i.e From the first test, the result of the 128, 192 and 256 bit encryption algorithm<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>140Mbps aes-128-cbc<\/li><li>139Mbs AES-192-CBC<\/li><li>138Mbps Aes-256-cbc<\/li><\/ul>\n\n\n\n<p>Another result to keep in mind, are the differences that increase with increasing CPU power, even if at a percentage level they are similar, obviously the amount of Mbps changes. This can be uninteresting from a theoretical point of view, it changes instead from a practical point of view. Below an example<br>First test:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>138Mbps Aes-256-cbc<\/li><li>103Mbps DESX-CBC<\/li><li>difference around 30%<\/li><li>difference around 25 Mbps<\/li><\/ul>\n\n\n\n<p>Second Test:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>43Mbps Aes-256-cbc<\/li><li>32Mbps DESX-CBC<\/li><li>difference around 30%<\/li><li>difference around Mbps<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusions and considerations.<\/h3>\n\n\n\n<p>First consideration: the encryption protocol does not exclude the overhead due to the encapsulation of the VPN, since in order to make the VPN work you must first create a tunnel that involves operations of modification and addition of data to the TCP \/ IP packets ( with obvious use of computing power and addition of information in TCP \/ IP packets) <\/p>\n\n\n\n<p>The overhead can change depending on the configuration and the software used (OpenVPN, IPSEC, L2TP, &#8230;), a parameter that can affect performance, but in a way much less than encryption. <\/p>\n\n\n\n<p>So not using encryption does not correspond to obtaining the maximum network, but it could be little influential.<\/p>\n\n\n\n<p>Second consideration: the greater security of a protocol does not mean lower execution speed, therefore the choice to use AES (more secure) than DES (less secure) is certainly better.<\/p>\n\n\n\n<p>Third consideration: unless very critical situations, the advantage (in terms of speed) of using fewer bits with the same algorithm, for example the choice between AES-128 and AES-256 (algorithm: AES number of bits: 128 or 256), it may not justify the least security that would be obtained. Therefore, in this case, it is normally convenient to use AES-256<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">VPN \/ OpenVPN Protocol Considerations &#8211; TCP\/UDP Compression<\/h3>\n\n\n\n<p>The standard protocol of OpenVPN and of vpn in general is UDP, the reason is that it is not necessary to load \/ weight the VPN of a protocol with a handshake system such as TCP, in fact it will be the applications that will use the VPN to choose the most suitable protocol. is suitable for their purpose.<\/p>\n\n\n\n<p>TCP over vpn is chosen if there are no alternatives due to security protocols or the obligation to use some services for access to the external network, such as proxies.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Considerations for the VPN traffic compression system.<\/h3>\n\n\n\n<p>Also in this case it is necessary to consider the fact that by now most of the traffic is already compressed, in any case the compression default for OpenVPN is lzo, which has a very high compression level, but greatly engages the system resources, moreover not it is very optimized in case of already compressed protocols. <\/p>\n\n\n\n<p>For this reason, compression systems such as lz4 and lz4-v2 (specifically designed for <a href=\"https:\/\/openvpn.net\" target=\"_blank\" rel=\"noreferrer noopener\">OpenVPN<\/a>) were born.<\/p>\n\n\n\n<p>Therefore if your system has the resources already very busy, choose the compression level appropriately (for example avoid lzo), or consider the option to disable it.<\/p>\n\n\n\n<p>In addition, the compression protocol could create compatibility problems especially in P2P VPNs, therefore in case of VPN malfunctions it is recommended to disable compression first.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide we will make considerations on the configuration and optimizations of the OpenVPN service, based on the tests we have performed on hardware devices.<\/p>\n","protected":false},"author":11,"featured_media":24548,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[124],"tags":[270,138],"class_list":["post-20105","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pfsense","tag-openvpn-e-pfsense-en","tag-pfsense-en"],"_links":{"self":[{"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/posts\/20105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/comments?post=20105"}],"version-history":[{"count":5,"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/posts\/20105\/revisions"}],"predecessor-version":[{"id":24552,"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/posts\/20105\/revisions\/24552"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/media\/24548"}],"wp:attachment":[{"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/media?parent=20105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/categories?post=20105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/tags?post=20105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}