A virtual private network (VPN) provides a secure connection between two points in a network (e.g. an IoT device and a server). It effectively creates a private communication ‘tunnel’, enabling users to send and receive data across the public internet as if they were directly connected to a private network.
All VPNs require a system to determine how data is routed between devices and how it is protected in transit. OpenVPN is one of the most popular of these systems. Here are its key features:
Establishing a tunnel
With OpenVPN, a communication tunnel can be set up using one of two protocols: TCP (Transmission Control Protocol), or UDP (User Datagram Protocol). TCP has particularly strong in-built protocols for guaranteeing data delivery and avoiding errors, so it’s a good option for IoT devices that transmit critical data (e.g. industrial monitoring and medical data).
UDP is a simpler protocol designed for speed. It’s useful if your devices which need to transmit data in real-time (e.g. video surveillance) or on devices which transmit small amounts of regular data which is not time sensitive. The UDP protocol has lower processing and memory requirements so is better for smaller, lower-cost IoT sensor type devices.
Encryption
To secure the flow of data, OpenVPN uses SSL/TLS (Secure Sockets Layer / Transport Layer Security) protocols. This is the same type of technology used to protect most websites. It provides a reliable way for devices to generate and exchange encryption keys, to ensure that only authorised devices or users access the network, and to verify that data has not been altered in transit.