How Does a VPN Work? Tutorial for Beginners

How Does a VPN Work? Tutorial for Beginners

freecodecamp.org - Jan 24

Do you worry about online security while using public Wi-Fi? Or has someone told you that you might get hacked when using an insecure connection and someone will steal all your details?

Well, you might have also heard that you should use a VPN to protect your online privacy. But do you have any idea what it is and how it works?

Don’t worry – in this article, we will go through everything that you need to know to about what and when to use a VPN and when to avoid using it. So, without any further delay, let’s get started.

What is a VPN?

VPN stands for Virtual Private Network. It is a type of network you can connect to which will help you protect your online security and privacy.

A VPN acts as a tunnel through which all your data goes from your location to your destination. It's all properly encrypted and secure so that any outside party can’t see what data you are transferring.

There are many advantages to using VPNs, such as:

  • Privacy
  • Anonymity
  • Security
  • Encryption
  • Masking or changing your original IP address, so others can’t track you

We'll discuss these advantages and more further down in this article, but first you need to understand how a VPN works so you can use it properly.

How Does a VPN Work?

image-223
Image source

A VPN works by routing / forwarding all your data from your laptop or phone through your VPN to the internet, rather than directly through your ISP.

When you use a VPN, it encrypts all your data on the client side. Then after the data is encrypted, it's passed through a VPN tunnel which others can’t access, and then it reaches the internet.

But before going through the VPN tunnel, the request is first sent to your ISP, but as it's encrypted, ISP can’t figure out what you are trying to access. So it forwards your request to your VPN server. Then the VPN sends the request to your desired IP address or website.

Advantages of Using a VPN

Now let's discuss some of the advantages in more detail.

Unblock websites & bypass filters

There might be scenarios where you won’t be able to access certain websites which are blocked by your office or school or college department, but you still want or need to access them.

These websites may include social networking sites, movie downloading websites, or any kind of media streaming websites.

In these cases, a VPN will help you bypass all the blocking filters and let you access the websites that you wish to access without anyone’s help and others will have no idea what you're accessing.

Bypass regional restrictions

People in certain countries cannot access any websites outside their country like YouTube or Google because their government doesn't want them to use any other websites.

If you're in one of these places and still want to access these blocked websites, then a VPN can help by bypassing all the regional restrictions. You'll be able to access all the restricted or blocked content without letting the government know about your activity.

Access geo-blocked websites

There are several websites, special offers, and services which are available for specific countries or regions. But what if you also want to take advantage of that opportunity, but it’s not accessible in your region?

A VPN can help you by changing your IP address which will change your location on the internet. Then you will seem to be a user from that country and you can also have all the benefits that people in that particular region are enjoying.

Change your IP address

Your ISP is tracking your every move on the internet – which websites you are visiting, the amount of time you are spending there, and when you log in and log out from a website.

But sometimes you may need to hide your browsing history/activity from your local network/ISP. In that case, using a VPN can help you keep all your records encrypted, and your ISP will have no idea what you are doing with your internet. All your internet browsing activity will be masked by the VPN.

Online anonymity and privacy

Everything on the internet is tracking you. Website and web servers that you use or visit know your IP and location. That can be used to their advantage and every time you visit the same website, they will know that it’s you, and they will track your usage and your behavior. This isn't necessarily a good thing since you are giving them a lot of information without knowing what.

A VPN can help keep your identity anonymous so you don't need to worry about identity leakage or any kind of tracking activity.

Enhanced security

As discussed above, using VPN can keep your identity safe and also keeps your data encrypted while you browse the internet. As a result, it enhances security and the chances that someone might hack you will be lower.

So, using VPN will keep you safe when you are using any public Wi-Fi or browsing websites which are not secure.

Disadvantages of VPN

There are some downsides to using a VPN as well:

Slows your connections

VPNs tend to slow your internet connection. As the VPN servers might be located far away from you (might be in some other geographic location or country), your data will need to travel farther across the internet and will slow your connection speed.

VPNs log your activities

VPNs keep logs of your activities. You heard right. Regardless of what policies they have, even if they say that they don’t keep any logs, they do. Governments have taken action against VPNs, and the VPN companies tend to deliver all the activity logs of a user in cases of international crime, terrorist activity, or hacking.

So – it goes without saying – make sure you don’t use VPNs for any illegal activities. Use it instead to protect yourself and your identity from malicious hackers.

Specific blockades of VPN services

There are many websites and streaming services like Netflix which will not allow any unusual VPN users to access their content. So, there might be many cases where your VPN will help, but there are many websites and servers which won't allow you to access them using a VPN.

Cost

Although there are many free VPN services which you can use, if you are planning to use VPN on regular basis then you might need to purchase a paid version. Free VPNs don’t provide good speed and the amount of data usage is also limited on a daily basis. VPNs cost around $10 to $15 per month for the premium services.

How a VPN Can Help You Protect Your Online Identity

When you use the internet, the data you send or request through a web browser to any server (for example, when Google searching), along with your request, IP address (for example, your laptop or mobile) and destination IP address (like Google) first reaches your ISP.

The ISP monitors all your activity and then forwards your request to the destination IP address and also gets back the information in the same way.

All your information travels through a middle station, your ISP. They have all your history of using the internet and how you are using the internet. But when you are using a VPN, that's not the case.

Whenever you send any request to any website or server, instead of connecting directly to the server, it first reaches the VPN server. There, all your requests and information are encrypted and then sent forward to your desired website.

Your ISP is still there to monitor things. But if you're using VPN, it will automatically change the IP address of your destination to a different IP address and encrypt the destination IP address. This way, your ISP won’t be able to read it and will assume that all your requests were going to the IP address of the VPN. So it will forward all your requests to the VPN.

When your request or information reaches your VPN, it will be decrypted, and it will forward your request to the website you wish to access. The website or server will get the VPN request and will assume that the request is coming from that VPN server. It will allow the VPN to access the website and you'll be able to visit the website without letting your ISP know.

Similarly, when you download a file, all the traffic or information flows from a web server to the VPN. The VNP encrypts all the information and then forwards it to your ISP – which will still have no idea what’s going on, as the information is encrypted.

Finally, the info gets forwarded to your laptop or mobile. When it reaches your device, it will be decrypted, and you will be able to view the website as it's available to others.

Frequently Asked VPN Questions

Is VPN traffic encrypted?

YES! As explained above, all the traffic passed through VPN is encrypted through various encryption algorithms like the RSA (Rivest–Shamir–Adleman) algorithm, AES (Advanced Encryption Standard), and others.

What is an always-on VPN? What is a kill switch?

I will try to explain this concept in approachable terms. Always on VPN is a service which allows you to automatically connect to a VPN whenever you are connected to the internet. These kinds of services are used by companies which don’t want outside users to access their data and only want their employees to access their data from an outside, remote location.

Whenever an employee, company, or user who has access to the resources tries to access, then they need to enter valid credentials to automatically connect to the VPN. This also allows them to access all their work and resources present inside the company from an outside or remote location.

A VPN kill switch is another major feature offered by VPN service providers. Whenever there is a sudden or accidental loss of a VPN connection, in that case, your information might get exposed.

To deal with that, a VPN kill switch is used to terminate your internet connection when there is no VPN connection. This is a very useful feature for protecting your data from outside users.

So, when the kill switch is ON, internet connections will be terminated. But when the kill switch is OFF, then the internet will not be terminated when there is a loss of VPN connection.

Is a VPN necessary?

A VPN is not strictly necessary depending on your needs and activities, but it's useful.

Using VPN helps protect your online security, privacy, and anonymity. It will also protect you from malicious threats and trackers when you are using an unsecured website or using any unknown wi-fi connection which might be public.

Is a VPN 100% safe?

Nothing on the internet is 100% secure. There are and will always be ways to expose services like VPNs. But using a VPN will typically help you more than it'll harm you.

Yes! VPNs are legal in India and can be used freely to access any content on the internet without any restrictions. Just remember that you should not use it for any illegal activity, as there are always ways to track you regardless of what VPN service you use.

Do VPNs log or store my data?

VPNs log all your data and store all information, and it might be able to share your data with government authorities. There have been many cases where VPNs say they have a no logs policy but still keep logs of users and shared them with authorities.

What is the main difference between a firewall and a VPN?

  Firewall

VPN

  •   Software or hardware device 

 

  • Service or Server

 

  •   acts as a filter to allow and block websites and users to access a particular website
  • it encrypts the IP address and information from both source and destination and allows users to access all blocked or restricted websites and even private network information.

Conclusion

VPNs definitely have their advantages and disadvantages. Organizations use them to protect their private networks and information. You can also use one to access blocked content, and to protect your privacy, anonymity and security. Using a VPN for legal activities is beneficial and adds extra security.

When you are not sure about using or accessing any unknown (public/private) wi-fi or unsecured untrusted website, then you should always use a VPN (free/paid). Although paid VPNs have their advantages, occasionally using free VPNs won’t harm you and will still serve the purpose.

And just remember – don't ever try to use a VPN to perform any illegal activities.

MORE ARTICLES