Difference between TUN & TAP interfaces
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
- Holmes.Sherlock
- OpenVPN User
- Posts: 40
- Joined: Wed Jul 06, 2011 4:51 am
Difference between TUN & TAP interfaces
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?
- janjust
- Forum Team
- Posts: 2703
- Joined: Fri Aug 20, 2010 2:57 pm
- Location: Amsterdam
- Contact:
Re: Difference between TUN & TAP interfaces
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.
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.
- Holmes.Sherlock
- OpenVPN User
- Posts: 40
- Joined: Wed Jul 06, 2011 4:51 am
Re: Difference between TUN & TAP interfaces
What is this PTP protocol formally called? PPP?janjust wrote: .....IP headers are stripped and a new PtP IP header is added.
- janjust
- Forum Team
- Posts: 2703
- Joined: Fri Aug 20, 2010 2:57 pm
- Location: Amsterdam
- Contact:
Re: Difference between TUN & TAP interfaces
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.
- Holmes.Sherlock
- OpenVPN User
- Posts: 40
- Joined: Wed Jul 06, 2011 4:51 am
Re: Difference between TUN & TAP interfaces
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?
- janjust
- Forum Team
- Posts: 2703
- Joined: Fri Aug 20, 2010 2:57 pm
- Location: Amsterdam
- Contact:
Re: Difference between TUN & TAP interfaces
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.