What is VPN?

In this tutorial, you will learn about virtual private networks (VPNs), including what they are, their evolution over time, how they work, reasons for their use, different types of VPNs, and various VPN protocols used for secure communication.


  1. What is VPN?
  2. Evolution of Virtual Private Networks
  3. How Does a VPN Work?
  4. Why Use a VPN?
  5. Types of VPNs
  6. VPN Protocols

What is VPN?

A Virtual Private Network (VPN) is a technology that ensures your online privacy and security by creating a secure, encrypted connection over a less secure network, such as the internet. VPNs are widely used by individuals and organizations to protect their sensitive data, maintain privacy, and bypass geographical restrictions online.

Evolution of Virtual Private Networks

In the past, the company’s computers were building networks with leased telephone lines and were known as private networks. Usually, it used to cost a lot to build this network. Then, public data networks and the Internet were introduced, and most companies moved their data over the Internet. They want security on the Internet, as it was in private networks. This demand gave rise to the virtual private network concept.

  • A virtual private network has the properties of a private network. Virtual here means that VPNs are virtual and not real, just like the virtual circuits used in connection-oriented are not real.
  • Most firewalls and some common routers have VPN capability that provides a secure tunnel for communication.
  • The firewall manages and sets up security associations, and VPN is transparent to the end-user software.
  • The system or network administrator is aware of the VPN because he has to configure and manage the security gateway.

The below diagram explains the virtual private network.

virtual private network
  • As shown in the figure, a secure tunnel is created from PC-1 to PC-4, which is known as a Virtual Private Network. The packet sent by the PC-1 is traveling through the VPN tunnel.
  • Here, both the networks have firewalls that provide security to the internal network, and the VPN transmits data in an encrypted format through a secure tunnel.

How Does a VPN Work?

When you connect to a VPN, your device creates a secure connection to a VPN server. All data transmitted between your device and the VPN server is encrypted, which means it’s encoded in a way that only authorized parties can access. This encryption prevents anyone else from intercepting and reading your internet traffic.

The VPN server acts as a middleman between your device and the internet. Instead of your internet traffic passing directly through your internet service provider (ISP), it goes through the VPN server. This masks your IP address and makes your online actions harder to trace. It also allows you to appear as if you’re connecting to the internet from the location of the VPN server, which can help you bypass geographic content restrictions.

Why Use a VPN?

  • Privacy Protection: VPNs hide your IP address and encrypt your internet traffic, making it difficult for third parties to track your online activities.
  • Security: VPNs provide an additional layer of security when using public Wi-Fi networks, protecting your data from hackers and cybercriminals.
  • Access Geo-Restricted Content: VPNs can help you access websites and content that are restricted based on your geographical location. By connecting to a VPN server in another country, you can access content as if you were physically there.
  • Bypass Censorship: In countries with restrictive internet policies, VPNs can bypass censorship and access blocked websites and services.
  • Secure Remote Access: VPNs enable secure remote access to a company’s internal network for employees working remotely.


Types of VPNs

  • Remote Access VPN: Allows individual users to connect to a private network securely over the internet.
  • Site-to-Site VPN: Connects entire networks securely over the internet, typically used in corporate environments.
  • Client-to-Site VPN: Similar to remote access VPNs, but more scalable and flexible, allowing multiple clients to connect to a centralized network.

VPN Protocols

VPN protocols determine how data is transmitted between your device and the VPN server. Some common VPN protocols include:

  • OpenVPN: Open-source protocol known for its strong security and flexibility.
  • IPsec (Internet Protocol Security): Provides security for internet communications by authenticating and encrypting each IP packet of a communication session.
  • L2TP/IPsec (Layer 2 Tunneling Protocol): Provides encryption and authentication between two communication points.
  • SSTP (Secure Socket Tunneling Protocol): Provides a mechanism to transport PPP or L2TP traffic through an SSL/TLS channel.
  • WireGuard: A newer VPN protocol known for its speed and simplicity.

Key Points to Remember

Here is the list of key points we need to remember about “VPNs”.

  • VPNs create secure, encrypted connections over less secure networks like the internet to ensure online privacy and security.
  • They enable individuals and organizations to protect sensitive data, maintain privacy, and bypass geographical restrictions online.
  • Virtual Private Networks (VPNs) evolved from the need for secure internet connections similar to private networks.
  • VPNs establish secure tunnels for communication, often managed by firewalls or routers.
  • When connected to a VPN, your data is transmitted in an encrypted format, enhancing security.
  • VPN servers act as intermediaries between your device and the internet, masking your IP address and location.
  • VPNs can help access geo-restricted content and bypass censorship in some countries.
  • Common VPN protocols include OpenVPN, IPsec, L2TP/IPsec, SSTP, and WireGuard, each with unique features and strengths.

If you find any mistake above, kindly email to [email protected]

Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.