SlideShare a Scribd company logo
Analysis NetFlow[v5] in Real Time
Piotr Perzyna
Marzec 2016
SGGW
What is NetFlow?
1. NetFlow is a feature that was introduced on Cisco routers that provides the ability to
collect IP network traffic as it enters or exits an interface.
2. NetFlow have a several versions from 1 to 10, but the comon is only v5 and v9.
3. The idea was that the first packet of a flow would create a NetFlow switching record. This
record would then be used for all later packets of the same flow, until the expiration of
the flow. Only the first packet of a flow would require an investigation of the route table
to find the most specific matching route.
Where is NetFlow?
NetFlow v5 content
Bytes Contents Description
0-3 srcaddr Source IP address
4-7 dstaddr Destination IP address
8-11 nexthop IP address of next hop router
12-13 input SNMP index of input interface
14-15 output SNMP index of output interface
16-19 dPkts Packets in the flow
20-23 dOctets
Total number of Layer 3 bytes in the
packets of the flow
24-27 first SysUptime at start of flow
28-31 last
SysUptime at the time the last packet
of the flow was received
32-33 srcport
TCP/UDP source port nr or
equivalent
34-35 dstport
TCP/UDP dest port nr or
equivalent
36 pad1 Unused (zero) bytes
37 tcp_flags Cumulative OR of TCP flags
38 prot IP protocol type
39 tos IP type of service (ToS)
40-41 src_as
Autonomous system number of the
source, either origin or peer
42-43 dst_as
Autonomous system number of the
destination, either origin or peer
44 src_mask Source address prefix mask bits
45 dst_mask Destination address prefix mask bits
46-47 pad2 Unused (zero) bytes
Mikrotik as NetFlow Exporter?!
1. SIA Mikrotīkls, as MikroTik - Latvian manufacturer of computer hardware.
2. The main product is a Linux-based operating system known as MikroTik RouterOS.
3. It allows you to change any PC computer (including machines in MIPS and PowerPC) fully
functional router.
4. Remote administration from using the program WinBox
Logstash as NetFlow Collector?!
Process Any Data, From Any Source
1. Centralize data processing of all types
2. Normalize varying schema and formats
3. Quickly extend to custom log formats
4. Easily add plugins for custom data sources
The recent Logstash 2.2 release is powered by a new and improved, next-generation pipeline
backbone, enables dynamic watermarking for JDBC input queries, supports compressed HTTP input
requests, and is compatible with the latest versions of Elasticsearch and Beats.
ElasticSearch as storage?!
1. Object Json DB
2. Real-Time Data
3. High Availability
4. Full-Text Search
5. RESTful API
6. Massively Distributed
Kibana as Analyzer?!
Open Source
Easy Setup
Integration with Elasticsearch
Data visualization platform
GeoIP
Easy to Share
Simple Data Export
Data from Many Sources
Simple laboratory
Our exercise is
to create an area
highlighted in
red
Configuration contained in the
presentation is designed to exercise
and show a circuit diagram.
Production use inadvisable for security reasons.
CookBook logstash?!
1. Create new directory
# mkdir /opt/logstash
# mkdir /opt/logstash/config
2. Download logstash
# wget
https://download.elastic.co/logstash/logst
ash/logstash-2.2.2.tar.gz
3. Unpack kibana to /opt/kibana
# tar -zxvf logstash-2.2.2.tar.gz
1. Download NetFlow library
# wget
https://raw.githubusercontent.com/logstash
-plugins/logstash-codec-
netflow/master/lib/logstash/codecs/netflow
/netflow.yaml
# mv netflow.yaml
/opt/logstash/config/netflow.yml
CookBook logstash?!
1. Create configuration
/opt/logstash/config/mikrotik.yml
input {
udp {
port => 9995
codec => netflow {
definitions => "/opt/logstash/config/netflow.yml"
versions => [5]
}
}
}
output {
elasticsearch {
index => "logstash-%{+YYYY.MM}"
hosts => "localhost:9200"
}
}
6. Run
# screen -dmS logstash
/opt/logstash/bin/logstash -f
/opt/logstash/config/mikrotik.yml
7. Tell presenter Your IP address, NetFlow will start
flood your server :)
CookBook elasticsearch?!
1. Create new directory /opt/elastic
# mkdir /opt/elastic
2. Download elastic
# wget
https://download.elasticsearch.org/elastic
search/release/org/elasticsearch/distribut
ion/tar/elasticsearch/2.2.0/elasticsearch-
2.2.0.tar.gz
3. Unpack to /opt/elastic
# tar -zxvf elasticsearch-2.2.0.tar.gz
1. Change /opt/elastic/config/elasticsearch.yml
# path.data: /opt/elastic/data
# path.logs: /var/log/elastic
# network.host: 0.0.0.0
# http.port: 9200
2. Run elasticsearch
# screen -dmS elastic
/opt/elastic/bin/elasticsearch -
Des.insecure.allow.root=true
CookBook kibana?!
1. Create new directory /opt/kibana
# mkdir /opt/kibana
2. Download kibana
# wget
https://download.elastic.co/kibana/kibana
/kibana-4.4.1-linux-x64.tar.gz
3. Unpack kibana to /opt/kibana
# tar -zxvf kibana-4.4.1-linux-x64.tar.gz
# mv kibana-4.4.1-linux-x64/* /opt/kibana/
4. Change /opt/kibana/config/kibana.yml
✓ server.port: 5601
✓ server.host: “0.0.0.0”
✓ elasticsearch: “http://localhost:9200”
✓ kibana.index: “.kibana”
5. Run kibana
# screen -dmS kibana /opt/kibana/bin/kibana
Login via browser to:
http://xxx.xxx.xxx.xxx:5601
and
create fantastic dashboard!
poweroff
Thank you for watching!

More Related Content

PDF
Intro to OpenStack Astara (Spring '16)
PDF
Using IO Visor to Secure Microservices Running on CloudFoundry [OpenStack Sum...
PDF
Evolving Virtual Networking with IO Visor
PDF
Kernel advantages for Istio realized with Cilium
PDF
Leveraging Network Offload to Accelerate SDN and NFV Deployments
PPTX
OpenContrail deployment experience
PDF
Netronome Corporate Brochure
PDF
Telco Access Network with SDN
Intro to OpenStack Astara (Spring '16)
Using IO Visor to Secure Microservices Running on CloudFoundry [OpenStack Sum...
Evolving Virtual Networking with IO Visor
Kernel advantages for Istio realized with Cilium
Leveraging Network Offload to Accelerate SDN and NFV Deployments
OpenContrail deployment experience
Netronome Corporate Brochure
Telco Access Network with SDN

What's hot (20)

PDF
Simplifying and Securing your OpenShift Network with Project Calico
PDF
The Universal Dataplane
PDF
OCP U.S. Summit 2017 Presentation
PPTX
如何用k8s打造國產5G NFV平臺? 剖析經濟部5G核網技術的關鍵
PPTX
In-kernel Analytics and Tracing with eBPF for OpenStack Clouds
PDF
OpenContrail Cloudwatt Feedback
PDF
Container network security
PDF
OpenContrail SDN for Kubernetes
PPTX
DPDK IPSec performance benchmark ~ Georgii Tkachuk
PPTX
KubeCon EU 2016: Secure, Cloud-Native Networking with Project Calico
PDF
Interop2018 contrail ContrailEnterpriseMulticloud
PDF
OpenStack and OpenDaylight: An Integrated IaaS for SDN/NFV
PDF
Deployment of Juniper Contrail in AVG Technologies
PPTX
Symantec SDN Deployment
PPTX
M-CORD cloud-native
PPTX
Can the Open vSwitch (OVS) bottleneck be resolved? - Erez Cohen - OpenStack D...
PDF
IO Visor Summit 2017: Welcome & Overview via Pere Monclus
PDF
Contrail integrated with Kubernetes and Openstack
PPTX
OpenStack & OpenContrail in Production
Simplifying and Securing your OpenShift Network with Project Calico
The Universal Dataplane
OCP U.S. Summit 2017 Presentation
如何用k8s打造國產5G NFV平臺? 剖析經濟部5G核網技術的關鍵
In-kernel Analytics and Tracing with eBPF for OpenStack Clouds
OpenContrail Cloudwatt Feedback
Container network security
OpenContrail SDN for Kubernetes
DPDK IPSec performance benchmark ~ Georgii Tkachuk
KubeCon EU 2016: Secure, Cloud-Native Networking with Project Calico
Interop2018 contrail ContrailEnterpriseMulticloud
OpenStack and OpenDaylight: An Integrated IaaS for SDN/NFV
Deployment of Juniper Contrail in AVG Technologies
Symantec SDN Deployment
M-CORD cloud-native
Can the Open vSwitch (OVS) bottleneck be resolved? - Erez Cohen - OpenStack D...
IO Visor Summit 2017: Welcome & Overview via Pere Monclus
Contrail integrated with Kubernetes and Openstack
OpenStack & OpenContrail in Production
Ad

Viewers also liked (20)

PDF
Netflow Analysis using Elastic Stack - 조인중
PPTX
Network Traffic Analysis at a financial institution with 788 branches for 350...
PPTX
What's new in NetFlow Analyzer 12.2
PDF
Logstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
PPT
Base De Datos Oracle Para Una Galeria De
PDF
Logmanagement with Icinga2 and ELK
PPTX
Detecting Hacks: Anomaly Detection on Networking Data
PDF
Workshop: Big Data Visualization for Security
PPTX
Arquitectura de Bases de Datos Oracle
PDF
E-Mail Forensics
PDF
Сети для самых маленьких. Часть восьмая. BGP и IP SLA
PDF
Working With a Real-World Dataset in Neo4j: Import and Modeling
PPTX
Applied Detection and Analysis Using Flow Data - MIRCon 2014
PDF
İnternet Üzerinde Anonimlik ve Tespit Yöntemleri
PDF
Uygulamalı Ağ Güvenliği Eğitimi Lab Çalışmaları
PDF
SOC Ekiplerinin Problemlerine Güncel Yaklaşımlar - NETSEC
PDF
Pfsense Firewall ve Router Eğitimi
PDF
Zararlı Yazılım Analizi Eğitimi Lab Kitabı
PDF
Mobile Application Penetration Testing
PDF
DDoS Saldırıları ve Korunma Yöntemleri ile E-posta ve ATM Güvenliği
Netflow Analysis using Elastic Stack - 조인중
Network Traffic Analysis at a financial institution with 788 branches for 350...
What's new in NetFlow Analyzer 12.2
Logstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
Base De Datos Oracle Para Una Galeria De
Logmanagement with Icinga2 and ELK
Detecting Hacks: Anomaly Detection on Networking Data
Workshop: Big Data Visualization for Security
Arquitectura de Bases de Datos Oracle
E-Mail Forensics
Сети для самых маленьких. Часть восьмая. BGP и IP SLA
Working With a Real-World Dataset in Neo4j: Import and Modeling
Applied Detection and Analysis Using Flow Data - MIRCon 2014
İnternet Üzerinde Anonimlik ve Tespit Yöntemleri
Uygulamalı Ağ Güvenliği Eğitimi Lab Çalışmaları
SOC Ekiplerinin Problemlerine Güncel Yaklaşımlar - NETSEC
Pfsense Firewall ve Router Eğitimi
Zararlı Yazılım Analizi Eğitimi Lab Kitabı
Mobile Application Penetration Testing
DDoS Saldırıları ve Korunma Yöntemleri ile E-posta ve ATM Güvenliği
Ad

Similar to Analise NetFlow in Real Time (20)

PDF
Krzysztof Mazepa - Netflow/cflow - ulubionym narzędziem operatorów SP
DOCX
How to configure flexible netflow export on cisco routers
PDF
Install FD.IO VPP On Intel(r) Architecture & Test with Trex*
PPTX
OpenCORD MiniSummit - Physical POD test and deployments
PDF
Snabbflow: A Scalable IPFIX exporter
PPT
OpenFlow tutorial
PDF
IRJET- Assessment of Network Protocol Packet Analysis in IPV4 and IPV6 on Loc...
PDF
NetFlow Monitoring for Cyber Threat Defense
PDF
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
PDF
PPTX
BASIC TO ADVANCED NETWORKING TUTORIALS
PDF
[Webinar Slides] Programming the Network Dataplane in P4
PDF
BKK16-103 OpenCSD - Open for Business!
PPTX
PLNOG16: Obsługa 100M pps na platformie PC , Przemysław Frasunek, Paweł Mała...
PDF
Network Programming: Data Plane Development Kit (DPDK)
PDF
64bit SMP OS for TILE-Gx many core processor
DOCX
B.Eng-Final Year Project interim-report
PDF
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
PDF
Snabb Switch: Riding the HPC wave to simpler, better network appliances (FOSD...
PDF
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Krzysztof Mazepa - Netflow/cflow - ulubionym narzędziem operatorów SP
How to configure flexible netflow export on cisco routers
Install FD.IO VPP On Intel(r) Architecture & Test with Trex*
OpenCORD MiniSummit - Physical POD test and deployments
Snabbflow: A Scalable IPFIX exporter
OpenFlow tutorial
IRJET- Assessment of Network Protocol Packet Analysis in IPV4 and IPV6 on Loc...
NetFlow Monitoring for Cyber Threat Defense
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
BASIC TO ADVANCED NETWORKING TUTORIALS
[Webinar Slides] Programming the Network Dataplane in P4
BKK16-103 OpenCSD - Open for Business!
PLNOG16: Obsługa 100M pps na platformie PC , Przemysław Frasunek, Paweł Mała...
Network Programming: Data Plane Development Kit (DPDK)
64bit SMP OS for TILE-Gx many core processor
B.Eng-Final Year Project interim-report
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Snabb Switch: Riding the HPC wave to simpler, better network appliances (FOSD...
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device

More from Piotr Perzyna (7)

PPTX
K8s in 3h - Kubernetes Fundamentals Training
PPTX
Pact - Contract Testing
PDF
Deployment Strategies
PPTX
Helm - Package manager in K8S
PPTX
Is a ORCHESTRATION a new milestone?
PPTX
Wizualizacja dancyh - graphite/grafana/kibana
PPTX
What is Linux?
K8s in 3h - Kubernetes Fundamentals Training
Pact - Contract Testing
Deployment Strategies
Helm - Package manager in K8S
Is a ORCHESTRATION a new milestone?
Wizualizacja dancyh - graphite/grafana/kibana
What is Linux?

Recently uploaded (20)

PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Modernizing your data center with Dell and AMD
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Cloud computing and distributed systems.
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Empathic Computing: Creating Shared Understanding
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
cuic standard and advanced reporting.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Modernizing your data center with Dell and AMD
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Review of recent advances in non-invasive hemoglobin estimation
Spectral efficient network and resource selection model in 5G networks
Cloud computing and distributed systems.
The AUB Centre for AI in Media Proposal.docx
Empathic Computing: Creating Shared Understanding
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
20250228 LYD VKU AI Blended-Learning.pptx
MYSQL Presentation for SQL database connectivity
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Understanding_Digital_Forensics_Presentation.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
cuic standard and advanced reporting.pdf
Big Data Technologies - Introduction.pptx
Network Security Unit 5.pdf for BCA BBA.

Analise NetFlow in Real Time

  • 1. Analysis NetFlow[v5] in Real Time Piotr Perzyna Marzec 2016 SGGW
  • 2. What is NetFlow? 1. NetFlow is a feature that was introduced on Cisco routers that provides the ability to collect IP network traffic as it enters or exits an interface. 2. NetFlow have a several versions from 1 to 10, but the comon is only v5 and v9. 3. The idea was that the first packet of a flow would create a NetFlow switching record. This record would then be used for all later packets of the same flow, until the expiration of the flow. Only the first packet of a flow would require an investigation of the route table to find the most specific matching route.
  • 4. NetFlow v5 content Bytes Contents Description 0-3 srcaddr Source IP address 4-7 dstaddr Destination IP address 8-11 nexthop IP address of next hop router 12-13 input SNMP index of input interface 14-15 output SNMP index of output interface 16-19 dPkts Packets in the flow 20-23 dOctets Total number of Layer 3 bytes in the packets of the flow 24-27 first SysUptime at start of flow 28-31 last SysUptime at the time the last packet of the flow was received 32-33 srcport TCP/UDP source port nr or equivalent 34-35 dstport TCP/UDP dest port nr or equivalent 36 pad1 Unused (zero) bytes 37 tcp_flags Cumulative OR of TCP flags 38 prot IP protocol type 39 tos IP type of service (ToS) 40-41 src_as Autonomous system number of the source, either origin or peer 42-43 dst_as Autonomous system number of the destination, either origin or peer 44 src_mask Source address prefix mask bits 45 dst_mask Destination address prefix mask bits 46-47 pad2 Unused (zero) bytes
  • 5. Mikrotik as NetFlow Exporter?! 1. SIA Mikrotīkls, as MikroTik - Latvian manufacturer of computer hardware. 2. The main product is a Linux-based operating system known as MikroTik RouterOS. 3. It allows you to change any PC computer (including machines in MIPS and PowerPC) fully functional router. 4. Remote administration from using the program WinBox
  • 6. Logstash as NetFlow Collector?! Process Any Data, From Any Source 1. Centralize data processing of all types 2. Normalize varying schema and formats 3. Quickly extend to custom log formats 4. Easily add plugins for custom data sources The recent Logstash 2.2 release is powered by a new and improved, next-generation pipeline backbone, enables dynamic watermarking for JDBC input queries, supports compressed HTTP input requests, and is compatible with the latest versions of Elasticsearch and Beats.
  • 7. ElasticSearch as storage?! 1. Object Json DB 2. Real-Time Data 3. High Availability 4. Full-Text Search 5. RESTful API 6. Massively Distributed
  • 8. Kibana as Analyzer?! Open Source Easy Setup Integration with Elasticsearch Data visualization platform GeoIP Easy to Share Simple Data Export Data from Many Sources
  • 9. Simple laboratory Our exercise is to create an area highlighted in red
  • 10. Configuration contained in the presentation is designed to exercise and show a circuit diagram. Production use inadvisable for security reasons.
  • 11. CookBook logstash?! 1. Create new directory # mkdir /opt/logstash # mkdir /opt/logstash/config 2. Download logstash # wget https://download.elastic.co/logstash/logst ash/logstash-2.2.2.tar.gz 3. Unpack kibana to /opt/kibana # tar -zxvf logstash-2.2.2.tar.gz 1. Download NetFlow library # wget https://raw.githubusercontent.com/logstash -plugins/logstash-codec- netflow/master/lib/logstash/codecs/netflow /netflow.yaml # mv netflow.yaml /opt/logstash/config/netflow.yml
  • 12. CookBook logstash?! 1. Create configuration /opt/logstash/config/mikrotik.yml input { udp { port => 9995 codec => netflow { definitions => "/opt/logstash/config/netflow.yml" versions => [5] } } } output { elasticsearch { index => "logstash-%{+YYYY.MM}" hosts => "localhost:9200" } } 6. Run # screen -dmS logstash /opt/logstash/bin/logstash -f /opt/logstash/config/mikrotik.yml 7. Tell presenter Your IP address, NetFlow will start flood your server :)
  • 13. CookBook elasticsearch?! 1. Create new directory /opt/elastic # mkdir /opt/elastic 2. Download elastic # wget https://download.elasticsearch.org/elastic search/release/org/elasticsearch/distribut ion/tar/elasticsearch/2.2.0/elasticsearch- 2.2.0.tar.gz 3. Unpack to /opt/elastic # tar -zxvf elasticsearch-2.2.0.tar.gz 1. Change /opt/elastic/config/elasticsearch.yml # path.data: /opt/elastic/data # path.logs: /var/log/elastic # network.host: 0.0.0.0 # http.port: 9200 2. Run elasticsearch # screen -dmS elastic /opt/elastic/bin/elasticsearch - Des.insecure.allow.root=true
  • 14. CookBook kibana?! 1. Create new directory /opt/kibana # mkdir /opt/kibana 2. Download kibana # wget https://download.elastic.co/kibana/kibana /kibana-4.4.1-linux-x64.tar.gz 3. Unpack kibana to /opt/kibana # tar -zxvf kibana-4.4.1-linux-x64.tar.gz # mv kibana-4.4.1-linux-x64/* /opt/kibana/ 4. Change /opt/kibana/config/kibana.yml ✓ server.port: 5601 ✓ server.host: “0.0.0.0” ✓ elasticsearch: “http://localhost:9200” ✓ kibana.index: “.kibana” 5. Run kibana # screen -dmS kibana /opt/kibana/bin/kibana
  • 15. Login via browser to: http://xxx.xxx.xxx.xxx:5601 and create fantastic dashboard!