Improving Passive Packet Capture: Beyond Device Polling. Luca Deri

Similar documents
Wire-speed Packet Capture and Transmission

Monitoring high-speed networks using ntop. Luca Deri

Improving Passive Packet Capture: Beyond Device Polling

Improving Passive Packet Capture: Beyond Device Polling

Open Source in Network Administration: the ntop Project

ncap: Wire-speed Packet Capture and Transmission

10 Gbit Hardware Packet Filtering Using Commodity Network Adapters. Luca Deri Joseph Gasparakis

The ntop Project: Open Source Network Monitoring

Collecting Packet Traces at High Speed

Open Source VoIP Traffic Monitoring

High-Speed Network Traffic Monitoring Using ntopng. Luca

High-speed Network and Service Monitoring. Luca Deri

High-Density Network Flow Monitoring

Exploiting Commodity Multi-core Systems for Network Traffic Analysis

1. Computer System Structure and Components

vpf_ring: Towards Wire-Speed Network Monitoring Using Virtual Machines

Performance Evaluation of VMXNET3 Virtual Network Device VMware vsphere 4 build

Passively Monitoring Networks at Gigabit Speeds Using Commodity Hardware and Open Source Software

High-Density Network Flow Monitoring

Transparent Optimization of Grid Server Selection with Real-Time Passive Network Measurements. Marcia Zangrilli and Bruce Lowekamp

Packet Capture in 10-Gigabit Ethernet Environments Using Contemporary Commodity Hardware

Comparing and Improving Current Packet Capturing Solutions based on Commodity Hardware

Monitoring Network Traffic using ntopng

D1.2 Network Load Balancing

Improving the Performance of Passive Network Monitoring Applications with Memory Locality Enhancements

Router Architectures

Towards 100 Gbit Flow-Based Network Monitoring. Luca Deri Alfredo Cardigliano

Network Performance Optimisation and Load Balancing. Wulf Thannhaeuser

Sockets vs. RDMA Interface over 10-Gigabit Networks: An In-depth Analysis of the Memory Traffic Bottleneck

Who is Generating all This Traffic?

Intel DPDK Boosts Server Appliance Performance White Paper

High Speed Network Traffic Analysis with Commodity Multi-core Systems

Network packet capture in Linux kernelspace

On Multi Gigabit Packet Capturing With Multi Core Commodity Hardware

RF Monitor and its Uses

Software-based Packet Filtering. Fulvio Risso Politecnico di Torino

Networking Driver Performance and Measurement - e1000 A Case Study

Increasing Data Center Network Visibility with Cisco NetFlow-Lite

Design of an Application Programming Interface for IP Network Monitoring

Open Source VoIP Traffic Monitoring

Operating Systems Design 16. Networking: Sockets

Performance of STAR-System

Lecture 6: Interrupts. CSC 469H1F Fall 2006 Angela Demke Brown

Accelerate In-Line Packet Processing Using Fast Queue

Analyzing and Optimizing the Linux Networking Stack

Gigabit Ethernet Packet Capture. User s Guide

The Performance Analysis of Linux Networking Packet Receiving

Infrastructure for active and passive measurements at 10Gbps and beyond

Performance of Host Identity Protocol on Nokia Internet Tablet

Autonomous NetFlow Probe

The IPTV-Analyzer OpenSourceDays 2012

vpf_ring: Towards Wire-Speed Network Monitoring Using Virtual Machines

Performance of Software Switching

Quality of Service su Linux: Passato Presente e Futuro

Inside ntop: An Open Source Network Monitoring Tool

Networking Virtualization Using FPGAs

HANIC 100G: Hardware accelerator for 100 Gbps network traffic monitoring

Assessing the Performance of Virtualization Technologies for NFV: a Preliminary Benchmarking

OpenFlow with Intel Voravit Tanyingyong, Markus Hidell, Peter Sjödin

Flow-based network accounting with Linux

Monitoring Network Traffic using ntopng

High-Performance Network Traffic Processing Systems Using Commodity Hardware

How To Improve Performance On A Linux Based Router

The Lagopus SDN Software Switch. 3.1 SDN and OpenFlow. 3. Cloud Computing Technology

High-performance vnic framework for hypervisor-based NFV with userspace vswitch Yoshihiro Nakajima, Hitoshi Masutani, Hirokazu Takahashi NTT Labs.

Configuring Memory on the HP Business Desktop dx5150

Knut Omang Ifi/Oracle 19 Oct, 2015

ntopng: Realtime Network Traffic View

Removing The Linux Routing Cache

Fastboot Techniques for x86 Architectures. Marcus Bortel Field Application Engineer QNX Software Systems

- An Essential Building Block for Stable and Reliable Compute Clusters

Computer Systems Structure Input/Output

Network Troubleshooting Using ntopng Luca Deri

How To Monitor And Test An Ethernet Network On A Computer Or Network Card

Have both hardware and software. Want to hide the details from the programmer (user).

Input / Output and I/O Strategies

Chapter 1 Computer System Overview

sflow Why You Should Use It And Like It NANOG 39 February 04-07, 2007

Netfilter Performance Testing

LCMON Network Traffic Analysis

Increasing Data Center Network Visibility with Cisco NetFlow-Lite

I3: Maximizing Packet Capture Performance. Andrew Brown

Computer Organization. and Instruction Execution. August 22

Application Note. Windows 2000/XP TCP Tuning for High Bandwidth Networks. mguard smart mguard PCI mguard blade

Gigabit Ethernet Design

COMP416 Lab (1) Wireshark I. 23 September 2013

How To Test For Performance And Scalability On A Server With A Multi-Core Computer (For A Large Server)

Transcription:

Improving Passive Packet Capture: Beyond Device Polling Luca Deri

Packet Capture: State of the Art Many available passive network monitoring tools are based on libpcap (http://www.tcpdump.org) or winpcap (http:// winpcap.polito.it) Despite libpcap offers the very same programming interface across different OSs, the library performance are very different depending on the platform being used. Some library components (e.g. BPF packet filtering) have been implemented into the kernel for better performance.

Packet Capture: Open Issues Monitoring low speed (100 Mbit) networks is already possible using commodity hardware and tools based on libpcap. Sometimes even at 100 Mbit there is some (severe) packet loss: we have to shift from thinking in term of speed to number of packets/second that can be captured analyzed.

Problem Statement Ability to monitor high speed (1 Gbit and above) networks with common PCs (64 bit/66 Mhz PCI bus) without the need to purchase custom capture cards or measurement boxes. Have spare CPU cycles for traffic analysis.

Libpcap Performance (Polling) Packet Size (Bytes) Speed (Mbit) Speed (Pkt/sec) Linux 2.6.1 with NAPI and standard libpcap FreeBSD 4.8 with Polling 64 90 175 000 2.5% 97.3% 512 710 131 000 1.1% 47.3% 1500 836 70 000 34.3% 56.1% Percentage of captured packets Testbed: Sender: Dual 1.8 GHz Athlon, 3Com 3c59x (100Mbit) Ethernet card Receiver: Pentium III 550 MHz, Intel 100Mbit Ethernet card Traffic Generator: stream.c (DoS)

Polling vs. non Polling 100 75 50 25 0 Input Rate No Polling Device Polling Sidenote. Polling is usually disabled by default in OSs as: Slow polling can have negative effects on packet timestamp precision. Fast polling can take over all/most of the available CPU cycles.

Our Solution: Socket Packet Ring (PF_RING) Application A Application Z mmap() Outgoing Packets Userspace Kernel Read Index Socket (ring) Write Index Socket (ring) PF_RING Network Adapter Incoming Packets

Driver Packet Ring: Features [1/2] The new ring socket is right on top of the netif_rx/ netif_prepare_rx routines: no driver changes are needed. Features like packet sampling and kernel filtering can be efficiently implemented with the ring (otherwise the packet arrives to the kernel/userland then is filtered/sampled). The bucket copy operation is very fast (via memcpy() with no memory handling needed) so even with kernel that does not support device polling, under strong traffic conditions the system is usable.

Driver Packet Ring: Features [2/2] Straight path from the driver to userspace with no kernel overhead (beside the PCI bus). Note that packets are transfer over the PCI bus via DMA and that interrupts arrive only when the packet is already available to the driver. Packets are not queued into kernel network data structures but directly accessible to user-space applications. The mmap() primitive allows userspace applications to access the circular buffer with no overhead due to system calls such as in the case of socket calls.

Driver Packet Ring: Advantages Enable people to capture packets at (almost if not full) wire speed without having to purchase a dedicated card or measuring box. It exploits both polling and interrupt mitigation (when available). Common belief that coding into the kernel (on a vanilla system) is more efficient than in userspace (with PF_RING) is not completely correct. In fact a kernel module is slower than a userland application+pf_ring as packets have to traverse kernel structures until they can talk with the kernel module.

Packet Capture Evaluation [1/2] Packet Size (Bytes) Speed (Mbit) Speed (Pkt/sec) Linux 2.6.1 with NAPI and standard libpcap Linux 2.6.1 with NAPI and mmap() Linux 2.6.1 with NAPI and Ring FreeBSD 4.8 with Polling 64 90 175 000 2.5% 14.9% 75.7% 97.3% 512 710 131 000 1.1% 11.7% 47% 47.3% 1500 836 70 000 34.3% 93.5% 92.9% 56.1% Testbed: Sender: Dual 1.8 GHz Athlon, Intel GE 32-bit Ethernet card Collector: Pentium III 550 MHz, Intel GE 32-bit Ethernet card Traffic Generator: stream.c (DoS)

Packet Capture Evaluation [2/2] Evaluation: Major improvement with respect to Linux with NAPI It can exploit both polling and Linux 2.4.x/2.6.x Open Issues Packet loss: still too many packets are lost on Linux, both in general and also compared to FreeBSD. CPU Usage: on Linux there still an important packet loss although the CPU usage is very low (<< 30% on Linux, ~100% on FreeBSD).

IRQ and CPU Load Doing some measurements with rdtsc it seems that when there is too much work (e.g. high traffic), the Linux kernel wastes a lot of time with interrupts and spinlocks (kernel mutexes). System calls (e.g. poll() used by userland applications to wait for new incoming packets) are too slow. For instance a dummy poll() call takes more than 1 000 CPU cycles (up to ten times as much with high load). Further improving packet capture is not the way to go as the problem is the kernel. It is necessary to change the kernel for implementing predictability, namely for adding the ability to determine task completion with some time constraints. Solution: add realtime-like support on Linux via rtirq patch.

PF_RING and RTIRQ Packet Size (Bytes) Linux 2.4.23 with NAPI, RT_IRQ and Ring (Pkt Capture) 64 550 789 [~202 Mbit] 512 213 548 [~850 Mbit] 1500 81 616 [~970 Mbit] Linux 2.4.23 with NAPI, RT_IRQ and Ring (nprobe) 376 453 [~144 Mbit] 213 548 [~850 Mbit] 81 616 [~970 Mbit] Captured Packets and nprobe Flow Generation (packet/sec) Testbed: Sender: Dual 1.8 GHz Athlon, Intel GE 32-bit Ethernet card Collector: Pentium IV 1.7 GHz, Intel GE 32-bit Ethernet card Traffic Generator: stream.c (DoS)

PF_RING: Performance Product NetFlow Performance Price Cisco Router with MSFC-2 150 000 pkt/sec (on a Cisco 7500) 46 000 $ (MSFC-2 Only) Juniper Router with PM-PIC 250 000 pkt/sec ~30 000 $ (PM-PIC Only) PF_RING (Pentium IV 1.7 Ghz) 376 000 pkt/sec Free

Current Status [1/2] Faster flow generation than every commercial NetFlow probe Available both on Linux 2.4.x and 2.6.x Enhanced libpcap to seamlessly support the ring. Successfully tested several applications on top of the ring in order to validate the code. ntop and nprobe (homegrown NetFlow v5/v9 probe for IPv4/ 6), as well as snort/tcpdump are able to run on top of the ring.

Current Status [2/2] Code freely available on the Internet. PF_RING issues discussed on an ad-hoc mailing list (~40 subscribers). Several problems fixed thanks to the distributed testing (the GPL way). Some companies are using it for real network monitoring of backbones.

PF_RING Spinoffs [1/3] Application A Application Z Read Index mmap() Socket (ring) Outgoing Packets Write Index Socket (ring) PF_RING Userspace Kernel Custom Packet Poller Network Adapter Network Adapter

PF_RING Spinoffs [2/3] Approach Classic PF_RING O. Drain (Cornell) L. Degioanni (Polito) Packet Poller netif_rx/netif_receive_rx On-card poller (National Semiconductor 83820) 1-CPU Polling [Linux Processor Affinity]

PF_RING Spinoffs [3/3] Approach Packet Poller Classic PF_RING 650 K pkt/sec [No Interrupt Mitigation] L. Degioanni (Polito) 1.1 Million pkt/sec [1 CPU @ 100%, 3 CPU @ ~0%] Testbed: Collector: Dual 2.4 GHz Xeon (2 Virtual + 2 Physical CPUs), Intel GE PCI-X OS: Linux 2.6.x with NAPI Packet Size: 60 bytes

Final Questions Are we sure we still need custom hardware for high speed traffic analysis when you can capture over a million packets with no loss? Isn t that this problem has been finally solved for the current network generation? Isn t that we now have a different problem? Namely isn t it time to (finally) develop monitoring applications able to do something really smart with captured packets?

Availability Paper and Documentation: http://luca.ntop.org/ring.pdf Code (GNU GPL2 license): http://sourceforge.net/projects/ntop/