009.CentOS 6.7 Installation Run Netmap

Source: Internet
Author: User

I. Netmap Introduction:

1.netmap is a high-performance framework for sending and receiving raw packets, developed by people such as Luigi Rizzo, which contains kernel modules and user-State library functions. The goal is to achieve high-performance delivery of the data packets between the user state and the NIC without modifying the existing operating system software and requiring no special hardware support. (Copy of!) )

2.netmap directly takes over the network card via its own network card, requesting a fixed memory pool to accept packets coming from the NIC and packets that need to be sent to the network card.

3.netmap currently supports only a few network card drivers, the official network is introduced by the Intel Ixgbe (10G), IXL (10/40g), E1000/E1000E/IGB (1G), Realtek 8169 (1G) and Nvidia (1G).

two. Installation Instructions :

1. Use Ubuntu to install NETMAP, only need kernel source code, do not need to compile kernel. And the CentOS need to compile and use the new kernel (if there is no way to compile the kernel, I hope to correct!) )。

The supported network card drivers on 2.netmap are limited, so this experiment uses virtual machine (VMware) to operate e1000 network card.

3. All operations are under the root authority, no control of those permissions problems!

Three. Install the new kernel

The CentOS upgrade kernel is a lot of tutorials online, but for Netmap, the right Linux kernel source code needs to be selected. This installation uses the LINUX-4.1.14.TAR.XZ Linux kernel (compiled once with the 3.10.94 version of the kernel and cannot run Netmap. ) Linux kernel: https://www.kernel.org/

The kernel upgrade tutorial referenced in this experiment: http://www.linuxidc.com/Linux/2014-01/95511.htm

1.1 Download the new kernel and unzip it:

[Email protected] ~]# cd/usr/local/src[[email protected] src]# wget https://cdn.kernel.org/pub/linux/kernel/v4.x/ Linux-4.1.14.tar.xz[[email protected] src]# tar-jxvf linux-4.1.14.tar.xz [[email protected] src]# MV linux-4.1.14/usr/s Rc/[[email protected] src]# cd/usr/src/

1.2 Updating the current system:

[email protected] src]# yum update[[email protected] src]# Yum upgrade

1.3 Install the necessary software:

[[email protected] src]# yum Groupinstall "Development tools" # All the tools you need to install the build in a breath [[email protected] src]# Yum install NCurse S-devel            #必须这样才能让 make *config this command executes correctly. [[email protected] src]# Yum install qt-devel                 #如果你没有 X Environment, this one can be used without [[email protected] src]# Yum install Hmaccalc zlib-de Vel binutils-devel elfutils-libelf-devel #创建 CentOS-6 cores are required

2.1 View the kernel of the current system:

[Email protected] src]# uname-r2.6.32-573.el6.i686

2.2 Copy the current system's configuration file to the current directory

[Email protected] src]# CD Linux-4.1.14/[[email protected] linux-4.1.14]# cp/boot/config-2.6.32-573.el6.i686. config

2.3 Use the old kernel configuration and automatically accept the default settings for each new option

[[email protected] linux-4.1.14]# sh-c ' yes ' | Make Oldconfig '

make oldconfigwill read the current directory the .config file, in .config The option that is not found in the file prompts the user to fill in and then backs up .config file is .config.old , and generate a new .config file

3. Compiling

[Email protected] linux-4.1.14]# make-j4 bzimage              #生成内核文件, about more than 10 minutes [email protected] linux-4.1.14]# Make-j4 Modules              #编译模块, about half an hour [[email protected] linux-4.1.14]# make-j4 modules_install      #编译安装模块, relatively fast

To be compiled strictly in this order, cannot be executed together.

-jThe following number is the number of threads, used to speed up the compilation speed, the general experience is, how much g memory, just fill that number, for example, there is 8G of memory, then yes -j8 .

4. Installation

[[email protected] linux-4.1.14]# make install

If there is a ERROR: modinfo: could not find module xxx , if the quantity is small, can be ignored.

5. Modify the Grub boot order to have the newly installed kernel as the default kernel

[Email protected] linux-4.1.14]# vim/boot/grub/grub.conf

Change the Default=1 configuration line to default=0 (count the location of the newly installed kernel, start at 0, then set the default to that number, generally the newly installed kernel is in the first position, so set default=0 . )

6. Turn off the machine

Four. Modify the virtual CentOS network card type

Locate the virtual machine storage path, locate the. vmx suffix configuration file (I use the VMware virtual machine), open with the Edit tool, add or modify the following configuration (location doesn't matter):

Ethernet0.virtualdev = "e1000"

Note: The eth0 NIC configuration is changed

Five. Using Netmap to send and receive packets

1. Turn on the virtual machine to view the current kernel version:

[Email protected] src]# uname-r4.1.14

2. Check the current network card type:

[Email protected] ~]# lsmod |grep e1000e1000                 118376  

3. Download Netmap

[[email protected] ~]# git clone https://github.com/luigirizzo/netmap.git

NETMAP Official website: http://info.iet.unipi.it/~luigi/netmap/

Netmap's Githab URL: https://github.com/luigirizzo/netmap

Netmap Manual: MAN/ROOT/NETMAP/SHARE/MAN/MAN4/NETMAP.4

4. Compile netmap, generate NIC driver and test program

Mackfile in the "CFLAGS + =-werror-wall-wunused-function" configuration line of the-werror parameters deleted, or generate test program will error, save exit!

[Email protected] build-apps]# CD. [email protected] linux]# make Ksrc=/usr/src/linux-4.1.14/apps

Without an error, the executable file of the generated test receive package is under the Build-apps directory.

5. Replace the NIC driver (written in a small script, easy to replace each time)

[Email protected] linux]# Cd[[email protected] ~]# cat Mount_netmap.sh#!/bin/bashrmmod e1000insmod/root/netmap/linux/ Netmap.koinsmod/root/netmap/linux/e1000/e1000.kolsmod |grep e1000

6. Run the test program

[[email protected] ~]# CD netmap/linux/build-apps/[[email protected] build-apps]#./pkt-gen-i eth0-f tx843.803242 main [1930] interface is eth0843.806747 main [2050] running on 1 CPUs (with 2) 843.808433 Extract_ip_range [36 7] range is 10.0.0.1:0 to 10.0.0.1:0843.808493 Extract_ip_range [367] range are 10.1.0.1:0 to 10.1.0.1:0843.813622 main [21 Mapped 334980KB at 0xa3080000sending on netmap:eth0:1 queues, 1 threads and 1 cpus.10.0.0.1-10.1.0.1 (00:00:00: 00:00:00-FF:FF:FF:FF:FF:FF) 843.813828 main [2233] sending packets every 0.000000000 s843.813851 main [2235] Wai T 2 secs for PHY reset845.814327 main [2237] ready ... 845.816526 Sender_body [1211] Start, FD 3 main_fd 3846.816691 main_thread [1720] 69.345 Kpps (69.424 kpkts 33.324 Mbps in 1001145 usec) 14.98 avg_batch 0 min_space847.268327 sender_body [1293] Drop copy847.817915 main_thread [1720] 69.176 Kpps (69.261 kpkts 33.245 Mbps in 1001229 usec) 14.98 avg_batch 99999 min_space848.819100 main_thread [1720] 65.934 Kpps (66.012 kpkts 31.686 Mbps in 1001183 usec) 14.99 Avg_batch 99999 min_space849.820296 main_thread [1720] 67.2 Kpps (67.337 kpkts 32.322 Mbps in 1001192 usec) 14.99 Avg_batch 99999 min_space850.821500 main_thread [1720] 67.220 Kpp S (67.301 kpkts 32.304 Mbps in 1001207 usec) 14.98 avg_batch 99999 min_space851.822731 main_thread [1720] 68.520 Kpps (68. 602 kpkts 32.929 Mbps in 1001202 usec) 14.99 Avg_batch 99999 min_space852.823912 main_thread [1720] 65.321 Kpps (65.400 Kp KTS 31.392 Mbps in 1001217 usec) 14.99 Avg_batch 99999 min_space853.825202 main_thread [1720] 61.373 Kpps (61.452 kpkts 29 .497 Mbps in 1001291 usec) 14.99 Avg_batch 99999 min_space^c854.321161 sigint_h [404] received control-c on thread 0XB77A2 b30854.321204 Main_thread [1720] 60.650 Kpps (30.082 kpkts 14.439 Mbps in 495996 usec) 14.98 avg_batch 99999 min_space854. 321370 sender_body [1326] flush Tail 6 head 6 on thread 0xa307fb70854.321472 sender_body [1334] pending TX tail 6 Head 6 O N Ring 0854.321849 SendeR_body [1334] pending TX tail 6 head 6 on ring 0855.322625 main_thread [1720] 15.000 pps (15.000 pkts 7.200 Kbps in 100140 4 usec) 15.00 avg_batch 99999 min_spacesent 564886 packets 33893160 bytes 37695 Events bytes each in 8.50 seconds. speed:66.419 Kpps bandwidth:31.881 Mbps (Raw 44.634 Mbps).  Average batch:14.99 pkts[[email protected] build-apps]#

Six, to this, Netmap installation is complete.

Original address: http://www.cnblogs.com/ruo-yu/p/5083290.html

009.CentOS 6.7 Installation Run Netmap

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.