They are virtual network interfaces, implemented in the kernel but with a user mode program (your code) responsible for handling the actual packets.
For TUN devices, each packet is a complete IP packet, either v4 or v6, typically itself encapsulating some other protocol e.g. tcp, udp, icmp etc.
They’re commonly used for VPNs.






















