Life of a Packet

Here we are going to consider the lifecycle of a single request-response cycle for a simple ping, and the layers it flows through logically. Then, we will show the function call flow for lightway-core specifically.

For the purposes of clarity, we are going to presume the common use case of a "tun device" created on the client and server that takes all packets placed on that device and sends them to the listening client. This is an extremely common VPN setup but "tun devices" are not part of lightway-core and all lightway-core is responsible for is wrapping packets.

Life of a Packet

Client→Server
Figure 1. Client→Server
Server→External
Figure 2. Server→External