Net Flow
Net Flow
Net Flow
PacNOG 6
Nadi, Fiji
Agenda
• Netflow
– What it is and how it works
– Uses and Applications
• Vendor Configurations/ Implementation
– Cisco and Juniper
• Flow-tools
– Architectural issues
– Software, tools etc
• More Discussion / Lab Demonstration
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.
Working with Flows
• Generating and Viewing Flows
• Exporting Flows from devices
– Types of flows
– Sampling rates
• Collecting it
– Tools to Collect Flows - Flow-tools
• Analyzing it
– More tools available, can write your own
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 Generation/Collection
• Passive monitor
• A passive monitor (usually a unix host) receives all
data and generates flows.
• Resource intensive, newer investments needed
• Router or other existing network device.
• Router or other existing devices like switch, generate
flows.
• Sampling is possible
• Nothing new needed
Passive Monitor Collection
Workstation A Workstation B
LAN
LAN
Internet
Flow collector
stores exported flows from router.
Passive Monitor
• Directly connected to a LAN segment via a
switch 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.
Router Collection
• Router will generate flows for traffic that
is directed to the router.
• Flows are not generated for local LAN
traffic.
• Limited to “simple” flow criteria (packet
headers).
• Generally easier to deploy – no new
equipment.
Vendor implementations
Cisco NetFlow
• Unidirectional flows.
• IPv4 unicast and multicast.
• Aggregated and unaggregated.
• Flows exported via UDP.
• Supported on IOS and CatOS platforms.
• Catalyst NetFlow is different implementation.
Cisco NetFlow Versions
• 4 Unaggregated types (1,5,6,7).
• 14 Aggregated types (8.x, 9).
• 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.
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.
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.
• Not all flow types available on all
equipments
• Much less data to post process, but loses
fine granularity of v5 – no IP addresses.
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
description Access to backbone
ip address 169.223.11.194 255.255.252.0
ip route-cache flow
duplex auto
speed auto
!
interface FastEthernet0/1
description Access to local net
ip address 169.223.2.1 255.255.255.128
ip route-cache flow
duplex auto
speed auto
ip flow-export version 5
ip flow-export destination 169.223.2.2 5004
Cisco IOS Configuration
gw-169-223-2-0#sh ip flow export
Flow export v5 is enabled for main cache
Export source and destination details :
VRF ID : Default
Destination(1) 169.223.2.2 (5004)
Version 5 flow records
55074 flows exported in 3348 udp datagrams
0 flows failed due to lack of export packet
0 export packets were sent up to process level
0 export packets were dropped due to no fib
0 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
Cisco IOS Configuration
gw-169-223-2-0#sh ip cache flow
IP packet size distribution (3689551 total packets):
1-32 64 96 128 160 192 224 256 288 320 352 384 416 448 480
.000 .483 .189 .014 .002 .003 .001 .000 .000 .000 .000 .000 .000 .000 .001
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608
.001 .000 .008 .002 .288 .000 .000 .000 .000 .000 .000
• View flows
– show ip cache flow
– show ip flow top-talkers
Cisco Command Summary
• NetFlow Applications
http://www.inmon.com/technology/netflowapps.php
• Netflow HOW-TO
http://www.linuxgeek.org/netflow-howto.php
• IETF standards effort:
http://www.ietf.org/html.charters/ipfix-charter.html
References
• Abilene NetFlow page
http://abilene-netflow.itec.oar.net/
• Flow-tools mailing list:
flow-tools@splintered.net
• Cisco Centric Open Source Community
http://cosi-nms.sourceforge.net/related.html