How it works: looking inside the unique AdGuard VPN protocol

For years, we were concentrating on developing all flavors of ad blocking apps and browser extensions. And two years ago we resolved to develop our own VPN service, seemingly out of nowhere. When in reality, there were a few reasons that prompted us to do so.

  • AdGuard mobile apps had compatibility issues with VPN apps. That's why we saw the development of an in-house VPN as the only feasible solution that could guarantee compatibility: after we apply some magic, the two apps are able to work together as one VPN service.
  • Secondly, VPN seemed more than relevant to our philosophy and priorities.
  • Finally, during years of developing AdGuard software, we have become experts in filtering network traffic. This was to allow us to bring in something new instead of becoming another wishy-washy VPN.

From the outset, we decided that AdGuard VPN would have one key difference from its competitors — we shall develop and deploy an in-house VPN protocol instead of picking one of the ready-made solutions.

Why go to all that trouble, you could ask. In this article, we'll tell you why we weren't satisfied with existing protocols and created our own, and share our roadmap.

Spoiler: AdGuard VPN protocol is harder to detect and it's quicker than its analogs.

But first we'll need to dig deep into some technical aspects and figure out:

How Internet works

Have no fear: we won't dare to explain the whole Internet here, but we will cover the fundmamentals of how it works. Now, all communication on the Internet is based on transmission of small data "packets" from a computer to a server and back. There are several different types of packets, each serving its purpose. Rules of packet encapsulation and processing are called a protocol.

IP protocol

I'm sure you've heard about the IP address, haven't you? So, IP address is a part of IP protocol — the principal mechanism of the network data transmission. Each packet consists of three parts: data itself, IP addresses of the sender and recipient.

The receiver knows who has sent the packet, and therefore can send some data back. However, the "pure" IP protocol is virtually unused, but two other protocols based on it are used everywhere — TCP and UDP.

TCP protocol

TCP is the main "work horse" of the Internet. When you open a website, it is very likely that TCP is used for data transmission.

A TCP packet consists of four parts:

  • IP packet header, including source and destination addresses.
  • Port numbers of the sender and recipient. This number is needed for the operating system to understand which program to send the packet to for processing.
  • Packet sequence number. Packets may not arrive to the recipient in the order they were sent. Sequence numbers allow the correct sequence to be restored.
  • Packet type. This property is needed to implement "guaranteed delivery," which is discussed below.

Whichever network you use, there's a chance that some sent packets might get lost on their way. TCP protocol ensures that they succeed in reaching the destination: in response to each packet sent, the receiver sends a small TCP packet confirming receipt. If the sender does not obtain confirmation, it will resend the packet until the confirmation is finally received.

UDP protocol

UDP is another known, though less popular, IP-based protocol. Compared to the IP protocol, the only difference is that except for data itself and addresses of the sender and the recipient, it transmits information about port numbers (see the description of port numbers in TCP section) distinguish UDP from IP. As you can see from the animation, data packet flow moves faster than in case of TCP — and no wonder, there is no delivery confirmation in UDP. Unlike TCP, UDP doesn't guarantee anything. But it also does not send extra packets of confirmation, which makes it faster.

How VPN protocols work

When you send a letter or email to someone, you can do without the contents, the header, the signature, but not without the recipient's address. The Internet works the same way — you need an IP address to send data.

When you visit a website, your IP address is visible to it, and knowing the IP address, it's not that difficult to figure out the user's location. A VPN allows your data to be routed through an encrypted connection from your home/workplace or smartphone to another point on the Internet, perhaps in another country, and then onto the public Internet. Like a sneaky rabbit diving into a hole that leads to the exit to the looking glass.

As a result of encryption, your data is assigned an IP address from the other end of the tunnel instead of your home or work address. Now, when you connect to a web server, what it sees is not your home IP address, but someone else's, belonging to the VPN endpoint. Thus, if you go to a website, your data won't be disclosed.

Probably, you already knew that, but a recap wouldn't hurt, right? Now let's actually dig into the technical details. For a VPN to function, it needs to transmit and encrypt data from your device to the VPN server and back. The rules for transmitting and encrypting this data are called a VPN protocol. The most common VPN protocols are OpenVPN, WireGuard and IPSec. They all work roughly the same, and functionally they are very similar, but the devil is in the details (of encryption and connection establishment).

Let's look at how they work. Say you want to visit a website. If you have a VPN enabled, the VPN server mediates between you and the website. Initially, an encrypted IP packet is sent to the server. The VPN server decrypts it, changes the "sender address" (i.e. your IP) and sends the packet to the recipient (i.e. the website). This is usually performed using UDP as a transport as it is generally "faster" since it does not require waiting for confirmation.

Limitations of existing VPN protocols

All popular VPN protocols (OpenVPN, WireGuard, IPSec etc.) are united by two shortcomings:

  • They can be easily detected and blocked on the network level.
  • If you try to "hide" them, the performance will drop.

To "conceal" the use of VPN, the data flow is often "wrapped" in a TCP connection, and sometimes it is additionally encrypted to make the traffic look like a normal website connection. Unfortunately, this approach has a disadvantage – due to the use of TCP, there is a need for additional confirmation of delivery.

So, using any popular VPN protocol, we are always facing a trade-off: fast but easy to detect vs. slow.

What's great about AdGuard VPN protocol

We developed the AdGuard VPN protocol seeing the disadvantages of previous protocols and not willing to deal with them. So what are its strengths?

  • It's nearly impossible to distinguish from normal HTTPS traffic, that is, the connection to the AdGuard VPN server looks exactly the same as the connection to a normal website.
  • For encryption we use HTTPS (TLS), which copes with this task perfectly. It is the most popular encryption method in the world, and the libraries that implement it are constantly audited for security.

Some existing VPN protocols also handle the encryption task, and they (and thus, the fact of using a VPN) are hard to detect. But this usually comes at the price of reduced speed. This is not our case, thanks to several solutions.

  • We use the HTTP/2 transport protocol, which makes it virtually impossible to detect AdGuard VPN protocol while maintaining high speed.
  • Unlike others, AdGuard VPN protocol operates with data and not with packets. This means that AdGuard VPN establishes a separate "tunnel" for each connection, each HTTP/2 stream corresponds to one connection. AdGuard VPN transfers data through this tunnel. This allows us to speed up the operation by saving on confirmation packets, because we can buffer the data of several packets into one before sending it to the VPN server (or from the server to the client). And the fewer packets, the fewer confirmations are needed.

Plans for the future

Switching to HTTP/3 and QUIC

The first thing we intend to do is switch to using the HTTP/3 and QUIC protocols to communicate with the server. HTTP/3 is the latest, most advanced version of HTTP. Unfortunately, the new protocols won't affect speed when the connection is fine and stable, but their benefits will show up when the connection is worse – for example, on mobile devices or when connecting to public Wi-Fi. There are several obvious advantages of the new protocols – they won't cause packet retransmissions and Head of Line Blocking (or HoLB) queues, and they will also allow connection migration. Without being too technical, the main advantage is the already mentioned improvement of connection quality in non-ideal conditions.

TCP and other protocols working over it (TLS, SSL, HTTP /1.1 and HTTP/2) have been around for a while and are great at what they do, but there's just one thing: they need near-perfect conditions to work smoothly. This means that they perform well on a network with a stable and high-quality connection (say, a home Wi-Fi network). But stepping out into the outside world with its mobile networks, you can't safeguard against weak signals, slow connections, and other woes that cause packet loss. These losses lead to the above-mentioned retransmissions and HoLB. Even 5G is not almighty, and the connection will be worse in elevators and long subway sections between stations. With VPN over HTTP/3 the problem is magically solved: the VPN connection won't get broken, even if you go into an elevator, or the network changes for some other reason.

We are currently testing a prototype of this new implementation. Expect it to be ready in a couple of months.

Оpen source

If you've been familiar with AdGuard for a long time, you already know how many of our products are open-source. The concept of open-source software is close to us because we believe that such projects help people and contribute to the development of technology. But our approach is privacy-friendly, so we make products open-source only where possible.

We are going to make our protocol implementation publicly available in the future. Sadly, right now we don't have enough time to prepare the project, because it is a lot of work. But we hope that by the end of this year we can find enough time and publish the code of both the server and client implementations.

Our protocol is used by all AdGuard VPN mobile and desktop applications. Download any of our products (or several ones!) now and use it knowing that your data is protected in the most secure way. And if you wish to, share your impressions with us — in the comments section of the blog post or on social networks.

Gostou desta postagem?
AdGuard VPN AdGuard DNS AdGuard Mail AdGuard Wallet
AdGuard VPN AdGuard DNS AdGuard Mail AdGuard Wallet
O ecrã principal do AdGuard para Windows
O ecrã de proteção do AdGuard para Windows, que mostra as funcionalidades e definições de proteção
O ecrã Estatísticas do AdGuard para Windows, que mostra as estatísticas dos anúncios bloqueados e dos rastreadores
A tela de gerenciamento de aplicativos do AdGuard para Windows, mostrando as opções de gerenciamento de proteção para aplicativos instalados no dispositivo
21 483 21483 comentários de utilizador
Excelente!

AdGuard para Windows: bloqueador de anúncios para PC

O AdGuard para Windows é mais do que um bloqueador de anúncios. É uma ferramenta multifuncional que bloqueia anúncios, controla o acesso a sites perigosos, acelera o carregamento de páginas e protege as crianças de conteúdo inadequado
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
Microsoft Store
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
AdGuard para Windows v8.0, 14 dias período de teste
A tela principal do AdGuard para Mac
O ecrã do Modo Invisível do AdGuard para Mac
21 483 21483 comentários de utilizador
Excelente!

AdGuard para Mac: bloqueador de anúncios em todo o sistema

O AdGuard para Mac é um bloqueador de anúncios único, desenvolvido pensando no macOS. Além de protegê-lo contra anúncios irritantes em navegadores e aplicativos, ele o protege contra rastreamento, phishing e fraudes
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
Ler mais
AdGuard para Mac v2.19, 14 dias período de teste
A tela principal do AdGuard para Android
O ecrã de proteção contra rastreio do AdGuard para Android
A tela de gerenciamento de aplicativos do AdGuard para Android, mostrando as opções de gerenciamento de proteção para aplicativos instalados no dispositivo
A tela de Estatísticas do AdGuard para Android, mostrando estatísticas de anúncios e rastreadores bloqueados
A tela principal do navegador privado do AdGuard para Android
O código QR para baixar o AdGuard para Android
21 483 21483 comentários de utilizador
Excelente!

AdGuard para Android: ad blocker para todas as apps

Bloqueia anúncios e rastreadores em todos os navegadores, jogos e outras aplicações. Protege a sua privacidade e permite-lhe controlar a forma como as suas aplicações utilizam a Internet. Instalado através de APK
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
Ler mais
Scan para descarregar
Utilize qualquer leitor de código QR disponível no seu dispositivo
AdGuard para Android v4.14, 14 dias período de teste
A tela principal do AdGuard para iOS
O ecrã de proteção do AdGuard para iOS, que mostra as funcionalidades e definições de proteção
O ecrã Estatísticas do AdGuard para iOS, que mostra as estatísticas dos anúncios bloqueados e dos rastreadores
O código QR para descarregar o AdGuard para iOS
21 483 21483 comentários de utilizador
Excelente!

AdGuard para iOS: ad blocker além do Safari

O melhor bloqueador de anúncios para iOS, para iPhone e iPad. O AdGuard elimina todos os tipos de anúncios e rastreadores no Safari e protege a sua privacidade em todas as aplicações ao nível do DNS
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
Ler mais
Scan para descarregar
Utilize qualquer leitor de código QR disponível no seu dispositivo
AdGuard para iOS v4.5
O ecrã principal do bloqueador de conteúdo AdGuard
O ecrã Filtros do bloqueador de conteúdo AdGuard
O ecrã de Configurações do bloqueador de conteúdo AdGuard
21 483 21483 comentários de utilizador
Excelente!

Bloqueador de conteúdo do AdGuard

O AdGuard Content Blocker elimina todos os tipos de anúncios em navegadores móveis que suportam a tecnologia de bloqueio de conteúdos, nomeadamente o Samsung Internet e o Yandex Browser. As suas funcionalidades são limitadas em comparação com o AdGuard para Android, mas é gratuito, fácil de instalar e eficiente
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
Ler mais
Bloqueador de conteúdo do AdGuard v2.8
A tela principal da Extensão de Navegador AdGuard
Tela de proteção contra rastreamento da extensão de navegador AdGuard
21 483 21483 comentários de utilizador
Excelente!

Extensão de navegador AdGuard

O AdGuard tem a extensão de bloqueio de anúncios mais leve, rápida e que efectivamente bloqueia todos os tipos de anúncios em todas as páginas da internet! Escolha o AdGuard para o navegador que usa e obtenha uma navegação gratuita, rápida e segura.
Instalar
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
Instalar
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
Instalar
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
Instalar
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
Instalar
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
Ler mais
Instalar
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
Ler mais
Extensão de navegador AdGuard v5.5
A tela principal do Assistente do AdGuard
21 483 21483 comentários de utilizador
Excelente!

Assistente do AdGuard

Uma extensão para navegadores complementar para aplicações de ambiente de trabalho AdGuard. Permite-lhe bloquear itens personalizados em websites, adicionar websites à lista de permissões e enviar relatórios de erro diretamente a partir do seu navegador
Assistente do AdGuard v1.4
21 483 21483 comentários de utilizador
Excelente!

AdGuard Home

O AdGuard Home é uma solução baseada na rede para bloquear anúncios e rastreadores. Instale-o uma vez no seu router para proteger todos os dispositivos da sua rede doméstica, sem necessidade de software cliente adicional. Isto é especialmente importante para diversos dispositivos inteligente (Internet of Things) que representam frequentemente uma ameaça à sua privacidade
AdGuard Home v0.107
A tela principal do AdGuard Pro para iOS
A tela de Proteção do AdGuard Pro para iOS, mostrando os recursos e as configurações de proteção
A tela de Estatísticas do AdGuard Pro para iOS, mostrando estatísticas de anúncios e rastreadores bloqueados
21 483 21483 comentários de utilizador
Excelente!

AdGuard Pro para iOS

AdGuard Pro para iOS vem com todas as características avançadas de bloqueio de anúncios ativadas. Oferece as mesmas ferramentas da versão paga do AdGuard para iOS. Destaca-se ao bloquear anúncios no Safari e permite customizar as definições de DNS para customizar a sua proteção. Bloqueia anúncios em navegadores e aplicações, protege os seus filhos de conteúdo impróprio e mantém os seus dados pessoais seguros
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
Ler mais
AdGuard Pro para iOS v4.5
A tela principal do AdGuard Mini para Mac
A tela de proteção do Safari do AdGuard Mini para Mac
A tela de criação de regra do AdGuard Mini para Mac
21 483 21483 comentários de utilizador
Excelente!

AdGuard Mini para Mac — bloqueador de anúncios para Safari

O AdGuard Mini para Mac é um poderoso bloqueador de anúncios para o Safari. Esta aplicação leve remove anúncios, bloqueia rastreadores e acelera o carregamento de páginas. Ajuda-o a navegar na Web no Safari sem distrações e a manter os seus dados privados
Instalar
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
Ler mais
AdGuard Mini para Mac v2.3
O ecrã principal do AdGuard para Android TV com a proteção activada
O ecrã de bloqueio de anúncios do AdGuard para Android TV, mostrando as suas funcionalidades e definições
O ecrã Definições do AdGuard para Android TV
O ecrã de gestão de aplicações do AdGuard para Android TV, que mostra as aplicações onde os anúncios e os rastreadores estão bloqueados
21 483 21483 comentários de utilizador
Excelente!

AdGuard para Android TV

O AdGuard para Android TV é a única aplicação que bloqueia anúncios, protege a sua privacidade e actua como uma firewall para a sua smart TV. Receba avisos sobre ameaças da Web, utilize DNS seguro e aproveita o tráfego encriptado. Relaxe e mergulhe nas suas séries favoritas com segurança de alto nível e zero anúncios!
AdGuard para Android TV v4.14, 14 dias período de teste
A mascote do AdGuard, Agnar, segurando o pinguim do Linux
21 483 21483 comentários de utilizador
Excelente!

AdGuard para Linux

O AdGuard para Linux é o primeiro bloqueador de anúncios do mundo para todo o sistema Linux. Bloqueie anúncios e rastreadores no nível do dispositivo, selecione entre filtros pré-instalados ou adicione seus próprios filtros, tudo através da interface de linha de comando
AdGuard para Linux v1.4
21 483 21483 comentários de utilizador
Excelente!

AdGuard Temp Mail

Um gerador gratuito de endereços de e-mail temporários que o mantém anónimo e protege a sua privacidade. Sem spam na sua caixa de entrada principal!
21 483 21483 comentários de utilizador
Excelente!

AdGuard VPN

75 locais em todo o mundo

Aceder a qualquer conteúdo

Encriptação de alto nível

Nenhuma política de registo

Conexão mais rápida

Assistência 24/7

Experimente gratuitamente
Ao fazer a transferência do programa, aceita os termos do Contrato de licença
Ler mais
21 483 21483 comentários de utilizador
Excelente!

AdGuard DNS

O AdGuard DNS é uma solução alternativa para bloqueio de anúncios, protecção de privacidade e controlo parental. Fácil de configurar e de usar, oferece uma protecção mínima necessária contra anúncios, monitorizadores e phishing. Independentemente da plataforma e dispositivo que estiver a usar.
21 483 21483 comentários de utilizador
Excelente!

AdGuard Mail

Proteja a sua identidade, evite o spam e mantenha a sua caixa de entrada segura com os nossos aliases e endereços de correio eletrónico temporários. Desfrute do nosso serviço gratuito de reencaminhamento de correio eletrónico e das nossas aplicações para todos os sistemas operativos
21 483 21483 comentários de utilizador
Excelente!

AdGuard Wallet

Uma carteira de criptomoedas segura e privada que lhe dá controlo total sobre os seus ativos. Faça a gestão de múltiplas carteiras e descubra milhares de criptomoedas para armazenar, enviar e trocar
A transferir o AdGuard Clique no botão indicado pela seta para iniciar a instalação Seleccione "Abrir" e clique em "OK", depois espere que o ficheiro seja transferido. Na janela aberta, arraste o ícone AdGuard para a pasta "Aplicações". Obrigado por escolher o AdGuard! Seleccione "Abrir" e clique em "OK", depois espere que o ficheiro seja transferido. Na janela aberta, clique em "Instalar". Obrigado por escolher o AdGuard!
Instale o AdGuard no seu dispositivo móvel