TUN is for IP tunneling. It provides two interfaces to userland.
* /dev/tunX character device.
* tunX virtual Point-to-Point interface.
The kernel and userland applications can write IP frames to a TUN device and each side will be able to receive the frames. Interaction with the networking interface as tun0, tun1, etc., is done through /dev/tunX.
TAP is for Ethernet tunneling. It provides two interfaces to userland.
* /dev/tapX character device.
* tapX virtual Ethernet interface.
A userland application can write Ethernet frame to /dev/tapX and the kernel will receive this frame from tapX interface while at the same time every frame that kernel writes to tapX, userland applications can read from /dev/tapX.
Check out vtun if you’re looking to get networking working in qemu or kvm.

The easiest way to create Virtual Tunnels over TCP/IP networks
with traffic shaping, compression and encryption.
* IP tunnel (tun)
Supports point-to-point IP tunnel.
* Ethernet tunnel (ether)
Supports all protocols that work over Ethernet: IP,IPX,Appletalk,Bridge,…
* Serial tunnel (tty)
Supports all protocols that work over serial lines: PPP,SLIP,…
* Pipe tunnel (pipe)
Supports all programs that works over Unix pipes.