SlideShare uma empresa Scribd logo
1 de 26
Baixar para ler 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

Mais conteúdo relacionado

Mais procurados

TechWiseTV Workshop: Cisco Catalyst 9500 Series High-Performance Switch Archi...
TechWiseTV Workshop: Cisco Catalyst 9500 Series High-Performance Switch Archi...TechWiseTV Workshop: Cisco Catalyst 9500 Series High-Performance Switch Archi...
TechWiseTV Workshop: Cisco Catalyst 9500 Series High-Performance Switch Archi...
Robb Boyd
 

Mais procurados (20)

SIP (Session Initiation Protocol) - Study Notes
SIP (Session Initiation Protocol) - Study NotesSIP (Session Initiation Protocol) - Study Notes
SIP (Session Initiation Protocol) - Study Notes
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux Kernel
 
TechWiseTV Workshop: Cisco Catalyst 9500 Series High-Performance Switch Archi...
TechWiseTV Workshop: Cisco Catalyst 9500 Series High-Performance Switch Archi...TechWiseTV Workshop: Cisco Catalyst 9500 Series High-Performance Switch Archi...
TechWiseTV Workshop: Cisco Catalyst 9500 Series High-Performance Switch Archi...
 
HSRP ccna
HSRP ccna HSRP ccna
HSRP ccna
 
Session 1
Session 1Session 1
Session 1
 
Using VPP and SRIO-V with Clear Containers
Using VPP and SRIO-V with Clear ContainersUsing VPP and SRIO-V with Clear Containers
Using VPP and SRIO-V with Clear Containers
 
Herramientas de monitorización de flujos ¿Qué tenemos? ¿Qué necesitamos?
Herramientas de monitorización de flujos ¿Qué tenemos? ¿Qué necesitamos?Herramientas de monitorización de flujos ¿Qué tenemos? ¿Qué necesitamos?
Herramientas de monitorización de flujos ¿Qué tenemos? ¿Qué necesitamos?
 
HSRP (hot standby router protocol)
HSRP (hot standby router protocol)HSRP (hot standby router protocol)
HSRP (hot standby router protocol)
 
MPLS on Router OS V7 - Part 1
MPLS on Router OS V7 - Part 1MPLS on Router OS V7 - Part 1
MPLS on Router OS V7 - Part 1
 
Class notes fhrp,hsrp,vrrp
Class notes fhrp,hsrp,vrrpClass notes fhrp,hsrp,vrrp
Class notes fhrp,hsrp,vrrp
 
CephFS Update
CephFS UpdateCephFS Update
CephFS Update
 
A comparison of segment routing data-plane encodings
A comparison of segment routing data-plane encodingsA comparison of segment routing data-plane encodings
A comparison of segment routing data-plane encodings
 
Cisco Live! :: Cisco ASR 9000 Architecture :: BRKARC-2003 | Las Vegas 2017
Cisco Live! :: Cisco ASR 9000 Architecture :: BRKARC-2003 | Las Vegas 2017Cisco Live! :: Cisco ASR 9000 Architecture :: BRKARC-2003 | Las Vegas 2017
Cisco Live! :: Cisco ASR 9000 Architecture :: BRKARC-2003 | Las Vegas 2017
 
A look under the hood at Apache Spark's API and engine evolutions
A look under the hood at Apache Spark's API and engine evolutionsA look under the hood at Apache Spark's API and engine evolutions
A look under the hood at Apache Spark's API and engine evolutions
 
Kea DHCP – the new open source DHCP server from ISC
Kea DHCP – the new open source DHCP server from ISCKea DHCP – the new open source DHCP server from ISC
Kea DHCP – the new open source DHCP server from ISC
 
Kernel Recipes 2019 - XDP closer integration with network stack
Kernel Recipes 2019 -  XDP closer integration with network stackKernel Recipes 2019 -  XDP closer integration with network stack
Kernel Recipes 2019 - XDP closer integration with network stack
 
IPv6 in the Telco Cloud and 5G
IPv6 in the Telco Cloud and 5GIPv6 in the Telco Cloud and 5G
IPv6 in the Telco Cloud and 5G
 
Rdma 1
Rdma 1Rdma 1
Rdma 1
 
Fluent Bit: Log Forwarding at Scale
Fluent Bit: Log Forwarding at ScaleFluent Bit: Log Forwarding at Scale
Fluent Bit: Log Forwarding at Scale
 
Monitoring pfSense 2.4 with SNMP - pfSense Hangout March 2018
Monitoring pfSense 2.4 with SNMP - pfSense Hangout March 2018Monitoring pfSense 2.4 with SNMP - pfSense Hangout March 2018
Monitoring pfSense 2.4 with SNMP - pfSense Hangout March 2018
 

Semelhante a Snabbflow: A Scalable IPFIX exporter

FlowER Erlang Openflow Controller
FlowER Erlang Openflow ControllerFlowER Erlang Openflow Controller
FlowER Erlang Openflow Controller
Holger Winkelmann
 
Hari Krishna Vetsa Resume
Hari Krishna Vetsa ResumeHari Krishna Vetsa Resume
Hari Krishna Vetsa Resume
Hari Krishna
 

Semelhante a 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
 

Mais de Igalia

Building End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEBuilding End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPE
Igalia
 
Automated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesAutomated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded Devices
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 JIT
Igalia
 
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
Igalia
 

Mais de Igalia (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Building End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEBuilding End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPE
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Automated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesAutomated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded Devices
 
Embedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceEmbedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to Maintenance
 
Optimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfOptimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdf
 
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
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

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