TUN/TAP
From Wikipedia, the free encyclopedia
In computer networking, TUN and TAP are virtual network kernel drivers. They implement network devices that are supported entirely in software, which is different from ordinary network devices that are backed up by hardware network adapters.
TAP simulates an Ethernet device and it operates with Layer 2 packets such as Ethernet frames. TUN simulates a network layer device and it operates with Layer 3 packets such as IP packets.
Packets sent by an operating system via a TUN/TAP device are delivered to a user-space program that attaches itself to the device. A user-space program may also pass packets into a TUN/TAP device. In this case TUN/TAP device delivers (or "injects") these packets to the operating system network stack thus emulating their reception from an external source.
TUN/TAP is used for:
- virtual private networks
- OpenVPN, Ethernet/IP over TCP/UDP; encrypted, compressed
- tinc (protocol) [1], Ethernet/IPv4/IPv6 over TCP/UDP; encrypted, compressed
- VTun [2], Ethernet/IP/serial/Unix pipe over TCP; encrypted, compressed, traffic shaping
- OpenSSH
- ICMPTX [3], IP over ICMP (ping)
- NSTX [4], IP over DNS
- HTun [5], IP over HTTP
- coLinux, Ethernet/IP over TCP/UDP
- Hamachi
- virtual machine networking
TUN/TAP drivers are available on at least the following platforms:
- FreeBSD
- Mac OS X
- Linux, starting around version 2.1.60
- Microsoft Windows 2000/XP
- OpenBSD
- NetBSD
- Solaris Operating System