For the sake of security, the VPN encapsulation and transmission of the universal router cannot use plain text during transmission, which is usually encrypted and encapsulated before transmission to prevent some sensitive data from being stolen. Today, I will take a universal router as an example to introduce how to encapsulate, encrypt, and transmit VPN data packets.
1. The first thing to understand is the route decision-making and packet encapsulation process of the VPN Client. Generally, the VPN Virtual Interface is a virtual point-to-point Link interface. When the VPN Virtual Interface receives a packet, it encapsulates the packets obtained from the network layer into PPP point-to-point data frames and performs encryption and other operations, and then sends them to the Gateway. The gateway here is the VPN Client itself, therefore, the encapsulated PPP point-to-point data frame is returned to the local machine for further processing. This processing is actually a re-encapsulation process. Www.2cto.com 2. Because the frames encapsulated for the first time can only be transmitted through the Virtual VPN interface, if you want to transmit data through the actual interface, you must encapsulate the data again on the actual link layer, before being finally encapsulated as a link layer data frame, You Need To perform other multi-level encapsulation on the PPP data frame encapsulated for the first time, because the specification cannot directly encapsulate the PPP frame in another link layer frame, some headers need to be added between them. The simplest PPTP encapsulation is to add a GRE header and IP header before the PPP frame. 3. A route decision is required when encapsulated into an IP header, for example, because the data packet must be explicitly sent to the VPN Server in the distance, it will find a route to the VPN Server in the distance, when a VPN connection is established, a route to the VPN Server is created at the same time, and the IP data packets encapsulated into PPTP format or L2TP format are sent to the specified interface of this route for processing. For an Ethernet interface, this packet is added with the Ethernet header. If it is a point-to-point packet, a point-to-point link header is added and sent to the network. The above is the whole process of VPN packet encryption encapsulation and transmission of the universal router. If you are not familiar with this, you can learn about it. This article is from