Download paper - AsiaBSDCon
Transcript
Netmap as a core networking technology
Luigi Rizzo, Giuseppe Lettieri
Michio Honda
Università di Pisa
{rizzo,g.lettieri}@iet.unipi.it
NEC Europe Ltd
[email protected]
ABSTRACT
netmap is a network I/O framework for FreeBSD and Linux
that provides a 10-fold speedup over ordinary OS packet I/O
mechanisms. netmap uses less than one core to saturate a 10
Gbit/s interface with minimum size frames (14.88 Mpps) or
switch over 20 Mpps on virtual ports of a VALE switch (part
of the netmap module).
In the past two years we have extended the framework in
many ways, and it can now replace native in-kernel software
switches, accelerate networking in virtual machines, and be
used by unmodified applications based on libpcap.
In this paper we give an overview of the design principles
used in netmap, present the current features of netmap and
the VALE software switch, and present some applications
where we have used these systems.
1.
INTRODUCTION
In 2010, in response to the advent of software defined networking and the demand for high speed software packet processing, we set out to investigate how
to fill the gap between the speed of OS mechanisms
(sockets, bpf etc.) and the requirements of 10 Gbit/s
and faster interfaces. Our goal was to come up with
an I/O framework that was more portable and easier to
use than the various custom solutions proposed at the
time.
The initial result of our work, the netmap framework [9] that we designed in 2011, provided dramatic
speedups to network I/O, over one order of magnitude
for basic packet processing tasks: traffic sources and
sinks, software packet forwarding, monitors. Our first
demonstrators for the effectiveness of our approach were
custom applications, or modifications of existing ones
(such as the userspace version of OpenvSwitch [11]).
Following this initial result, we began to evaluate
how the techniques used in netmap could be generalized to accelerate other network-related software functions. We then used netmap to implement a fast soft∗
The research leading to these results has received funding
from the European Community’s Seventh Framework Programme (FP7/2007-2013) under grant agreement n.287581
- OPENLAB.
∗
ware switch called VALE [12]; enabled a seamless connection of physical devices and host stack to a VALE
switch; extended the switch to act as a generic network
dataplane [5]; and managed to reach bare metal speed
with virtual machines [13] emulating ordinary NICs.
In parallel with our work, a large number of people
have started to use netmap in research and production,
often providing useful feedback on possible new functionalities.
Today, after a couple of large rewrites of its internals, netmap, VALE and related tools have become extremely powerful and simple to use, allowing users to
concentrate on optimizing applications rather than having to focus on the low level details of packet I/O.
The goal of this paper is to present the current state
of netmap and VALE, discuss the design decisions we
made, and present their performance.
2.
BACKGROUND
The cost of I/O processing, be it for network or storage, have a large per-transaction component, and a
comparatively small per-bit one. Systems and protocols thus try to amortize the former over sufficiently
large amounts of data. The original packet sizes (641518 bytes) chosen for ethernet networks were however
chosen on different criteria. The lower bound was set
to be large enough to allow collision detection on sufficiently long distances in presence of repeaters, but small
enough to avoid too much overhead when sending short
messages. The upper bound was chosen, somewhat arbitrarily, to avoid individual users monopolizing the link
for too long intervals of time.
When moving from 10 Mbit/s to higher link speeds,
the minimum packet size was kept unchanged, mostly
for backward compatibility with existing software. Unfortunately this has stretched the maximum packet
rates by three orders of magnitude, resulting in incredibly tight time budgets to process a packet on 10 Gbit/s
links. Considering the framing overhead, these can
carry up to 14.88 Mpps (million packets per second),
or one every 67.2 μs.
55