Page 1 of 1

Difference between TUN & TAP interfaces

Posted: Mon Oct 17, 2011 8:03 am
by Holmes.Sherlock
Though I'm using OpenVPN since last few months, the difference between TUN & TAP adapters ar enot quire clear to me. I've come across the FAQ also. But, it didn't make much sense to me as I'm not familiar with the concept of Point-To-Point link. Can anybody please explain me it technically?

Re: Difference between TUN & TAP interfaces

Posted: Mon Oct 17, 2011 8:26 am
by janjust
a TUN interface is a point-to-point interface that can only forward IP based traffic. When a packet is sent from an ethernet LAN to a TUN interface the ethernet and IP headers are stripped and a new PtP IP header is added. TUN interfaces cannot forward broadcast traffic

a TAP interface is a virtual ethernet interface and can forward any kind of traffic. When a packet is sent from an ethernet LAN to a TAP interface the ethernet header is stripped and replaced with one from the TAP interface, just like a switch would do. A TAP network usually is a multicast, non-broadcast network

A special mode of using a TAP interface is bridging mode. If you bridge two interfaces together (lan+tap, lan+lan or tap+tap) then all traffic which is received on one interface is automatically rebroadcast on the other interface. This allows for a full broadcast capable network.

Re: Difference between TUN & TAP interfaces

Posted: Mon Oct 17, 2011 8:35 am
by Holmes.Sherlock
janjust wrote: .....IP headers are stripped and a new PtP IP header is added.
What is this PTP protocol formally called? PPP?

Re: Difference between TUN & TAP interfaces

Posted: Mon Oct 17, 2011 9:42 am
by janjust
nope, it's a point-to-point interface, meaning non-broadcast, non-multicast and there are only 2 endpoints. This is different from an ethernet-style interface, which operate on a bus-like architecture containing multiple endpoints.

Re: Difference between TUN & TAP interfaces

Posted: Mon Oct 24, 2011 1:01 pm
by Holmes.Sherlock
What I understand that TAP is software equivalent of a physical ethernet interface. Is there any physical counterpart which can be thought of as similar to a TUN interface?

Re: Difference between TUN & TAP interfaces

Posted: Wed Oct 26, 2011 1:00 pm
by janjust
the phyical equiv of a 'tun' interface might be a dedicated dialup link (point-to-point serial line). This type of i/f is not used very often these days.