4.6 Troubleshoot NetFlow v9, Flexible NetFlow and IPFIX

ENARSI 300-410 v1.1 · 4.0 Infrastructure Services

NetFlow records who talked to whom: a flow is packets with the same key fields (source, destination, ports, protocol, ToS, input interface). The router caches flows and exports them to a collector. Traditional NetFlow v5/v9 uses fixed keys; Flexible NetFlow lets you choose them in a record; IPFIX (v10) is the IETF standard based on v9 templates.

What you must know

Flexible NetFlow

flow record APP
 match ipv4 source address
 match ipv4 destination address
 match transport destination-port
 match ipv4 protocol
 match interface input
 collect counter bytes long
 collect counter packets long
 collect timestamp absolute first
!
flow exporter NMS
 destination 10.0.99.40
 source GigabitEthernet0/2
 transport udp 2055
 export-protocol ipfix
!
flow monitor MON
 record APP
 exporter NMS
 cache timeout active 60
!
interface GigabitEthernet0/1
 ip flow monitor MON input

PC1's traffic creates a cache entry (1); the entry is exported when it times out (2): inactive timeout (15 s without packets) or active timeout (long flows are exported every 60 s here, 30 min by default).

Versions

VersionFormatNotes
v5Fixed fields, IPv4 onlyTraditional NetFlow; ip flow ingress + ip flow-export version 5
v9Template-basedIPv6, MPLS, any field; the collector needs the template first
IPFIX (v10)Template-based, IETF standardVariable-length fields, enterprise elements; UDP, TCP or SCTP
! Traditional NetFlow, for comparison
interface GigabitEthernet0/1
 ip flow ingress
ip flow-export destination 10.0.99.40 2055
ip flow-export version 9
ip flow-export source GigabitEthernet0/2

R1# show flow monitor MON cache
  Cache type:                               Normal (Platform cache)
  Current entries:                                 3

IPV4 SRC ADDR    IPV4 DST ADDR    TRNS DST PORT  IP PROT  intf input   bytes long  pkts long
10.10.10.20      10.0.50.80       443            6        Gi0/1        48211       61

Troubleshooting order

  1. Is the monitor on the right interface and direction? show flow interface Gi0/1.
  2. Is the cache filling? show flow monitor MON cache. Empty means no traffic matches or the wrong direction.
  3. Is the exporter sending? show flow exporter NMS statistics (packets sent, errors).
  4. Can the exporter's source reach the collector? Does the collector expect that address and UDP port?
  5. v9/IPFIX: has the collector received the template? It is resent periodically (template data timeout).

Commands

show flow monitor <name> cacheCurrent flows with key and data fields.
show flow exporter [name] statisticsExport packets sent and errors.
show flow interface [if]Which monitors are on each interface and direction.
show flow record [name]Key and non-key fields of a record.
show ip cache flowTraditional NetFlow cache.

Exam traps

Check yourself

Which fields does a v5 flow key on?
Source and destination IP, source and destination port, protocol, ToS and input interface.
Difference between match and collect in a flow record?
match fields define the flow key; collect fields are data gathered for each flow.
The collector receives packets but shows nothing. With v9, why?
It has not received the template yet (or it was lost), so it cannot decode the records.
When is a long-lived flow exported?
At each active timeout, and finally at the inactive timeout or when it ends.

Labs

Try it live: NetFlow v9 to a collector, then Flexible NetFlow over IPFIX

More topics in 4.0 Infrastructure Services