Konfig Netflow
Konfig Netflow
Benoit Claise
bclaise@[Link]
Network Planning
RMON Probe
(Netscout)
Application RMON
NetFlow
FlowCollector:
NetFlow • Data Collection Accounting/Billing
Accounting: • Data Filtering
• Data Export • Data Aggregation
• Data • Data Storage
Aggregation • File System Management Network Data Analyzer
Network Planning X
Security Analysis X
Application Monitoring X
User Monitoring X
Traffic Engineering X
Peering Agreement X
Usage-based Billing X
A flow is unidirectional
B. Claise © 2001, Cisco Systems, Inc. All rights reserved. 7
How does it work?
NetFlow Cache
Exported Data
Header
• Sequence number Flow Flow
• Record count Record … Record
• Version number
NetFlow Cache
Optional configuration
router (config)#ip flow-export source loopback 0
router (config)#ip flow-cache entries <1024-524288>
router (config)#ip flow-cache timeout …
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608
.000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000
IP Flow Switching Cache, 4456704 bytes
1 active, 65535 inactive, 25322 added
525430 ager polls, 0 flow alloc failures
last clearing of statistics never
Protocol Total Flows Packets Bytes Packets Active(Sec) Idle(Sec)
-------- Flows /Sec /Flow /Pkt /Sec /Flow /Flow
TCP-BGP 7 0.0 2 41 0.0 1.6 7.5
UDP-TFTP 1 0.0 1 67 0.0 0.0 15.1
UDP-other 19884 0.0 3 111 0.1 5.6 15.4
ICMP 5429 0.0 3 41 0.0 0.9 15.5
Total: 25321 0.0 3 97 0.2 4.6 15.4
AS 2 export
AS 1 AS 3 AS 4
AS 5
Packet from AS1 to AS4
Candidate Packet
Vlan1
Supervisor
Enable Packet
MSFC
Vlan14
Layer 3 Switched
B. Claise © 2001, Cisco Systems, Inc. All rights reserved. 24
MLS Example
Vlan1
Ping #1
Catalyst Ping #2
Ping #3
Ping #4
MSFC Ping #5
Vlan14
Added
Note that
from
some
version
of fields
5 are not populated
B. Claise © 2001, Cisco Systems, Inc. All rights reserved. 27
Bad Design
supervisor
export
MSFC
Only export the first Vlan14
packet of the flow
Unless don’t use MLS…
B. Claise © 2001, Cisco Systems, Inc. All rights reserved. 28
Approximate Design
Vlan1
export
supervisor
MSFC
Miss the accounting Vlan14
of the first packet of
the flow
B. Claise © 2001, Cisco Systems, Inc. All rights reserved. 29
Better Design
MLS/NDE enabled and export v7 from SUP
export v5 from the MSFC
NFC + NFA
First packet exported from the MSFC
Vlan1
export
supervisor
export
MSFC
Vlan14
export
supervisor
export
Otherwise, MSFC
will account your Vlan14
exported traffic
B. Claise © 2001, Cisco Systems, Inc. All rights reserved. 31
Best Design Problem
Supervisor
Entry created in the
MSFC FIB
MSFC
Vlan14
MLS NetFlow
SUP1 MSFC
Use MLS
MSFC2
MLS
SUP2
Use CEF
Cosmos#sh ip flow-export
exportFlow export is enabled
Exporting flows to [Link] (9996)
Exporting using source interface Vlan1
Version 5 flow records
317 flows exported in 218 udp datagrams
0 flows failed due to lack of export packet
60 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
Source Prefix • •
Source Prefix Mask • •
Destination Prefix • •
Destination Prefix Mask • •
Source App Port •
Destination App Port •
Input Interface • • •
Output Interface • • •
IP Protocol •
Source AS • • •
Destination AS • • •
First Timestamp • • • • •
Last Timestamp • • • • •
# of Flows • • • • •
# of Packets • • • • •
# of Bytes • • • • •
Source Prefix • • •
Source Prefix Mask • • •
Destination Prefix • • •
Destination Prefix Mask • • •
Source App Port • •
Destination App Port • •
Input Interface • • • • •
Output Interface • • • • •
IP Protocol • •
Source AS • • •
Destination AS • • •
TOS • • • • • •
First Timestamp • • • • • •
Last Timestamp • • • • • •
# of Flows • • • • • •
# of Packets • • • • • •
# of Bytes • • • • • •
x p
Export V5
es s
Flow 2
Flow 3
ERecordecTo Collector
UDP
t N
No
Aggreg. Cache
Show Command
Router#show ip flow sampling
Flow sampling is enabled
'Packet Interval' sampling mode is configured.
1 out of every 100 packets is being sampled.
Note that the latest IOS images don’t require contiguous DRAM
anymore
B. Claise © 2001, Cisco Systems, Inc. All rights reserved. 63
12000 Line Card Cache size
Platform Default Netflow Approximate amount of
Cache Size (entries) contiguous DRAM used
by Netflow cache
LC with 1024MB DRAM 1M 64MB
RP VIP
FIB NetFlow
VIP2
B. Claise © 2001, Cisco Systems, Inc. All rights reserved. 65
Version 8 VIP/LC Caches
. .
RP . VIP .
.
VIP2 .
B. Claise © 2001, Cisco Systems, Inc. All rights reserved. 66
VIP/LC Caches
AT2 stops
IT1 starts
CPU impact:
10,000 active flows: < 4% of additional CPU utilization
45,000 active flows: <12% of additional CPU utilization
65,000 active flows: <16% of additional CPU utilization
2. NetFlow Collector
(NFC) Problem
3. Transfer Problem
Export
1. Router Problem
- Cache
- Export
• Netstat -s
F Filter deny-traffic-x
Deny Srcaddr [Link] [Link]
• Rule of thumb:
Export 1 % to 1.5% of the total box throughput
• To be more accurate, you need:
packet/sec of throughput (router figures, sh int
switching)
Ex: 150kpps average throughput on a 7500
average number of packets per flow
(sh ip cache flow)
Ex: 20 (a number recently quoted for
Internet backbone traffic)
V1 24 Approx. 1200
V5 30 Approx. 1500
V7 28 Approx. 1500
V8 AsMatrix 51 1456
V8 ProtocolPortMatrix 51 1456
V8 SourcePrefixMatrix 44 1436
V8 DestinationPrefixMatrix 44 1436
V8 PrefixMatrix 35 1428
Source Prefix • •
Source Prefix Mask • •
Destination Prefix • •
Destination Prefix Mask • •
export [Link]/16
R1
[Link]/8 [Link]/16
• Configuration:
• Introduced in 12.0(21)S
• Under investigation for the 12000
New Features
NetFlow Version 9 and IETF
Template
20
ID = 0 Length
Definition
Field #3
B. Claise © 2001, Cisco Systems, Inc. All rights reserved. 104
NetFlow Version 9
Various Type of Export Packets
1.1.1.
Template 1 Data
Packet 20 Option
Header
FlowSet FlowSet FlowSet
…
1.1.1.
Template 1 Data
Packet 20 Template Data
Header FlowSet FlowSet
… FlowSet FlowSet
1.1.1.
Data 1 Data
Packet 20
Header FlowSet
… FlowSet
…
1.1.1.
Template 1 Template
Packet 20
Header FlowSet
… FlowSet
…
B. Claise © 2001, Cisco Systems, Inc. All rights reserved. 105
Version 9
Example for Template Definition
Template A Template B
Flow Set ID (0 for Template) Flow Set ID (0 for Template)
Length of Template Length of Template
Structure Structure
1001 1002
(Template ID) (Template ID)
3 4
(# of Fields) (# of Fields)
SRC_AS_NUMBER SRC_IP_PREFIX
2 4
DST_AS_NUMBER SRC_AS_NUMBER
2 2
L4_PROTOCOL PACKET_COUNT
2 2
BYTE_COUNT
2
B. Claise © 2001, Cisco Systems, Inc. All rights reserved. 106
Example for Export Packet
As Defined in Same as Template ID
the Previous for Template B; Refer to
Slide Previous Slide
[Link] [Link]
T T
e e
1002 20 64 1001 35
m m
Packet p 2 (# of p 1
Header l records) l
a a
t t 700
365 20
e e 6025
B A
92894 1000
23
Record 1 Record 2
• Out in 12.0(24)S
• Committed for 12.3T
• Requirements draft:
[Link]
[Link]
• Architecture draft:
[Link]
[Link]
• Data Model draft:
[Link]
[Link]
• [Link]
• NetFlow compliant to most of the points
• Biggest exceptions:
MUST run on the top of a congestion aware
export protocol
MUST have authenticity, integrity, SHOULD
have confidentiality
New Features
MPLS aware NetFlow Solution
C AR AR C
u CR
CR u
s WR s
t AR AR t
o o
m MPLS m
AR CR CR AR
e e
r r
PoP PoP
s s
C AR AR C
u CR
CR u
s WR s
t AR AR t
o o
m MPLS m
AR CR CR AR
e e
r r
PoP PoP
s s
Another
Server Farm 1 Server Farm 2 solution for CsC
B. Claise © 2001, Cisco Systems, Inc. All rights reserved. 124
New
New Features
BGP Next Hop TOS aggregation
• Currently on EFT
Currently EFT, since September
• GSR will follow later:
BGP next hop in 12.0(26)S
• Available on a wide range of platforms
Initially 7200 & 7500 then 1720, 2600, 3600, 4500, 4700,
5800, RSP 7000, RSM (Cat5000), 7200, 7500, MGX
Router Processor Module (RPM), 8800, GSR
Origin AS Flows
Destination AS Packets
Output Interface
C AR AR C
u CR
CR u
s s
AR AR
t t
o o
m AR CR CR AR m
e e
r PoP PoP
r
s s
Server Farm 1 Server Farm 2
C AR AR C
u CR
CR u
s s
AR AR
t t
o o
m AR CR CR AR m
e e
r PoP PoP
r
s s
Server Farm 1 Server Farm 2
• From “PoP to BGP AS”, the POP being the AR or CR
• The external traffic matrix can influence the internal one
B. Claise © 2001, Cisco Systems, Inc. All rights reserved. 132
NetFlow BGP Next Hop TOS Aggregation
Issue
Lo0 [Link]
C75d13--1
C75d13 C75d13--2
C75d13
s0: 1.4.040
AS 112
MPLS or NOT ping [Link]
l0: [Link] ping [Link]
Lo1 [Link] C72d13--1
C72d13
c75d13-2#sh ip bgp
C75d13--1
C75d13 C75d13--2
C75d13
C72d13--1
C72d13
c75d13-2#sh ip bgp
Scalability
Scalability && Optimizing
Optimizing data
data for
for Technology
Technology
Flexibility
Flexibility Flow
Flow processing
processing Coverage
Coverage
• Cat6000/7600
Version 8 for the native mode
Native mode will support dual export
Add support for version 9
• Cat4000
NetFlow should be supported very soon
• File storage
Flat or binary and Aggregate Config
Files
compression in 3.0
• File cleanup
• Solaris and HP-UX
• No flow de-duplication Flow Consumer
Storage Applications
Well-defined
VPNSC Data Format
CNS Performance Engine
VPNSC-NetFlow data correlation § Customer
§ Site
CNS § CoS
NetFlow Summarize § Usage
Accounting Data
Per PE I/F
Engines
VPN1 Site1
PE1 VPN1 Site2
PE2
Y Bytes X Bytes
Billing
Access routers
7xxx
Aggr. routers
12000
core
Full NetFlow
Access routers
Accounting/Capacity planning
7xxx
Aggr. routers
12000
core