Skip to main content

NetFlow

A network protocol developed by Cisco for collecting, analyzing, and monitoring network traffic. It captures metadata about IP traffic flows, providing insights into bandwidth usage, security threats, and network performance.

Versions

The netflow device collects NetFlow v5, the fixed-format legacy record. Datagrams declaring any other version are rejected.

NetFlow v9 is collected by the ipfix device, not this one. v9 introduced the template-based encoding that IPFIX later standardized, so DataStream handles both with the same collector.

Packet Header

Every v5 datagram opens with a header describing the flows that follow.

FieldDescription
VersionAlways 5
CountNumber of flow records in this datagram
SysUptimeMilliseconds since the exporter booted
UnixSecsExporter clock, seconds since the epoch
UnixNSecsResidual nanoseconds
FlowSequenceRunning count of flows exported, for loss detection
EngineTypeType of the switching engine
EngineIdSlot number of the switching engine
SamplingIntervalSampling mode and interval

SysUptime and UnixSecs are what make the per-flow timestamps interpretable—see First and Last below.

Flow Record

Each datagram carries up to 30 of these fixed-layout records.

FieldDescription
SrcAddrSource IP address
DstAddrDestination IP address
NextHopIP address of the next hop router
InputSNMP index of the input interface
OutputSNMP index of the output interface
DPktsNumber of packets in the flow
DOctetsTotal bytes transferred
FirstUptime in milliseconds at the first packet of the flow
LastUptime in milliseconds at the last packet of the flow
SrcPortSource port number
DstPortDestination port number
TCPFlagsCumulative OR of the TCP flags seen
ProtoIP protocol number
TosType of Service
SrcASSource Autonomous System number
DstASDestination Autonomous System number
SrcMaskSource address prefix length
DstMaskDestination address prefix length

First and Last are relative to SysUptime, not absolute times. Converting them to timestamps requires the header's SysUptime and UnixSecs.

Emitted Fields

The names above are those of the NetFlow record on the wire. They are not the field names that reach a pipeline: the collector converts each record to ECS 8.11.0 before emitting it, so a flow arrives as source.ip, destination.port, network.bytes and their siblings.