The core concept of VDE is the plug. Many virtual machine monitors like qemu, kvm, user-mode linux and virtualbox are VDE compatible. So it is like these VMM had a socket for VDE plugs.
Other programs providing sockets for VDE plugs include user-level TCP/IP stacks like lwipv6, picotcp, networking namespace monitors like vdens, namespace implemented TCP/IP stacks (libvdestack), educational emulators (umps, umps3).
VDEplug4 plugs have a modular design, the actual implementation of VDE used set up the virtual network can be defined by loading a specific plug-in module.
A good metaphore to understand the structure of the VDE plugs is the Small form-factor pluggable transceiver (SFP). Nowadays many (physical) networking appliances have SFP ports. These port can be used to support several different types of transceivers, providing connections using different media (e.g. copper or fiber optics) and line speeds.
In VDE the same concept is virtualized: All the programs supporting VDE use the general purpose libvdeplug API. The VDE plugins play the role of the SFP transceivers and support different implementations of the virtual ethernet networks.
The choice of the plugin and the configuration parameters are given by a string named VNL (Virtual Network Locator) The name reminds the web addesses (URLs) as VNLs use a similar syntax.
Examples:
-
null://a valid interface to a null network (like/dev/nullfor devices) -
vde:///var/run/myswitchconnect to a virtual switch or hub (compatible withvde_switchof vde2) -
tap://tap0connect to a tap interface of the hosting Linux box -
vxvde://234.0.0.1become a node of a vxvde local area cloud -
slirp://connect to the internet using a slirp network emulator -
hub://create a hub -
switch://create a switch -
.... and many others
Note: In order to preserve the backwards compatibility with vde2, a pathname is a legal VNL. The path /a/b/c/d is equivalent to
vde:///a/b/c/d
Note: Reserved chars can be inserted in a VLN using quotation marks or, likewise for URLs,
by the percent-encoding (i.e. %xx: a percent sign followed by the hexadecimal representation of
the ASCII value of the character).
vde_plug connects two plugins in two different ways:
-
when
vde_plughas two VNL arguments it connects them directly:vdeplug foo://... bar://... -
when
vde_plughas only one argument it uses the standard streams (stdin,stdout) to communicate, so it needs a secondvde_plugconnected through a dual pipe (dpipecommand) to connect the other plugin:dpipe vde_plug foo://... = vde_plug bar://...The bidirectional stream can be processed: any tool able to support a bidirectional stream can be used. As an example we could want foo and bar to run on different hosts, we can use ssh to forward the stream:
dpipe vde_plug foo://... = ssh remote.host vde_plug bar://...










