TUN/TAP

TUN and TAP are virtual network kernel drivers that simulate the network equipment via software. While normally behind a network device ( such as eth0) directly hides an appropriate hardware in the form of a network card, packets that are sent to a TUN / TAP device are forwarded to a program in user space and vice versa. In order for a user-space program can also access the TUN / TAP devices, this in contrast to the real Ethernet cards a device file named tunN or tapN under / dev.

Difference between TUN and TAP

TUN simulates a point- to-point network device ( OSI Layer 3) and communicates via IP packets with the software, while TAP an Ethernet device simulates ( OSI Layer 2) and communicates via Ethernet frames with the software.

Examples of applications

Used TUN / TAP et al for:

  • Virtual Private Networks OpenVPN, Ethernet / IP over TCP / UDP; encrypted, compressed
  • Tinc, Ethernet/IPv4/IPv6 over TCP / UDP; encrypted, compressed
  • VTun, Ethernet / IP / serial / Unix pipe over TCP; encrypted, compressed, traffic shaping
  • ICMPTX, IP over ICMP (ping)
  • NSTX, IP over DNS
  • Htun, IP over HTTP
  • Peervpn, [ARP ]
  • OpenSSH; encrypted, compressed, if necessary; -W switch
  • Networks of virtual machines Bochs
  • CoLinux
  • QEMU
  • VirtualBox
  • Hercules ( S/390-Emulator )

Implementations

TUN / TAP drivers are available for at least the following platforms:

  • FreeBSD
  • Mac OS X
  • Linux starting from version 2.1.60 approximately
  • Microsoft Windows 2000/XP
  • OpenBSD
  • NetBSD
  • Solaris
786657
de