1 .\" Copyright (c) 2012-2013 Luigi Rizzo, Universita` di Pisa
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 .\" This document is derived in part from the enet man page (enet.4)
26 .\" distributed with 4.3BSD Unix.
28 .\" $FreeBSD: head/share/man/man4/vale.4 228017 2011-11-27 06:55:57Z gjb $
35 .Nd a very fast Virtual Local Ethernet using the netmap API
42 module that implements multiple virtual switches that can
43 be used to interconnect
45 clients, including traffic sources and sinks, packet forwarders,
46 userspace firewalls, and so on.
49 is implemented completely in software, and is extremely fast.
50 On a modern machine it can move almost 20 Million packets per
51 second (Mpps) per core with small frames, and about 70 Gbit/s
52 with 1500 byte frames.
55 dynamically creates switches and ports as client connect
65 is the prefix indicating a VALE switch rather than a standard interface,
67 indicates a specific switch (the colon is a separator),
70 indicates a port within the switch.
71 Bridge and ports names are arbitrary strings, the only
72 constraint being that the full name must fit within 16
76 ports can be physical network interfaces that support the
79 by specifying the interface name for
83 for details of the naming rule.
85 Physical interfaces are attached using the
95 The corresponding host stack can also be attached to the bridge, specifying
99 To detach the interface from the bridge,
100 .Dv NETMAP_BDG_DETACH
102 .Dv NETMAP_BDG_ATTACH .
103 The host stack is also detached from the bridge at the same
104 time if it had been attached.
106 Physical interfaces are treated as a system configuration;
107 they remain attached even after the configuring process died,
108 and can be detached by any other process.
110 Once a physical interface is attached, this interface is no longer
111 available to be directly accessed by
113 clients (user processes) or to be attached by another bridge.
114 On the other hand, when a
116 client holds the physical interface,
117 this interface cannot be attached to a bridge.
124 is used to obtain bridge and port information.
125 There are two modes of how this works.
128 starting from non '\\0' is provided,
130 returning indicates the position of the named interface.
131 This position is represented by an index of the bridge and the port,
136 fields, respectively.
137 If the named interface does not exist,
144 starting from '\\0' is provided,
146 returning indicates the
147 first existing interface on and after the position specified in
151 If the caller specified a port index greater than the highest
152 index of the ports, it is recognized as port index 0 of the
161 if the given position is higher than that of
162 any existing interface.
163 On successful return of
165 the interface name is also stored in
168 is always used with the
173 Below is an example of printing all the existing ports walking through
177 int fd = open("/dev/netmap", O_RDWR);
179 bzero(&nmr, sizeof(nmr));
180 nmr.nr_version = NETMAP_API;
181 nmr.nr_cmd = NETMAP_BDG_LIST;
182 nmr.nr_arg1 = nmr.nr_arg2 = 0; /* start from bridge:0 port:0 */
183 for (; !ioctl(fd, NIOCGINFO, &nmr); nmr.nr_arg2++) {
184 D("bridge:%d port:%d %s", nmr.nr_arg1, nmr.nr_arg2,
186 nmr.nr_name[0] = '\\0';
191 currently supports up to 8 switches, 254 ports per switch,
192 1024 buffers per port.
193 These hard limits will be changed to
195 variables in future releases.
197 Attaching the host stack to the bridge imposes significant performance
198 degradation when many packets are forwarded to the host stack.
199 This is because each packet forwarded to the host stack causes
201 allocation in the same thread context.
206 variables to control operation:
207 .Bl -tag -width "dev.netmap.verbose"
208 .It dev.netmap.bridge
209 The maximum number of packets processed internally
211 Defaults to 1024, use lower values to trade latency
213 .It dev.netmap.verbose
214 Set to non-zero values to enable in-kernel diagnostics.
217 Create one switch, with a traffic generator connected to one
219 .Xr netmap 4 Ns -enabled
221 instance on another port:
222 .Bd -literal -offset indent
223 tcpdump -ni vale-a:1 &
224 pkt-gen -i vale-a:0 -f tx &
228 each connected to two qemu machines on different ports.
229 .Bd -literal -offset indent
230 qemu -net nic -net netmap,ifname=vale-1:a ... &
231 qemu -net nic -net netmap,ifname=vale-1:b ... &
232 qemu -net nic -net netmap,ifname=vale-2:c ... &
233 qemu -net nic -net netmap,ifname=vale-2:d ... &
239 .%A Giuseppe Lettieri
240 .%T VALE, a switched ethernet for virtual machines
241 .%U http://info.iet.unipi.it/~luigi/vale/
248 switch has been designed and implemented in 2012 by
251 .An Giuseppe Lettieri
252 at the Universita` di Pisa.
255 has been funded by the European Commission within the FP7 Projects
256 CHANGE (257422) and OPENLAB (287581).