SlideShare a Scribd company logo
1 of 26
Download to read offline
Snabbflow: a scalable IPFIX exporter
A tour of the IPFIX exporter developed at SWITCH
Who we are
Alexander Gall
Network engineer at SWITCH,
Snabb contributor since 2014
alexander.gall@switch.ch
Max Rottenkolber
Works on Snabb since 2014
maximilian@igalia.com
Snabbflow
at SWITCH
Motivation, function,
deployment
Netflow at SWITCH
The concept of a “flow” is the primary mechanism used to analyze network traffic
● 5-tuple <src address, dst address, IP protocol, src port, dst port>
● Aggregates bytes/packets, additional custom fields (TCP flags, AS
numbers…)
● Evolved from Cisco-proprietary to IETF standard IPFIX
● Unsampled (process every packet) or sampled (process 1 in n packets)
In use at SWITCH since mid 1990s. Until a few years ago
● Provided in Hardware by the routers
● Unsampled
Modern routers moved to sampling to cope with high-volume traffic
Sampled vs Unsampled
Sampling approximates real values well for volume-based metrics. Why use
unsampled Netflow?
● Fine-grained analysis of security incidents
● Debugging of network problems for single flows, e.g.
○ TCP handshake
○ DNS transaction
Requires
● Move from router to external appliance for Netflow generation
● Find a scalable and cost-effective solution: Snabbflow
SWITCH Network
● Peak traffic values (aggregate external traffic, ingress + egress)
○ ~180Gbps
○ ~20Mpps
○ ~350k flows per second (>500kfps with aggressive port-scans)
● Aggregate IPFIX export data rate 200-300Mbps
● Average flow rate 200k/s, 1.5TiB flow data per day (~100 bytes/flow)
● Interface types: optical 10G, 100G soon 400G
● Until 2015 Netflow export on (Cisco) routers
● 2015-2020 commercial Netflow exporter using hardware acceleration
● Since 2020 Snabbflow
Per-PoP Exporter Architecture
● Optical taps on external interfaces to copy packets
● “Packet-Broker” to aggregate traffic to 2x100 Gbps links to Snabbflow
exporter
○ Use VLAN tags to identify original router ports
○ “Whitebox” switch
■ EdgeCore Wedge100BF-32x/AS9516-32D
■ Tofino/Tofino2 ASIC
■ P4-programmable
■ Separate project: https://github.com/alexandergall/packet-broker
● Snabbflow on commodity 1RU server
○ AMD Epyc or Intel Xeon, 12-24 cores, ~128GiB RAM for large flow tables
○ 2x100G Mellanox ConnectX-5 NICs
SWITCH
border router
Foreign BR1
8-port splitter
Packet Broker
Snabbflow
Foreign BR2
Foreign BR3
Foreign BR8
adds vlan for each
“color“ so we know
where packets came
from
Vlan
151
Vlan
152
Vlan
153
Vlan
154
Vlan
155 Foreign BRx
Vlan
156
Vlan
165
Vlan
166
Features of
Snabbflow
snabb ipfix probe
Scaling, configuration, monitoring
and their implementation
Built with
- A toolkit for building fast packet processing applications using a
high-level programming language
- Written in Lua (using the amazing LuaJIT compiler)!
- Packet I/O without going through the kernel (kernel-bypass /
userspace networking)
- Open source and independent (not sponsored by any $vendor)
● Simple > Complex
● Small > Large
● Commodity > Proprietary
Recording packet metadata in a flow table
function FlowSet:record_flows(timestamp)
local entry = self.scratch_entry
for i=1,link.nreadable(self.incoming) do
local pkt = link.receive(self.incoming)
self.template:extract(pkt, timestamp, entry)
local lookup_result = self.table:lookup_ptr(entry.key)
if lookup_result == nil then
self.table:add(entry.key, entry.value)
else
self.template:accumulate(lookup_result, entry, pkt)
end
packet.free(pkt)
end
end
Flushing ipfix records
-- Walk through flow set to see if flow records need to be expired.
-- Collect expired records and export them to the collector.
function FlowSet:expire_records(out, now)
local cursor = self.expiry_cursor
…
for i = 1, self.table_tb:take_burst() do
local entry
cursor, entry = self.table:next_entry(cursor, cursor + 1)
…
if entry then
…
self:add_data_record(entry.key, out)
end
end
if self.flush_timer() then self:flush_data_records(out) end
end
High-level overview
100G NIC
(Driver written in
Lua)
Snabb ipfix
probe
tun/tap
(Linux kernel
network stack)
ipfix
collector
Scaling via hardware RSS
100G NIC
(Driver written in
Lua)
Snabb
ipfix
probe
RSS forwards distinct sets of
flows to distinct Snabbflow
processes
Horizontal scaling!
Circle = CPU core
Scaling via software RSS
Snabb
ipfix
probe
IP
template
DNS/HTTP
template
Software RSS forwards distinct sets of flows
to distinct exporter processes extracting
different sets of metadata.
Isolate workloads! (Complex packet
inspection does not bog down basic
metadata export)
Circle = CPU core
“Apps” and multi-processing
ConnectX
Driver
App
ARP App
input
output
Snabb programs are organized in “apps”
(independent packet processing
components)
Communicate with each other via “links”:
p = link.receive(input)
link.transmit(output, p)
“Apps” and multi-processing (lib.interlink)
cpu core 1 cpu core 1
ConnectX
Driver
App
ARP App
Interlink
Transmitter
App
Interlink
Receiver
App
Interlink
Packets can be shared with low
overhead across CPU core boundaries
using “interlinks”.
Link interface remains orthogonal:
p = link.receive(input)
link.transmit(output, p)
lib.ptree
Control plane (manager)
Data plane (worker)
- Can query and update data-plane configuration
- Knows about data-plane state
- No particular latency requirements
- Manages multiple data-plane workers
(on dedicated CPU cores)
- Soft real-time! No messing around!
- Receives configuration updates from manager
- Writes state counters to shared memory
Data plane (worker)
Data plane (worker)
lib.yang
Application configuration and state are described in a YANG schema.
$ snabb config set my-process / < ipfix.conf
$ snabb config get-state my-process 
/snabbflow-state/exporter[name=ip]
packets-dropped 0;
packets-ignored 129326;
packets-received 499996;
template {
id 1512;
flow-export-packets 115;
flows-exported 1318;
packets-processed 12034;
…
snabb-snabbflow-v1.yang
module snabb-snabbflow-v1 {
…
container snabbflow-config {
description
"Configuration for the Snabbflow IPFIX exporter.";
list interface {
key device;
unique "name vlan-tag";
description
"Interfaces serving as IPFIX Observation Points.";
leaf device {
type pci-address;
description
"PCI address of the network device.";
}
…
- Schema defines both valid configuration
and state trees
- YANG is expressive: control-plane can
effectively reject invalid data-plane
configurations
- Snabb programs translate valid
configurations to app and link networks
running in data-plane
Flight recorder
- Minimal overhead: always on! (if you want it)
- Stores useful data
- JIT trace info
- Trace profiles (sampled)
- High-frequency event log (sampled)
- Can be analyzed while running or post mortem
- tar cf blackbox.tar /var/run/snabb; scp blackbox.tar …
Where does my program spend
its time?
Does the JIT have issues
generating efficient code?
Includes full IR / assembly
dump for each compiled trace!
Latency histograms derived
from event log
Here: ipfix app takes ~35us
to process a batch of
packets.
Useful for debugging tail
latencies.
Can add arbitrary
application-specific,
user-defined events.
If you write a Snabb program today
You can reuse all of these components and more!
Thanks for your
attention!
Questions?
GitHub: snabbco/snabb
Snabbflow:
alexander.gall@switch.ch
Commercial support for Snabb:
maximilian@igalia.com

More Related Content

What's hot

The Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOsThe Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOsDivye Kapoor
 
Cha1 introduction
Cha1 introductionCha1 introduction
Cha1 introductionEns Kouba
 
Linux Ethernet device driver
Linux Ethernet device driverLinux Ethernet device driver
Linux Ethernet device driver艾鍗科技
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Ray Jenkins
 
QoS Cheatsheet by packetlife.net
QoS Cheatsheet by packetlife.netQoS Cheatsheet by packetlife.net
QoS Cheatsheet by packetlife.netFebrian ‎
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Andriy Berestovskyy
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux KernelKernel TLV
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchTe-Yen Liu
 
Excitingly simple multi-path OpenStack networking: LAG-less, L2-less, yet ful...
Excitingly simple multi-path OpenStack networking: LAG-less, L2-less, yet ful...Excitingly simple multi-path OpenStack networking: LAG-less, L2-less, yet ful...
Excitingly simple multi-path OpenStack networking: LAG-less, L2-less, yet ful...LINE Corporation
 
nftables - the evolution of Linux Firewall
nftables - the evolution of Linux Firewallnftables - the evolution of Linux Firewall
nftables - the evolution of Linux FirewallMarian Marinov
 
Flexible Data Centre Fabric - FabricPath/TRILL, OTV, LISP and VXLAN
Flexible Data Centre Fabric - FabricPath/TRILL, OTV, LISP and VXLANFlexible Data Centre Fabric - FabricPath/TRILL, OTV, LISP and VXLAN
Flexible Data Centre Fabric - FabricPath/TRILL, OTV, LISP and VXLANCisco Canada
 
IPMI is dead, Long live Redfish
IPMI is dead, Long live RedfishIPMI is dead, Long live Redfish
IPMI is dead, Long live RedfishBruno Cornec
 

What's hot (20)

The Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOsThe Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOs
 
IPv6 address
IPv6 addressIPv6 address
IPv6 address
 
MPLS & BASIC LDP
MPLS & BASIC LDPMPLS & BASIC LDP
MPLS & BASIC LDP
 
OVS v OVS-DPDK
OVS v OVS-DPDKOVS v OVS-DPDK
OVS v OVS-DPDK
 
Cha1 introduction
Cha1 introductionCha1 introduction
Cha1 introduction
 
Linux Ethernet device driver
Linux Ethernet device driverLinux Ethernet device driver
Linux Ethernet device driver
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
 
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratchInterpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
 
QoS Cheatsheet by packetlife.net
QoS Cheatsheet by packetlife.netQoS Cheatsheet by packetlife.net
QoS Cheatsheet by packetlife.net
 
Ospf routing protocol
Ospf routing protocolOspf routing protocol
Ospf routing protocol
 
eBPF maps 101
eBPF maps 101eBPF maps 101
eBPF maps 101
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux Kernel
 
eBPF Workshop
eBPF WorkshopeBPF Workshop
eBPF Workshop
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
 
Excitingly simple multi-path OpenStack networking: LAG-less, L2-less, yet ful...
Excitingly simple multi-path OpenStack networking: LAG-less, L2-less, yet ful...Excitingly simple multi-path OpenStack networking: LAG-less, L2-less, yet ful...
Excitingly simple multi-path OpenStack networking: LAG-less, L2-less, yet ful...
 
nftables - the evolution of Linux Firewall
nftables - the evolution of Linux Firewallnftables - the evolution of Linux Firewall
nftables - the evolution of Linux Firewall
 
Flexible Data Centre Fabric - FabricPath/TRILL, OTV, LISP and VXLAN
Flexible Data Centre Fabric - FabricPath/TRILL, OTV, LISP and VXLANFlexible Data Centre Fabric - FabricPath/TRILL, OTV, LISP and VXLAN
Flexible Data Centre Fabric - FabricPath/TRILL, OTV, LISP and VXLAN
 
IPMI is dead, Long live Redfish
IPMI is dead, Long live RedfishIPMI is dead, Long live Redfish
IPMI is dead, Long live Redfish
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
 

Similar to Snabbflow: A Scalable IPFIX exporter

FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)Kirill Tsym
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingKernel TLV
 
D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)
D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)
D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)Igalia
 
DPDK summit 2015: It's kind of fun to do the impossible with DPDK
DPDK summit 2015: It's kind of fun  to do the impossible with DPDKDPDK summit 2015: It's kind of fun  to do the impossible with DPDK
DPDK summit 2015: It's kind of fun to do the impossible with DPDKLagopus SDN/OpenFlow switch
 
DPDK Summit 2015 - NTT - Yoshihiro Nakajima
DPDK Summit 2015 - NTT - Yoshihiro NakajimaDPDK Summit 2015 - NTT - Yoshihiro Nakajima
DPDK Summit 2015 - NTT - Yoshihiro NakajimaJim St. Leger
 
Stacks and Layers: Integrating P4, C, OVS and OpenStack
Stacks and Layers: Integrating P4, C, OVS and OpenStackStacks and Layers: Integrating P4, C, OVS and OpenStack
Stacks and Layers: Integrating P4, C, OVS and OpenStackOpen-NFP
 
FlowER Erlang Openflow Controller
FlowER Erlang Openflow ControllerFlowER Erlang Openflow Controller
FlowER Erlang Openflow ControllerHolger Winkelmann
 
Install FD.IO VPP On Intel(r) Architecture & Test with Trex*
Install FD.IO VPP On Intel(r) Architecture & Test with Trex*Install FD.IO VPP On Intel(r) Architecture & Test with Trex*
Install FD.IO VPP On Intel(r) Architecture & Test with Trex*Michelle Holley
 
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitchDPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitchJim St. Leger
 
Practical virtual network functions with Snabb (SDN Barcelona VI)
Practical virtual network functions with Snabb (SDN Barcelona VI)Practical virtual network functions with Snabb (SDN Barcelona VI)
Practical virtual network functions with Snabb (SDN Barcelona VI)Igalia
 
Snabb, a toolkit for building user-space network functions (ES.NOG 20)
Snabb, a toolkit for building user-space network functions (ES.NOG 20)Snabb, a toolkit for building user-space network functions (ES.NOG 20)
Snabb, a toolkit for building user-space network functions (ES.NOG 20)Igalia
 
Practical virtual network functions with Snabb (8th SDN Workshop)
Practical virtual network functions with Snabb (8th SDN Workshop)Practical virtual network functions with Snabb (8th SDN Workshop)
Practical virtual network functions with Snabb (8th SDN Workshop)Igalia
 
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)Yuuki Takano
 
Lagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
Lagopus presentation on 14th Annual ON*VECTOR International Photonics WorkshopLagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
Lagopus presentation on 14th Annual ON*VECTOR International Photonics WorkshopLagopus SDN/OpenFlow switch
 
Introduction to DPDK
Introduction to DPDKIntroduction to DPDK
Introduction to DPDKKernel TLV
 
Hari Krishna Vetsa Resume
Hari Krishna Vetsa ResumeHari Krishna Vetsa Resume
Hari Krishna Vetsa ResumeHari Krishna
 
Ocpeu14
Ocpeu14Ocpeu14
Ocpeu14KALRAY
 
Analise NetFlow in Real Time
Analise NetFlow in Real TimeAnalise NetFlow in Real Time
Analise NetFlow in Real TimePiotr Perzyna
 
Pristine glif 2015
Pristine glif 2015Pristine glif 2015
Pristine glif 2015ICT PRISTINE
 

Similar to Snabbflow: A Scalable IPFIX exporter (20)

FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet Processing
 
D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)
D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)
D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)
 
DPDK summit 2015: It's kind of fun to do the impossible with DPDK
DPDK summit 2015: It's kind of fun  to do the impossible with DPDKDPDK summit 2015: It's kind of fun  to do the impossible with DPDK
DPDK summit 2015: It's kind of fun to do the impossible with DPDK
 
DPDK Summit 2015 - NTT - Yoshihiro Nakajima
DPDK Summit 2015 - NTT - Yoshihiro NakajimaDPDK Summit 2015 - NTT - Yoshihiro Nakajima
DPDK Summit 2015 - NTT - Yoshihiro Nakajima
 
Stacks and Layers: Integrating P4, C, OVS and OpenStack
Stacks and Layers: Integrating P4, C, OVS and OpenStackStacks and Layers: Integrating P4, C, OVS and OpenStack
Stacks and Layers: Integrating P4, C, OVS and OpenStack
 
FlowER Erlang Openflow Controller
FlowER Erlang Openflow ControllerFlowER Erlang Openflow Controller
FlowER Erlang Openflow Controller
 
Install FD.IO VPP On Intel(r) Architecture & Test with Trex*
Install FD.IO VPP On Intel(r) Architecture & Test with Trex*Install FD.IO VPP On Intel(r) Architecture & Test with Trex*
Install FD.IO VPP On Intel(r) Architecture & Test with Trex*
 
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitchDPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
 
Practical virtual network functions with Snabb (SDN Barcelona VI)
Practical virtual network functions with Snabb (SDN Barcelona VI)Practical virtual network functions with Snabb (SDN Barcelona VI)
Practical virtual network functions with Snabb (SDN Barcelona VI)
 
Snabb, a toolkit for building user-space network functions (ES.NOG 20)
Snabb, a toolkit for building user-space network functions (ES.NOG 20)Snabb, a toolkit for building user-space network functions (ES.NOG 20)
Snabb, a toolkit for building user-space network functions (ES.NOG 20)
 
Practical virtual network functions with Snabb (8th SDN Workshop)
Practical virtual network functions with Snabb (8th SDN Workshop)Practical virtual network functions with Snabb (8th SDN Workshop)
Practical virtual network functions with Snabb (8th SDN Workshop)
 
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)
 
Lagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
Lagopus presentation on 14th Annual ON*VECTOR International Photonics WorkshopLagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
Lagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
 
Introduction to DPDK
Introduction to DPDKIntroduction to DPDK
Introduction to DPDK
 
OpenFlow Tutorial
OpenFlow TutorialOpenFlow Tutorial
OpenFlow Tutorial
 
Hari Krishna Vetsa Resume
Hari Krishna Vetsa ResumeHari Krishna Vetsa Resume
Hari Krishna Vetsa Resume
 
Ocpeu14
Ocpeu14Ocpeu14
Ocpeu14
 
Analise NetFlow in Real Time
Analise NetFlow in Real TimeAnalise NetFlow in Real Time
Analise NetFlow in Real Time
 
Pristine glif 2015
Pristine glif 2015Pristine glif 2015
Pristine glif 2015
 

More from Igalia

Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JITIgalia
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!Igalia
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerIgalia
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in MesaIgalia
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIgalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera LinuxIgalia
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVMIgalia
 
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsIgalia
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesIgalia
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSIgalia
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webIgalia
 
Replacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersReplacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersIgalia
 
I'm not an AMD expert, but...
I'm not an AMD expert, but...I'm not an AMD expert, but...
I'm not an AMD expert, but...Igalia
 
Status of Vulkan on Raspberry
Status of Vulkan on RaspberryStatus of Vulkan on Raspberry
Status of Vulkan on RaspberryIgalia
 
Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...Igalia
 
Async page flip in DRM atomic API
Async page flip in DRM  atomic APIAsync page flip in DRM  atomic API
Async page flip in DRM atomic APIIgalia
 
From the proposal to ECMAScript – Step by Step
From the proposal to ECMAScript – Step by StepFrom the proposal to ECMAScript – Step by Step
From the proposal to ECMAScript – Step by StepIgalia
 
Migrating Babel from CommonJS to ESM
Migrating Babel     from CommonJS to ESMMigrating Babel     from CommonJS to ESM
Migrating Babel from CommonJS to ESMIgalia
 
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...Igalia
 
Freedreno on Android – XDC 2023
Freedreno on Android          – XDC 2023Freedreno on Android          – XDC 2023
Freedreno on Android – XDC 2023Igalia
 

More from Igalia (20)

Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JIT
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamer
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera Linux
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVM
 
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devices
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the web
 
Replacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersReplacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shaders
 
I'm not an AMD expert, but...
I'm not an AMD expert, but...I'm not an AMD expert, but...
I'm not an AMD expert, but...
 
Status of Vulkan on Raspberry
Status of Vulkan on RaspberryStatus of Vulkan on Raspberry
Status of Vulkan on Raspberry
 
Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...
 
Async page flip in DRM atomic API
Async page flip in DRM  atomic APIAsync page flip in DRM  atomic API
Async page flip in DRM atomic API
 
From the proposal to ECMAScript – Step by Step
From the proposal to ECMAScript – Step by StepFrom the proposal to ECMAScript – Step by Step
From the proposal to ECMAScript – Step by Step
 
Migrating Babel from CommonJS to ESM
Migrating Babel     from CommonJS to ESMMigrating Babel     from CommonJS to ESM
Migrating Babel from CommonJS to ESM
 
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
 
Freedreno on Android – XDC 2023
Freedreno on Android          – XDC 2023Freedreno on Android          – XDC 2023
Freedreno on Android – XDC 2023
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

Snabbflow: A Scalable IPFIX exporter

  • 1. Snabbflow: a scalable IPFIX exporter A tour of the IPFIX exporter developed at SWITCH
  • 2. Who we are Alexander Gall Network engineer at SWITCH, Snabb contributor since 2014 alexander.gall@switch.ch Max Rottenkolber Works on Snabb since 2014 maximilian@igalia.com
  • 4. Netflow at SWITCH The concept of a “flow” is the primary mechanism used to analyze network traffic ● 5-tuple <src address, dst address, IP protocol, src port, dst port> ● Aggregates bytes/packets, additional custom fields (TCP flags, AS numbers…) ● Evolved from Cisco-proprietary to IETF standard IPFIX ● Unsampled (process every packet) or sampled (process 1 in n packets) In use at SWITCH since mid 1990s. Until a few years ago ● Provided in Hardware by the routers ● Unsampled Modern routers moved to sampling to cope with high-volume traffic
  • 5. Sampled vs Unsampled Sampling approximates real values well for volume-based metrics. Why use unsampled Netflow? ● Fine-grained analysis of security incidents ● Debugging of network problems for single flows, e.g. ○ TCP handshake ○ DNS transaction Requires ● Move from router to external appliance for Netflow generation ● Find a scalable and cost-effective solution: Snabbflow
  • 6. SWITCH Network ● Peak traffic values (aggregate external traffic, ingress + egress) ○ ~180Gbps ○ ~20Mpps ○ ~350k flows per second (>500kfps with aggressive port-scans) ● Aggregate IPFIX export data rate 200-300Mbps ● Average flow rate 200k/s, 1.5TiB flow data per day (~100 bytes/flow) ● Interface types: optical 10G, 100G soon 400G ● Until 2015 Netflow export on (Cisco) routers ● 2015-2020 commercial Netflow exporter using hardware acceleration ● Since 2020 Snabbflow
  • 7. Per-PoP Exporter Architecture ● Optical taps on external interfaces to copy packets ● “Packet-Broker” to aggregate traffic to 2x100 Gbps links to Snabbflow exporter ○ Use VLAN tags to identify original router ports ○ “Whitebox” switch ■ EdgeCore Wedge100BF-32x/AS9516-32D ■ Tofino/Tofino2 ASIC ■ P4-programmable ■ Separate project: https://github.com/alexandergall/packet-broker ● Snabbflow on commodity 1RU server ○ AMD Epyc or Intel Xeon, 12-24 cores, ~128GiB RAM for large flow tables ○ 2x100G Mellanox ConnectX-5 NICs
  • 8. SWITCH border router Foreign BR1 8-port splitter Packet Broker Snabbflow Foreign BR2 Foreign BR3 Foreign BR8 adds vlan for each “color“ so we know where packets came from Vlan 151 Vlan 152 Vlan 153 Vlan 154 Vlan 155 Foreign BRx Vlan 156 Vlan 165 Vlan 166
  • 9. Features of Snabbflow snabb ipfix probe Scaling, configuration, monitoring and their implementation
  • 10. Built with - A toolkit for building fast packet processing applications using a high-level programming language - Written in Lua (using the amazing LuaJIT compiler)! - Packet I/O without going through the kernel (kernel-bypass / userspace networking) - Open source and independent (not sponsored by any $vendor)
  • 11. ● Simple > Complex ● Small > Large ● Commodity > Proprietary
  • 12. Recording packet metadata in a flow table function FlowSet:record_flows(timestamp) local entry = self.scratch_entry for i=1,link.nreadable(self.incoming) do local pkt = link.receive(self.incoming) self.template:extract(pkt, timestamp, entry) local lookup_result = self.table:lookup_ptr(entry.key) if lookup_result == nil then self.table:add(entry.key, entry.value) else self.template:accumulate(lookup_result, entry, pkt) end packet.free(pkt) end end
  • 13. Flushing ipfix records -- Walk through flow set to see if flow records need to be expired. -- Collect expired records and export them to the collector. function FlowSet:expire_records(out, now) local cursor = self.expiry_cursor … for i = 1, self.table_tb:take_burst() do local entry cursor, entry = self.table:next_entry(cursor, cursor + 1) … if entry then … self:add_data_record(entry.key, out) end end if self.flush_timer() then self:flush_data_records(out) end end
  • 14. High-level overview 100G NIC (Driver written in Lua) Snabb ipfix probe tun/tap (Linux kernel network stack) ipfix collector
  • 15. Scaling via hardware RSS 100G NIC (Driver written in Lua) Snabb ipfix probe RSS forwards distinct sets of flows to distinct Snabbflow processes Horizontal scaling! Circle = CPU core
  • 16. Scaling via software RSS Snabb ipfix probe IP template DNS/HTTP template Software RSS forwards distinct sets of flows to distinct exporter processes extracting different sets of metadata. Isolate workloads! (Complex packet inspection does not bog down basic metadata export) Circle = CPU core
  • 17. “Apps” and multi-processing ConnectX Driver App ARP App input output Snabb programs are organized in “apps” (independent packet processing components) Communicate with each other via “links”: p = link.receive(input) link.transmit(output, p)
  • 18. “Apps” and multi-processing (lib.interlink) cpu core 1 cpu core 1 ConnectX Driver App ARP App Interlink Transmitter App Interlink Receiver App Interlink Packets can be shared with low overhead across CPU core boundaries using “interlinks”. Link interface remains orthogonal: p = link.receive(input) link.transmit(output, p)
  • 19. lib.ptree Control plane (manager) Data plane (worker) - Can query and update data-plane configuration - Knows about data-plane state - No particular latency requirements - Manages multiple data-plane workers (on dedicated CPU cores) - Soft real-time! No messing around! - Receives configuration updates from manager - Writes state counters to shared memory Data plane (worker) Data plane (worker)
  • 20. lib.yang Application configuration and state are described in a YANG schema. $ snabb config set my-process / < ipfix.conf $ snabb config get-state my-process /snabbflow-state/exporter[name=ip] packets-dropped 0; packets-ignored 129326; packets-received 499996; template { id 1512; flow-export-packets 115; flows-exported 1318; packets-processed 12034; …
  • 21. snabb-snabbflow-v1.yang module snabb-snabbflow-v1 { … container snabbflow-config { description "Configuration for the Snabbflow IPFIX exporter."; list interface { key device; unique "name vlan-tag"; description "Interfaces serving as IPFIX Observation Points."; leaf device { type pci-address; description "PCI address of the network device."; } … - Schema defines both valid configuration and state trees - YANG is expressive: control-plane can effectively reject invalid data-plane configurations - Snabb programs translate valid configurations to app and link networks running in data-plane
  • 22. Flight recorder - Minimal overhead: always on! (if you want it) - Stores useful data - JIT trace info - Trace profiles (sampled) - High-frequency event log (sampled) - Can be analyzed while running or post mortem - tar cf blackbox.tar /var/run/snabb; scp blackbox.tar …
  • 23. Where does my program spend its time? Does the JIT have issues generating efficient code? Includes full IR / assembly dump for each compiled trace!
  • 24. Latency histograms derived from event log Here: ipfix app takes ~35us to process a batch of packets. Useful for debugging tail latencies. Can add arbitrary application-specific, user-defined events.
  • 25. If you write a Snabb program today You can reuse all of these components and more!
  • 26. Thanks for your attention! Questions? GitHub: snabbco/snabb Snabbflow: alexander.gall@switch.ch Commercial support for Snabb: maximilian@igalia.com