Code Monkey home page Code Monkey logo

netpass / netflow-dpdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from triplekill/netflow-dpdk

0.0 2.0 0.0 196 KB

Netflow is a key component for network traffic monitoring. As high speed technologies such as 10 Gbps or 40 Gbps links are common in a backbone network, it is impossible to monitor traffic via conventional software like nProbe. DPDK is next solution for monitoring high speed network with commodity hardware.

Makefile 4.05% C 95.95%

netflow-dpdk's Introduction

= Changelog =

= DPDK Basic =
Before using DPDK, you need to load DPDK kernel modules (uio, igb_uio).
Commands:
 modprobe uio
 insmod ${DPDK}/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko

After load uio, igb_uio, unbind network device driver from ixgbe to igb_uio.
commands(if you want to unbind interface card p2p1):
python ${DPDK}/tools/dpdk_nic_bind.py --bind=igb_uio p2p1

= Build =
export RTE_SDK=<DPDK SDK path>
export RTE_TARGET=x86_64-native-linuxapp-gcc

make

To use multiqueues, configure different rth_eth_conf.
File: netflow-init.h

In 1/10G Ethernet(ixgbe), rss_hf = ETH_RSS_IPV4,
In 40G Ethernet(i40e), rss_hf = ETH_RSS_NONF_IPV4_UDP | ETH_RSS_NONF_IPV4_TCP, 

code:
static const struct rte_eth_conf port_conf = {
    .rxmode = {
        .mq_mode        = ETH_MQ_RX_RSS,
        .split_hdr_size = 0,
        .header_split   = 0, /**< Header Split disabled */
        .hw_ip_checksum = 0, /**< IP checksum offload disabled */
        .hw_vlan_filter = 0, /**< VLAN filtering disabled */
        .jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
        .hw_strip_crc   = 0, /**< CRC stripped by hardware */
    },
    .rx_adv_conf = {
        .rss_conf = {
            .rss_key = NULL,
            .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6,              /* 1/10G RSS offload features */
            //.rss_hf   = ETH_RSS_NONF_IPV4_UDP |
            //               ETH_RSS_NONF_IPV4_TCP,              /* 40G RSS offload features */
        },
    },
    .txmode = {
        .mq_mode = ETH_MQ_TX_NONE,
    },
};

 
= Run =

To run, command line interpreter, run 2 threads
ex) 2 lcore
./build/dprobe -c 0x3 -n 2 -- -p 0x1 -H 127.0.0.1 -P 2055 -q 2

-H : Netflow Collector IP
-P : Netflow Collector Port Number
-q : Number of Receive queues

./build/dprobe -c 0x15 -n 4 -- -m "2:0.0,4:0.1" -q 2
desc: lcore(2) processes port(0) queue(0)
      lcore(4) processes port(0) queue(1)

= Reference =
* DPDK build : http://sunshout.tistory.com/1556

netflow-dpdk's People

Contributors

choonho avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.