在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):luigirizzo/netmap开源软件地址(OpenSource Url):https://github.com/luigirizzo/netmap开源编程语言(OpenSource Language):C 73.5%开源软件介绍(OpenSource Introduction):Netmap: a framework for fast packet I/OIntroductionNetmap is a an framework for very fast packet I/O from userspace. VALE is an equally fast in-kernel L2 software switch using the netmap API. Both are implemented as a single kernel module for FreeBSD and Linux. Netmap/VALE can handle tens of millions of packets per second, matching the speed of 10G and 40G ports even with minimum sized frames. To learn about netmap, you can use the following resources:
This repository contains source code (BSD-Copyright) for FreeBSD, Linux and Windows. Netmap, VALE and related applications are already included in FreeBSD since version 10.x. FreeBSD users should use the code included in the FreeBSD src tree rather than the one in this repository, although the two codebases are mostly aligned. Why should I use netmap?Netmap is mostly useful for userspace applications that must deal with raw packets: traffic generators, sinks, monitors, loggers, software switches and routers, generic middleboxes, interconnection of virtual machines. The More resources are hosted on other repositories. For example https://github.com/luigirizzo/netmap-libpcap contains a netmap-enabled version of libpcap (which is also included in FreeBSD distribution) so you can run any libpcap client on top of netmap at much higher speeds than using bpf. The https://github.com/luigirizzo/netmap-ipfw repository contains a userspace version of ipfw and dummynet which can handle several million packets per second in a single thread QEMU has native netmap support, so it can interconnect VMs at high speed through netmap ports (e.g., using VALE ports or netmap pipes). For maximum performance, it is also possible to pass-through any netmap port into a QEMU VM, as described here. Also the FreeBSD bhyve hypervisor has native support for netmap. Netmap alone does not accelerate your TCP. For that you need to implement your own tcp/ip stack probably using some of the techniques indicated below to reduce the processing costs. Architecturenetmap uses a number of techniques to establish a fast and efficient path between applications and the network. In order of importance:
Despite the name, memory mapping is NOT the key feature for netmap's speed; systems that do not apply all these techniques do not achieve the same speed and efficiency. Netmap clients use a select()-able file descriptor to synchronize with the network card/software switch, and exchange multiple packets per system call through device-independent memory mapped buffers and descriptors. Device drivers are completely in the kernel, and the system does not rely on IOMMU or other special mechanisms. Installation instructionsA single kernel module implements the core Netmap functions, including the VALE switch and access to physical NICS using unmodified device drivers (at the price of much lower performance than netmap-aware drivers). Netmap-aware device drivers are needed to use netmap at high speed on ethernet ports. To date, we have support for Intel ixgbe (10G), ixl (10/40G), e1000/e1000e/igb (1G), Realtek 8169 (1G) and Nvidia (1G). FreeBSD has also native netmap support in the Chelsio 10/40G cards. FreeBSDFreeBSD already includes netmap kernel support by
default since version 11.
If your kernel configuration does not include netmap, you can enable it
by adding a FreeBSD users will find the netmap example applications
in LinuxThe Make sure you have kernel headers matching your installed kernel. The sources for e1000e, igb, ixgbe and i40e will be downloaded from the Intel e1000 project on sourceforce. If you need the netmap enabled drivers for e1000, veth, forcedeth, virtio-net or r8169 you will also need the full kernel sources. Linux users can find the netmap example applications in the Step 1Configure netmap. To compile Netmap/VALE and the Intel drivers above:
(This will also download the Intel driver sources from sourceforce). To compile only Netmap/VALE (using unmodified drivers):
If you need the full kernel sources and you have installed them in /a/b/c/linux-A.B.C/, then you should do
You can omit --kernel-dir if your kernel sources are in a standard place. If you use distribution packages, full sources and headers may be in different places contain headers (e.g., on debian systems). Use
Step 2Build kernel modules and sample applications:
Step 3Install the new modules and the applications:
To have the new netmap-enabled driver modules alongside the original
ones, you may want to add WindowsNetmap has been ported to Windows in summer 2015 by Alessio Faina as part of his Master thesis. Please look here for details. ApplicationsThe directory
For libpcap and other applications look at the extra/ directory. Testing
(replace ix0 with the name of the interface or VALE port). This should be able to work at line rate (up to 14.88 Mpps on 10 Gbit/interfaces, even higher on VALE) but note the following Operating SpeedNetmap is able to send packets at very high rates, and for simple packet transmission and reception, speed generally not limited by the CPU but by other factors (link speed, bus or NIC hw limitations). For a physical link, the maximum number of packets per second can be computed with the formula:
where "line_rate" is the nominal link rate (e.g 10 Gbit/s) and pkt_size is the actual packet size including MAC headers and CRC. The following table summarizes some results (in Mpps)
On VALE ports, there is no physical link and the throughput is limited by CPU or memory depending on the packet size. Common problemsBefore reporting slow send or receive speed on a physical interface, check ALL of the following: Cannot set the device in netmap mode:
Sender does not transmit
This may cause inability to transmit, or lost packets for the first few seconds of transmission Receiver does not receive
Lower speed than line rate
Host rings do not work
Check here for the corresponding Linux command. CreditsNetmap and VALE are projects of the Universita` di Pisa, partially supported by various entities including: Intel Research Berkeley, EU FP7 projects CHANGE and OPENLAB, Netapp/Silicon Valley Community Foundation, ICSI Authors:
Contributors (https://github.com/netmap-unipi/netmap/graphs/contributors):
ReferencesThere are a few academic papers describing netmap, VALE and applications. You can find the papers at http://info.iet.unipi.it/~luigi/research.html
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论