Flow-tools Tutorial Mark Fullmer Agenda Deployment motivation. Network flows. Cisco / Juniper implementation – NetFlow. Cisco / Juniper Configuration.

Slides:



Advertisements
Similar presentations
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Chapter 8: Monitoring the Network Connecting Networks.
Advertisements

1 Semester 2 Module 4 Learning about Other Devices Yuda college of business James Chen
Oct 21, 2004CS573: Network Protocols and Standards1 IP: Addressing, ARP, Routing Network Protocols and Standards Autumn
Introduction. 2 What Is SmartFlow? SmartFlow is the first application to test QoS and analyze the performance and behavior of the new breed of policy-based.
Chapter 19 Binding Protocol Addresses (ARP) Chapter 20 IP Datagrams and Datagram Forwarding.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 Internet Protocol (IP): Addressing and Forwarding Shivkumar Kalyanaraman Rensselaer Polytechnic.
FIREWALLS & NETWORK SECURITY with Intrusion Detection and VPNs, 2 nd ed. 6 Packet Filtering By Whitman, Mattord, & Austin© 2008 Course Technology.
Chapter 9 Classification And Forwarding. Outline.
Netflow Overview Developed by Cisco Systems in 1996
Network Analysis While Preserving Privacy* Karl F. Lutzen Information Security Officer *meaning contents of transmission 1.
Netflow Overview PacNOG 6 Nadi, Fiji. Agenda Netflow –What it is and how it works –Uses and Applications Vendor Configurations/ Implementation –Cisco.
Experiences in Analyzing Network Traffic Shou-Chuan Lai National Tsing Hua University Computer and Communication Center Nov. 20, 2003.
1 Netflow 6/12/07. 2 Overview Why use netflow? What is a flow? Deploying Netflow Performance Impact.
Data Communications and Networks
OSI Model Routing Connection-oriented/Connectionless Network Services.
Guide to TCP/IP, Third Edition
Hands-on Networking Fundamentals
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Network Layer ICMP and fragmentation.
Flow tools APRICOT 2008 Network Management Taipei, Taiwan February 20-24, 2008.
Packet Filtering. 2 Objectives Describe packets and packet filtering Explain the approaches to packet filtering Recommend specific filtering rules.
NetfFow Overview SANOG 17 Colombo, Sri Lanka. Agenda Netflow –What it is and how it works –Uses and Applications Vendor Configurations/ Implementation.
Copyright © 2002 OSI Software, Inc. All rights reserved. PI-NetFlow and PacketCapture Eric Tam, OSIsoft.
Lecture 2 TCP/IP Protocol Suite Reference: TCP/IP Protocol Suite, 4 th Edition (chapter 2) 1.
What is a Protocol A set of definitions and rules defining the method by which data is transferred between two or more entities or systems. The key elements.
Chapter 6: Packet Filtering
Network Flow-Based Anomaly Detection of DDoS Attacks Vassilis Chatzigiannakis National Technical University of Athens, Greece TNC.
Session 2 Security Monitoring Identify Device Status Traffic Analysis Routing Protocol Status Configuration & Log Classification.
TCP/IP Essentials A Lab-Based Approach Shivendra Panwar, Shiwen Mao Jeong-dong Ryoo, and Yihan Li Chapter 5 UDP and Its Applications.
POSTECH DP&NM Lab. Internet Traffic Monitoring and Analysis: Methods and Applications (1) 5. Passive Monitoring Techniques.
IP Forwarding.
Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology
NetFlow: Digging Flows Out of the Traffic Evandro de Souza ESnet ESnet Site Coordinating Committee Meeting Columbus/OH – July/2004.
Copyright 2007 Michael W. Lucas slide 1 HTGR- Netflow or, how to know what your network really did without going broke Michael W. Lucas
NetFlow and OARnet Mark Fullmer
workshop eugene, oregon What is network management? System & Service monitoring  Reachability, availability Resource measurement/monitoring.
Packet Filtering Chapter 4. Learning Objectives Understand packets and packet filtering Understand approaches to packet filtering Set specific filtering.
Net-flow APRICOT 2008 Network Management Taipei, Taiwan February 20-24, 2008.
Mahindra-British Telecom Ltd. Exploiting Layer 2 By Balwant Rathore.
Internet Protocol ECS 152B Ref: slides by J. Kurose and K. Ross.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
Networks and Protocols CE Week 7b. Routing an Overview.
Jennifer Rexford Princeton University MW 11:00am-12:20pm Measurement COS 597E: Software Defined Networking.
Project Requirements (NetFlow Generator) 정승화 분산 처리 및 네트워크 관리 연구실 포항 공과 대학교
These materials are licensed under the Creative Commons Attribution-Noncommercial 3.0 Unported license (
Open-Eye Georgios Androulidakis National Technical University of Athens.
CSC 600 Internetworking with TCP/IP Unit 5: IP, IP Routing, and ICMP (ch. 7, ch. 8, ch. 9, ch. 10) Dr. Cheer-Sun Yang Spring 2001.
S7C7 – Multilayer Switching Design and Configuration.
Net Flow Network Protocol Presented By : Arslan Qamar.
Flow-tools Tutorial Mark Fullmer
1 12-Jan-16 OSI network layer CCNA Exploration Semester 1 Chapter 5.
Semester 2v2 Chapter 8: IP Addressing. Describe how IP addressing is important in routing. IP addresses are specified in 32-bit dotted-decimal format.
Page 12/9/2016 Chapter 10 Intermediate TCP : TCP and UDP segments, Transport Layer Ports CCNA2 Chapter 10.
POSTECH DP&NM Lab Detailed Design Document NetFlow Generator 정승화 DPNM Lab. in Postech.
IP Protocol CSE TCP/IP Concepts Connectionless Operation Internetworking involves connectionless operation at the level of the Internet Protocol.
1 COMP 431 Internet Services & Protocols The IP Internet Protocol Jasleen Kaur April 21, 2016.
Network Management Workshop
© 2006 Cisco Systems, Inc. All rights reserved.Cisco Public 1 OSI network layer CCNA Exploration Semester 1 – Chapter 5.
Mark Fullmer Flow-tools Tutorial Mark Fullmer
What is a Protocol A set of definitions and rules defining the method by which data is transferred between two or more entities or systems. The key elements.
LESSON Networking Fundamentals Understand TCP/IP.
IP: Addressing, ARP, Routing
Exploiting Layer 2 By Balwant Rathore.
Introduction to TCP/IP networking
Hubs Hubs are essentially physical-layer repeaters:
Flow tools APRICOT 2008 Network Management Taipei, Taiwan
Hubs Hubs are essentially physical-layer repeaters:
IP : Internet Protocol Surasak Sanguanpong
Network Layer: Control/data plane, addressing, routers
Networking Essentials For Firewall-1 Administrators
Chapter 4: outline 4.1 Overview of Network layer data plane
Presentation transcript:

Flow-tools Tutorial Mark Fullmer

Agenda Deployment motivation. Network flows. Cisco / Juniper implementation – NetFlow. Cisco / Juniper Configuration. flow-tools programs overview and examples from Abilene and Ohio- Gigapop.

Motivations Where your campus exchanges traffic with by IP address, IP Prefix, or ASN. What type and how much traffic (SMTP, WEB, File Sharing, etc). What services running on campus. Department level traffic summaries. Track network based viruses back to hosts.

Motivations Track DoS attacks to the source(s), ie the 100 Solaris servers flooding whitehouse.gov that have been 0wn3d. Find busy hosts on campus. How many destinations each campus host exchanges traffic with. Campus host counts by service, ie how many active web servers.

Network Flows Packets or frames that have a common attribute. Creation and expiration policy – what conditions start and stop a flow. Counters – packets,bytes,time. Routing information – AS, network mask, interfaces.

Network Flows Unidirectional or bidirectional. Bidirectional flows can contain other information such as round trip time, TCP behavior. Application flows look past the headers to classify packets by their contents. Aggregated flows – flows of flows.

ssh session faith.splintered:~% ssh eng4.oar.net w 10:12PM up 476 days, 21:06, 7 users, load averages: 0.00, 0.00, 0.00 USER TTY FROM IDLE WHAT maf p0 dhcp colu 30Sep02 2days ssh maf p1 dhcp colu Wed12AM 12 -zsh (zsh) maf p2 dhcp colu Wed07AM 3:03 -zsh (zsh) maf p7 login.enss.net 22Mar02 199days - maf p8 login.enss.net 12Apr02 47days - maf p9 login.enss.net 24Jul02 75days - maf pa login.enss.net 25Jul02 47days -

ssh session faith.splintered:/usr/home/maf# tcpdump -q -i sis0 -n ip and host eng4.oar.net tcpdump: listening on sis0 22:27: > : tcp 0 (DF) 22:27: > : tcp 0 (DF) 22:27: > : tcp 0 (DF) 22:27: > : tcp 15 (DF) [tos 0x10] 22:27: > : tcp 20 (DF) 22:27: > : tcp 276 (DF) [tos 0x10] 22:27: > : tcp 156 (DF) 22:27: > : tcp 12 (DF) [tos 0x10] 22:27: > : tcp 20 (DF) 22:27: > : tcp 60 (DF) [tos 0x10] 22:27: > : tcp 12 (DF) [tos 0x10] 22:27: > : tcp 0 (DF) 22:27: > : tcp 140 (DF) 22:27: > : tcp 140 (DF) [tos 0x10] 22:27: > : tcp 28 (DF) 28 packets, 728 byte + IP/TCP overhead.

Unidirectional Flow with Source/Destination IP Key % ssh w reply Active Flows Flow Source IP Destination IP

Unidirectional Flow with Source/Destination IP Key % telnet login: Active Flows Flow Source IP Destination IP % ping ICMP echo reply

Unidirectional Flow with IP, Port,Protocol Key % telnet login: Active Flows Flow Source IP Destination IPprotsrcPortdstPort TCP TCP ICMP ICMP 0 0 % ping ICMP echo reply

Bidirectional Flow with IP, Port,Protocol Key % telnet login: Active Flows Flow Source IP Destination IPprotsrcPortdstPort TCP ICMP 00 % ping ICMP echo reply

Application Flow % netscape Content-type: Active Flows Flow Source IP Destination IPApplication HTTP Web server on Port 9090

Aggregated Flow Flow Source IP Destination IPprotsrcPortdstPort TCP TCP ICMP ICMP 0 0 Source/Destination IP Aggregate Flow Source IP Destination IP Main Active flow table

NetFlow data reduction Look at 1 day of flows exports from krc4: Flows Octets Packets Flow size 48 bytes Flows/packet 30 (typical) Packet overhead 24 bytes Octets in a flow 1464 bytes

NetFlow data reduction Look at 1 day of flows exports from krc4: Packets/Flow 37 Octets/Flow Octets/Packet 603 Packets/Flow export 1095 Octets/Flow export Octets/Octets in a flow export 452

Packets/Flow distribution

Octets/Flow distribution

Flow Descriptors A Key with more elements will generate more flows. Greater number of flows leads to more post processing time to generate reports, more memory and CPU requirements for device generating flows. Depends on application. Traffic engineering vs. intrusion detection.

Flow Accounting Accounting information accumulated with flows. Packets, Bytes, Start Time, End Time. Network routing information – masks and autonomous system number.

Flow Collection Passive monitor. Router. Other existing network device.

Passive Monitor Collection Workstation AWorkstation B Campus Flow probe connected to switch port in “ traffic mirror” mode

Router Collection Flow collector stores exported flows from router. LAN Internet

Passive Monitor Directly connected to a LAN segment via a switch/router port in “mirror” mode, optical splitter, or repeated segment. Generate flows for all local LAN traffic. Must have an interface or monitor deployed on each LAN segment. Support for more detailed flows – bidirectional and application (external probe has more resources).

Router Collection Router will generate flows for traffic that traverses the router. Flows are not generated for local LAN traffic (not a sniffer). Limited to “simple” flow criteria (packet headers). Generally easier to deploy – no new equipment.

Cisco NetFlow Unidirectional flows. IPv4 unicast and multicast. Aggregated (v8) and unaggregated (v1,5,6,7). Flows exported via UDP. Supported on IOS and CatIOS platforms. Catalyst NetFlow is different implementation.

Cisco NetFlow Versions 4 Unaggregated types (1,5,6,7). 14 Aggregated types (8.x). Each version has its own packet format. Version 1 does not have sequence numbers – no way to detect lost flows. The “version” defines what type of data is in the flow. Some versions specific to Catalyst platform.

Cisco NetFlow Versions v9 in development. More flexible packet format so new fields can be added without creating yet another version while still maintaining compact encoding.

NetFlow v1 Key fields: Source/Destination IP, Source/Destination Port, IP Protocol, ToS, Input interface. Accounting: Packets, Octets, Start/End time, Output interface. Other: Bitwise OR of TCP flags. Historical – don’t use. No sequence #’s.

NetFlow v5 Key fields: Source/Destination IP, Source/Destination Port, IP Protocol, ToS, Input interface. Accounting: Packets, Octets, Start/End time, Output interface. Other: Bitwise OR of TCP flags, Source/Destination AS and IP Mask. Packet format adds sequence numbers for detecting lost exports.

NetFlow v8 Aggregated v5 flows. 3 Catalyst 65xx specific that correspond to the configurable flow mask. Much less data to post process, but lose fine granularity of v5 – no IP addresses.

NetFlow v8 AS Protocol/Port Source Prefix Destination Prefix Prefix Destination (Catalyst 65xx) Source/Destination (Catalyst 65xx) Full Flow (Catalyst 65xx)

NetFlow v8 ToS/AS ToS/Protocol/Port ToS/Source Prefix ToS/Destination Prefix Tos/Source/Destination Prefix ToS/Prefix/Port

NetFlow Packet Format Common header among export versions. All but v1 have a sequence number. Version specific data field where N records of data type are exported. N is determined by the size of the flow definition. Packet size is kept under ~1480 bytes. No fragmentation on Ethernet. No PMTU detection.

NetFlow v5 Packet Example NetFlow v5 header v5 record IP/UDP packet v5 record … …

NetFlow v5 Packet (Header) struct ftpdu_v5 { /* 24 byte header */ u_int16 version; /* 5 */ u_int16 count; /* The number of records in the PDU */ u_int32 sysUpTime; /* Current time in millisecs since router booted */ u_int32 unix_secs; /* Current seconds since 0000 UTC 1970 */ u_int32 unix_nsecs; /* Residual nanoseconds since 0000 UTC 1970 */ u_int32 flow_sequence;/* Seq counter of total flows seen */ u_int8 engine_type; /* Type of flow switching engine (RP,VIP,etc.) */ u_int8 engine_id; /* Slot number of the flow switching engine */ u_int16 reserved;

NetFlow v5 Packet (Records) /* 48 byte payload */ struct ftrec_v5 { u_int32 srcaddr; /* Source IP Address */ u_int32 dstaddr; /* Destination IP Address */ u_int32 nexthop; /* Next hop router's IP Address */ u_int16 input; /* Input interface index */ u_int16 output; /* Output interface index */ u_int32 dPkts; /* Packets sent in Duration */ u_int32 dOctets; /* Octets sent in Duration. */ u_int32 First; /* SysUptime at start of flow */ u_int32 Last; /* and of last packet of flow */ u_int16 srcport; /* TCP/UDP source port number or equivalent */ u_int16 dstport; /* TCP/UDP destination port number or equiv */ u_int8 pad; u_int8 tcp_flags; /* Cumulative OR of tcp flags */ u_int8 prot; /* IP protocol, e.g., 6=TCP, 17=UDP,... */ u_int8 tos; /* IP Type-of-Service */ u_int16 src_as; /* originating AS of source address */ u_int16 dst_as; /* originating AS of destination address */ u_int8 src_mask; /* source address prefix mask bits */ u_int8 dst_mask; /* destination address prefix mask bits */ u_int16 drops; } records[FT_PDU_V5_MAXFLOWS]; };

NetFlow v8 Packet Example (AS Aggregation) NetFlow v8 header v8 record IP/UDP packet v8 record … …

NetFlow v8 AS agg. Packet struct ftpdu_v8_1 { /* 28 byte header */ u_int16 version; /* 8 */ u_int16 count; /* The number of records in the PDU */ u_int32 sysUpTime; /* Current time in millisecs since router booted */ u_int32 unix_secs; /* Current seconds since 0000 UTC 1970 */ u_int32 unix_nsecs; /* Residual nanoseconds since 0000 UTC 1970 */ u_int32 flow_sequence; /* Seq counter of total flows seen */ u_int8 engine_type; /* Type of flow switching engine (RP,VIP,etc.) */ u_int8 engine_id; /* Slot number of the flow switching engine */ u_int8 aggregation; /* Aggregation method being used */ u_int8 agg_version; /* Version of the aggregation export */ u_int32 reserved; /* 28 byte payload */ struct ftrec_v8_1 { u_int32 dFlows; /* Number of flows */ u_int32 dPkts; /* Packets sent in duration */ u_int32 dOctets; /* Octets sent in duration */ u_int32 First; /* SysUpTime at start of flow */ u_int32 Last; /* and of last packet of flow */ u_int16 src_as; /* originating AS of source address */ u_int16 dst_as; /* originating AS of destination address */ u_int16 input; /* input interface index */ u_int16 output; /* output interface index */ } records[FT_PDU_V8_1_MAXFLOWS]; };

Cisco IOS Configuration Configured on each input interface. Define the version. Define the IP address of the collector (where to send the flows). Optionally enable aggregation tables. Optionally configure flow timeout and main (v5) flow table size. Optionally configure sample rate.

Cisco IOS Configuration interface FastEthernet0/0/0 ip address no ip directed-broadcast ip route-cache flow interface ATM1/0/0 no ip address no ip directed-broadcast ip route-cache flow interface Loopback0 ip address no ip directed-broadcast ip flow-export version 5 origin-as ip flow-export destination ip flow-export source loopback 0 ip flow-aggregation cache prefix export destination enabled

Cisco IOS Configuration krc4#sh ip flow export Flow export is enabled Exporting flows to (5004) Exporting using source IP address Version 5 flow records, origin-as Cache for prefix aggregation: Exporting flows to (5555) Exporting using source IP address flows exported in udp datagrams 0 flows failed due to lack of export packet 45 export packets were sent up to process level 0 export packets were punted to the RP 5 export packets were dropped due to no fib 31 export packets were dropped due to adjacency issues 0 export packets were dropped due to fragmentation failures 0 export packets were dropped due to encapsulation fixup failures 0 export packets were dropped enqueuing for the RP 0 export packets were dropped due to IPC rate limiting 0 export packets were dropped due to output drops

Cisco IOS Configuration krc4#sho ip ca fl IP packet size distribution (106519M total packets): IP Flow Switching Cache, bytes active, inactive, added ager polls, 0 flow alloc failures Active flows timeout in 30 minutes Inactive flows timeout in 15 seconds last clearing of statistics never Protocol Total Flows Packets Bytes Packets Active(Sec) Idle(Sec) Flows /Sec /Flow /Pkt /Sec /Flow /Flow TCP-Telnet TCP-FTP TCP-FTPD TCP-WWW TCP-SMTP TCP-X TCP-BGP

Cisco IOS Configuration krc4#sho ip ca fl TCP-other UDP-DNS UDP-NTP UDP-TFTP UDP-Frag UDP-other ICMP IGMP IPINIP GRE IP-other Total: SrcIf SrcIPaddress DstIf DstIPaddress Pr SrcP DstP Pkts AT5/0/ AT1/0/ E4B A AT4/0/ AT1/0/ BE 074C 3 AT4/0/ AT1/0/ BE 09BB 646 AT1/0/ AT4/0/ C 04BE 3

Cisco CatIOS Configuration set mls flow full set mls nde version 7 set mls nde set mls agingtime 32

Cisco CatIOS Configuration swlap1> sh mls Total packets switched = Total bytes switched = Total routes = 2283 IP statistics flows aging time = 32 seconds IP statistics flows fast aging time = 0 seconds, packet threshold = 0 IP Current flow mask is Full flow Netflow Data Export version: 8 Netflow Data Export disabled Netflow Data Export configured for port 9110 on host Total packets exported = 6545 IPX statistics flows aging time = 256 seconds IPX flow mask is Destination flow IPX max hop is 255 Module 15: Physical MAC-Address b-78-bb-fc

Cisco CatIOS Configuration swlap1> sh mls stat entry Last Used Destination IP Source IP Prot DstPrt SrcPrt Stat-Pkts Stat-Bytes TCP 2206 WWW TCP WWW TCP WWW UDP DNS TCP DNS TCP WWW TCP WWW TCP WWW TCP WWW TCP TCP WWW TCP 2282 WWW TCP WWW TCP WWW 4 176

Cisco Catalyst Native IOS Configuration mls flow ip destination-source mls nde flow include mls nde src_address version 7 ip flow-export source Loopback0 ip flow-export version 5 peer-as ip flow-export destination

Cisco Issues Cat 65K Sup2/MSFC2 NetFlow implementation does not fill in important fields like input/output interface. Resolved? Bug Id : CSCdt21216 Headline Netflow records source / dst interface index missing Product cat6000 Model x6k-sup2 Component earl Duplicate of Severity 3 Status C Version Found 6.1(1) Fixed-in Version 6.2(1) 6.1(3) 6.3(1)PAN Release Notes On Sup2, the destination and source Interface indices would be reported as zero in netflow exports. This is a hardware limitation.

Juniper Configration Sample packets with firewall filter and forward to routing engine. Sampling rate is limited to 7000pps (addressed with future PIC). Fine for traffic engineering, but restrictive for DoS and intrusion detection. Juniper calls NetFlow cflowd.

Juniper Configration firewall { filter all { term all { then { sample; accept; } forwarding-options { sampling { input { family inet { rate 100; } output { cflowd { port 2055; version 5; } Firewall filterEnable sampling / flows

Juniper Configration interfaces { ge-0/3/0 { unit 0 { family inet { filter { input all; output all; } address /24; } Apply firewall filter to each interface.

Flow-tools Collection of programs to collect and post process Cisco NetFlow compatible flows. Written in C, designed to be fast (scales to large installations). Includes library (ftlib) for custom applications. Installation with configure;make;make install on most platforms. Distributed design for large installations.

flow-capture Collect NetFlow export packets and store to disk. Built in compression. Manages disk space by expiring older flow files at configurable limits (dataset size or number of files). Pre-filtering and Pre-tagging.

flow-capture Instrumentation for flows/second, packets/second, and dropped packets. Server for TCP based flow-client. Privacy mask option for removing host bits from flows.

flow-capture – flows/second

flow-capture – packets/second

flow-capture – flow drops/second

flow-fanout Replicate NetFlow UDP streams from one source to many destinations. Destination may be a multicast address. Same instrumentation as flow-capture. Can translate NetFlow packet format on output. Privacy mask support.

flow-expire Expire (remove) old flow files based on dataset size or number of files. Same functionality built in to flow- capture. Used when managing disk space in a distributed environment.

Abilene Configuration Collect and process flows for Abilene routers. Use sampled NetFlow on Cisco GSR’s. Distribute flows to Asta and Arbor Networks. Nightly usage reports. Archive of raw anonymized flows.

Abilene Configuration Dsitribute post processed data to internet2.edu. Moving to sampled data from Juniper T640’ and new architecture.

Current Abilene Configuration 12 Abilene core routers Configured with sampled NetFlow NetFlow exports (UDP) Server running IU AstaArborInternet2.edu Post Processed NetFlow (ssh) Ohio ITEC

Current Abilene Configuration NetFlow exports Ohio ITEC 4 servers running flow-capture (data anonymized at collection) Server with 2 Terabyte RAID5 Array & web serverfor nightly reports. flow-expire to manage disk space Pull compressed flow files with rsync from collectors.

New Abilene Configuration POP router with local directly connected server running flow-capture and flow-fanout. NetFlow exports (UDP) Server running IU AstaArborInternet2.edu Post Processed NetFlow (ssh) Compressed files (rsync via TCP) Ohio ITEC

New Abilene Configuration 11 Abilene POPS Server with 2 Terabyte RAID5 Array & web serverfor nightly reports. flow-expire to manage disk space flow-report, flow-nfilter, flow-tag for reports. Pull compressed flow files with rsync from collectors. Ohio ITEC

Collector Placement and configuration NetFlow is UDP so the collector should ideally be directly connected to the router to minimize packet loss and IP spoofing risks. No flow control. Undersized collector will drop flows. Monitor netstat –s | grep buf and configure syslog so dropped flows will be logged.

flow-print Formatted output of flow files. eng1:% flow-print < ft-v | head -15 srcIP dstIP prot srcPort dstPort octets packets

flow-cat Concat many flow files or directories of files. eng1:% ls ft-v ft-v ft-v ft-v ft-v ft-v ft-v tmp-v eng1:% flow-cat. | flow-print srcIP dstIP prot srcPort dstPort octets packets

flow-merge Flow-merge is similar to flow-cat except it maintains relative ordering of flows when combining the files. Typically used when combining flows from multiple collectors.

flow-filter Filter flows based on port, protocol, ASN, IP address, ToS bits, TCP bits, and tags. (Historical, use flow-nfilter). eng1% flow-cat. | flow-filter -P119 | flow-print | head -10 srcIP dstIP prot srcPort dstPort octets packets

flow-nfilter Filter flows based any defined fields including derived operations such as pps, bbs, and duration. Configuration file based. Supports AND and OR operations. Filters and primitives are named for ease of use. Use patricia trees, hash tables, and bucket lookups where possible for fast processing.

flow-nfilter filter-primitive abilene-interface type ifindex permit 25 filter-definition to-abilene match dst-ifindex abilene-interface filter-definition from-abilene match src-ifindex abilene-interface filter-primitive UDPTCP type ip-protocol permit tcp permit udp filter-definition udptcp match ip-protocol UDPTCP

flow-nfilter filter-primitive OSU type ip-address-prefix permit /16 permit /16 permit /16 filter-primitive DNS type ip-port match 53 filter-primitive WEB type ip-port match 80,8080,443 filter-definition OSUDNS match ip-address OSU match ip-protocol UDP match ip-destination-port DNS

flow-nfilter IP address lookup is patricia trie, worst case performance O(W) (W is length of address). IP Protocol lookup is bucket, always O(1). IP Port lookup is bucket, always O(1). Performance remains relatively constant even if loading up prefix list with full internet routing table (100,000+ entries).

flow-nfilter Some other lookups use hash tables, for example IP address list or tag list. Usually O(1). A few filters do require linear lookups but by nature list is short, ie pps filter or start time filter. Short circuit evaluation for AND and OR operations.

flow-split Split flow files into smaller files. Split based on time, tags, or number of flows. Typically used with flow-stat/flow-report for graphing. For example flow-split can produce 5 minute intervals from a day long dataset for time-series graphing.

flow-tag Adds a tag field to flows based on IP exporter, IP prefix, Autonomous System, or next hop. Used to manage groups of prefixes or ASN’s. Example, group IP prefixes by customer ID for billing.

flow-tag # # tag format # # # (32 bits) # RRRRRRRRRRRRRR TTTT NNNNNNNNNNNNNNNNNNN # | | | Site name # | | Site type # | Reserved # # BGP community 65000:X is site name (X -> N) # BGP community 65001:Y is site type (Y -> T) # # SITE_NAME_MASK = 0x0000FFFF # SITE_TYPE_MASK = 0x00FF0000 # # ID Name # # 0x0001 OSU # 0x0002 CWRU # 0x0003 BGSU # 0x0004 UC # 0x0005 UAKRON # 0x0006 WRIGHT # 0x0007 KENT # 0x0008 DAYTON # 0x0009 OBERLIN # ID Type # # 0x01 Participant # 0x02 SEGP # 0x03 Sponsored-Participant # 0x04 Gigapop # 0x05 MULTICAST

flow-tag tag-action OHIO-GIGAPOP_DST type dst-prefix # OSU match /16 set-dst 0x match /16 set-dst 0x match /16 set-dst 0x match /24 set-dst 0x # CWRU match /16 set-dst 0x match /24 set-dst 0x # BGSU match 129.1/16 set-dst 0x # UC match /16 set-dst 0x # UAKRON match /16 set-dst 0x # WRIGHT match /16 set-dst 0x # KENT match /16 set-dst 0x # DAYTON match /16 set-dst 0x # OBERLIN match /16 set-dst 0x tag-action OTHER_DST type src-prefix match 0/0 set-dst 0x0 tag-action OTHER_SRC type src-prefix match 0/0 set-src 0x0 tag-definition OHIO-GIGAPOP term input-filter 25 action OTHER_DST action OHIO-GIGAPOP_DST term output-filter 25 action OTHER_SRC action OHIO-GIGAPOP_SRC

flow-header Display meta information in flow file. eng1:% flow-header < ft-v # # mode: normal # capture hostname: eng1.oar.net # exporter IP address: # capture start: Mon Jan 21 09:33: # capture end: Mon Jan 21 09:45: # capture period: 676 seconds # compress: on # byte order: little # stream version: 3 # export version: 5 # lost flows: 0 # corrupt packets: 0 # sequencer resets: 0 # capture flows: #

flow-stat Generates reports from flow files. Output is readable and easily imported into graphing programs (gnuplot, etc). IP Address, IP address pairs, ports, packets, bytes, interfaces, next hop, Autonomous System, ToS bits, exporter, and tags. Historical – use flow-report.

flow-stat # Report Information # # Fields: Total # Symbols: Disabled # Sorting: None # Name: Overall Summary # # Args: flow-stat -f0 # Total Flows : Total Octets : Total Packets : Total Time (1/1000 secs) (flows): Duration of data (realtime) : Duration of data (1/1000 secs) : Average flow time (1/1000 secs) : Average packet size (octets) : Average flow size (octets) : Average packets per flow :

flow-report Replacement for flow-stat. Configuration file based. Multiple reports per data pass. Concurrent output per report (file, program, sorting options, fields). Integrated tagging and filtering for performance gain and readability. ~ 70 reports currently defined.

flow-report include-filter./filter include-tag./gigapop-tags stat-report to-abilene-by-customer type source-tag tag-mask 0xFF 0xFF filter to-abilene output path out/to-abilene-by-customer options +header,+names fields -pps,-bps,-duration sort +octets stat-report from-abilene-by-customer type destination-tag tag-mask 0xFF 0xFF filter from-abilene output path out/from-abilene-by-customer options +header,+names fields -pps,-bps,-duration sort +octets stat-report from-abilene-by-protocol type ip-protocol filter from-abilene output path out/from-abilene-by-protocol options +header,+names fields -pps,-bps,-duration sort +octets stat-report to-abilene-tcp type ip-destination-port filter tcp-to-abilene output path out/to-abilene-tcp options +header,+names fields -pps,-bps,-duration sort +octets output path out/to-abilene-tcp.p options +header,+names,+percent-total fields -pps,-bps,-duration sort +octets

flow-report stat-definition all tag OHIO-GIGAPOP report to-abilene-by-customer report from-abilene-by-customer report to-abilene-by-group report from-abilene-by-group report to-abilene-by-protocol report from-abilene-by-protocol report to-abilene-tcp report from-abilene-tcp report to-abilene-udp report from-abilene-udp stat-report to-abilene-host-count type ip-source-address-destination-count filter to-abilene output path out/to-abilene-host-count options +header,+names fields -pps,-bps,-duration sort +count stat-report to-abilene-multicast type ip-source/destination-address filter mcast-to-abilene output path | flow-rptfmt %Y-%d-%m options +header fields -pps,-bps,-duration sort +octets

Flow-report The following examples are all for flows received on Oct 2, The output has been formatted with flow-rptfmt.

flow-report To abilene by customer source-tag flows octets packets OHIOU OSU MIAMI UC CWRU KENT UAKRON WRIGHT DAYTON BGSU OBERLIN CSU XAVIER DENISON CENTRAL_STATE OHIO-GIGAPOP OTTERBEIN (27 records total)

flow-report From abilene by customer destination-tag flows octets packets OSU OHIOU UC MIAMI WRIGHT KENT CWRU UAKRON BGSU DAYTON OHIO-ITEC DENISON OSC XAVIER OBERLIN BWC MULTICAST CSU (28 records total)

flow-report To/From abilene by group source-tag flows octets packets PART SEGP GIGAPOP SPART destination-tag flows octets packets PART SEGP GIGAPOP MULTICAST SPART

flow-report To/From Abilene by Protocol ip-protocol flows octets packets tcp udp icmp gre esp ipv ip-protocol flows octets packets tcp udp icmp gre esp ipv ax ipencap igmp narp pup

flow-report To Abilene TCP Dest Port ip-destination-port flows octets packets FastTrack Gnutella Napster http innosys ssh smtp eDonkey nntp ftp-data telnet Gnutella Neomodus-Direct-Connect …

flow-report From Abilene TCP Dest Port ip-destination-port flows octets packets FastTrack msg-icp Neomodus-Direct-Connect Gnutella ftp nntp http aol Napster smtp innosys ftp-data …

flow-report To Abilene UDP Dest Port ip-destination-port flows octets packets commplex-link FastTrack radius domain …

flow-report From Abilene UDP Dest Port ip-destination-port flows octets packets afs3-prserver radius afs3-callback …

flow-report To Abilene Multicast S,G ip-source-address ip-destination-address flows octets packets …

flow-report From Abilene Multicast S,G ip-source-address ip-destination-address flows octets packets …

flow-report To Abilene by source Address ip-source-address flows octets packets …

flow-report From Abilene by dst Address ip-destination-address flows octets packets …

flow-report To Abilene SMTP / Customer source-tag flows octets packets OSU MIAMI OHIOU DENISON CWRU UC DAYTON KENT OBERLIN WRIGHT BGSU UAKRON BWC OSC CEDARVILLE CHMCC CSU MCO FINDLAY (26 records total)

flow-report To Abilene SMTP / Address ip-source-address flows octets packets …

flow-report

flow-dscan DoS detection / network scanning tool. Flag hosts which have flows to many other hosts. Flag hosts which are using a large number of TCP/UDP ports. Works better on smaller networks or with flow-filter to limit traffic. For example filter TCP port 25 to detect hosts infected with worm.

flow-gen Debugging tool to generate flows. eng1:% flow-gen -V8.1 | flow-print | head -10 srcAS dstAS in out flows octets packets duration

flow-send Transmit flow files with NetFlow protocol to another collector. Can be used to take flow-tools files and send them to other NetFlow compatible collector.

flow-receive Like flow-capture but does not manage disk space. Output is to standard out and can be used directly with other flow- tools programs. Typically used for debugging. eng1:% flow-receive 0/0/5555 | flow-print flow-receive: New exporter: time= src_ip= dst_ip= d_version=8 srcPrefix srcAS dstPrefix dstAS input output flows / / / / / / / / / / / /

flow-import Import flows from other formats into flow-tools. Currently supports ASCII, cflowd and Cisco NFC formats.

flow-export Export flows from flow-tools files to other formats. Currently supports ASCII, cflowd and MySQL formats. ASCII output can be used with perl or other scripting languages (with a performance penalty).

flow-xlate Translate flows among NetFlow versions. Originally intended for use with Catalyst switches since they export some flows in version 7 and others in version 5 format. Can also mask tag values.

Future work Flow-report – more reports, time series data generation, data formatting. Clean interface to rrdtool and possibly other graphing utilities. Flow-report -> SQL for billing or long term trend analysis. IPFX support. Cleaner interface to BGP information. Probe support.

Contributed software Dave Plonka’s Cflow module. Perl interface to flow-tools. Allows flow-tools to be the back-end to flowscan. Robin Sommer’s Python interface. E. Larry U Chicago Network forensics tools. Miguel Paraz & William Emmanuel inter.net billing and other tools. Other stuff – look in contrib area.

References flow-tools: Abilene NetFlow page Simon Leinen’s FloMA Pointers & Software page: tant/floma/software.html IETF standards effort: