11

I'm studying about virtual networking.

I saw the youtube video that makes tap interfaces and adds them to Open Virtual Switch.

From here, I don't know what tap interfaces are.

What's different between normal interface like eth0 and tap interface?

Is tap interface just virtual L2 interface to add it to OVS?

If it is right, what's the purpose of tap interface w/o attaching it to OVS?

13

OpenVSwitch is a virtual switch. It works by attaching to several Ethernet devices in raw packet/Ethernet mode. It switches Ethernet frames between those Ethernet devices by reading/writing raw Ethernet frames to/from those network interfaces.

This is nice if you want to switch between real Ethernet devices. If you want to connect a VM to your Open V Switch instance you need to attach Open V Switch to a virtual Ethernet devices representing your connection to this VM: writing packet to this virtual network interface should send the Ethernet frame to the VM and packet sent by the VM should be sent to this virtual network interface.

TAP network interfaces are designed for this. They represent virtual Ethernet devices. A TAP network interface is managed by some user process:

  • when an Ethernet frame is sent to the network interface, the user process receives this Ethernet frame;

  • the user process can send Ethernet frames to this network interface.

This is often used for:

  • VPNs (such as OpenVPN): When an Ethernet frame is sent to the TAP network interface, the VPN process receives it and forwards it in a tunnel. Conversely when the user process receives an Ethernet frame from the tunnel it forwards them to the TAP interface;

  • vitual machines: When an Ethernet frame is sent to the TAP interface, the hypervisor/emulator receives it and forwards it to the VM. Conversely when the VM sends a packet to its interface, the hypervisor/emulator forwards it to the TAP interface.

For Openvswitch, you typically create a TAP interface which represents your connection to a VM and can then connect this network interface to OpenVSwitch.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.