VPN means Virtual Private Network.

  • VPN creates a secure, encrypted connection between your device and a server over a public network, such as the internet
  • It relies on two main mechanisms: Encapsulation and Encryption

Encapsulation

  • Normally, when you send data, the packet has "From: Your IP" and "To: Website IP"
  • In a VPN, the computer takes the original packet and wraps it inside a new packet
  • The outer packet is performative. It shows the VPN Server, which is all that the public sees
  • The inner packet is the actual data that you send. The public internet cannot see it

Encryption

  • Before the inner packet is wrapped, it is scrambled with a mathematical algorithm
  • If someone intercepts the outer packet and unwraps it, they see garbled noise
  • Only the VPN server has the key to decrypt it into readable data

Protocol in Servers

  • A protocol is a strictly defined set of rules that dictates how two devices communicate
  • It is the "grammar" of the network
  • Without a shared protocol, a server and laptop send random electrical pulses to each other without understanding what they mean
  • The protocol defines the structure of data, the meaning of commands, and how to start and stop the conversation
  • In a server rack, protocols are layered. The layers determine how data is delivered
  • Application Layer: HTTP for Web, FTP for Files, and SSH for Remote Control
  • Transport Layer: TCP and UDP

Transmission Control Protocol Socket

  • TCP is a connection-oriented protocol
  • It prioritizes accuracy and order over speed
  • It ensures that every byte arrives intact and in the correct sequence
  • Before sending data, the sender and receiver must agree and communicate
  • If a packet is missing or corrupted, the sender automatically resends it
  • Packets are numbered. If they are out of order, TCP rearranges them before sending them to the receiver
  • Use cases: Loading a webpage, sending email, and downloading a file

User Datagram Protocol Socket

  • UDP is a connectionless protocol
  • It prioritizes speed and efficiency over reliability
  • The sender shoots data packets without acknowledgement from the receiver
  • If a packet is lost, it is gone forever
  • There is no order of packets
  • Use cases: Streaming video, Voice over IP, and Gaming

Encapsulation Mechanism

  • The .ovpn file contains Coordinates and Keys
  • Encapsulation is similar to Signal Modulation
  • VPN software takes the entire original packet, including the header and data, and treats it as the payload for a new, larger packet
  • It wraps the original signal inside a new "envelope"

Cryptography

Cryptography makes the tunnel private and uses Public Key Infrastructure, or PKI.

Authentication

  • The client gives a Digital Certificate, or ID Card
  • The server checks whether the certificate matches the signature stored in the file
  • This ensures that only the specific team that you authorized can connect

Session Key

  • After the client and server trust each other, they agree on a temporary "Session Key"
  • This key scrambles the data
  • It turns data into random noise