Skip to content

Flow

Configure NetFlow/IPFIX flow monitoring for traffic analysis on IOS-XR devices. Flow configuration includes exporter maps that define where flow data is sent (destination, transport, version parameters), monitor maps that define how flow data is collected (record format, exporter destination, cache parameters), and sampler maps that define sampling rates and methods for capturing network traffic patterns.

Diagram
NameTypeConstraintMandatoryDefault Value
flowClass[flow]No

NameTypeConstraintMandatoryDefault Value
exportersList[exporters]No
monitorsList[monitors]No
samplersList[samplers]No

exporters (iosxr.devices.configuration.flow)

Section titled “exporters (iosxr.devices.configuration.flow)”
NameTypeConstraintMandatoryDefault Value
nameStringYes
destination_addressAnyIP or String or String[Regex: ^.*[\$\%]\{.*$]No
destination_vrfStringNo
dfbit_setBooleantrue, falseNo
dscpIntegermin: 0, max: 63No
packet_lengthIntegermin: 512, max: 9000No
router_idAnyIP or String or String[Regex: ^.*[\$\%]\{.*$]No
source_addressAnyIP or String or String[Regex: ^.*[\$\%]\{.*$]No
source_interfaceStringNo
transportClass[transport]No
versionClass[version]No

monitors (iosxr.devices.configuration.flow)

Section titled “monitors (iosxr.devices.configuration.flow)”
NameTypeConstraintMandatoryDefault Value
nameStringYes
cacheClass[cache]No
exportersList[exporters]No
optionsClass[options]No
recordClass[record]No

samplers (iosxr.devices.configuration.flow)

Section titled “samplers (iosxr.devices.configuration.flow)”
NameTypeConstraintMandatoryDefault Value
nameStringmax: 32Yes
out_ofIntegermin: 1, max: 262144No
randomIntegermin: 1, max: 1No

transport (iosxr.devices.configuration.flow.exporters)

Section titled “transport (iosxr.devices.configuration.flow.exporters)”
NameTypeConstraintMandatoryDefault Value
udp_destinationIntegermin: 1024, max: 65535No

version (iosxr.devices.configuration.flow.exporters)

Section titled “version (iosxr.devices.configuration.flow.exporters)”
NameTypeConstraintMandatoryDefault Value
formatChoicev9, ipfix, sflow, protobufNo
optionsClass[options]No
templateClass[template]No

cache (iosxr.devices.configuration.flow.monitors)

Section titled “cache (iosxr.devices.configuration.flow.monitors)”
NameTypeConstraintMandatoryDefault Value
entriesIntegermin: 4096, max: 1000000No
hw_timeout_inactiveIntegermin: 50, max: 1800No
timeout_activeIntegermin: 1, max: 604800No
timeout_inactiveIntegermin: 0, max: 604800No
timeout_rate_limitIntegermin: 1, max: 1000000No
timeout_updateIntegermin: 1, max: 604800No
typeChoiceimmediate, permanentNo

exporters (iosxr.devices.configuration.flow.monitors)

Section titled “exporters (iosxr.devices.configuration.flow.monitors)”
NameTypeConstraintMandatoryDefault Value
nameStringYes

options (iosxr.devices.configuration.flow.monitors)

Section titled “options (iosxr.devices.configuration.flow.monitors)”
NameTypeConstraintMandatoryDefault Value
bgpattrBooleantrue, falseNo
filteredBooleantrue, falseNo
outbundlememberBooleantrue, falseNo
outphysintBooleantrue, falseNo
sflowBooleantrue, falseNo
sflow_extended_gatewayBooleantrue, falseNo
sflow_extended_ipv4_tunnel_egressBooleantrue, falseNo
sflow_extended_ipv6_tunnel_egressBooleantrue, falseNo
sflow_extended_routerBooleantrue, falseNo
sflow_if_counters_polling_intervalIntegermin: 5, max: 1800No
sflow_input_ifindexChoicephysicalNo
sflow_output_ifindexChoicephysicalNo
sflow_sample_header_sizeIntegermin: 128, max: 343No

record (iosxr.devices.configuration.flow.monitors)

Section titled “record (iosxr.devices.configuration.flow.monitors)”
NameTypeConstraintMandatoryDefault Value
datalink_recordBooleantrue, falseNo
default_mdiBooleantrue, falseNo
default_rtpBooleantrue, falseNo
ipv4Booleantrue, falseNo
ipv4_asBooleantrue, falseNo
ipv4_as_tosBooleantrue, falseNo
ipv4_bgp_nexthop_tosBooleantrue, falseNo
ipv4_destinationBooleantrue, falseNo
ipv4_destination_prefixBooleantrue, falseNo
ipv4_destination_prefix_tosBooleantrue, falseNo
ipv4_destination_tosBooleantrue, falseNo
ipv4_extendedBooleantrue, falseNo
ipv4_gtpBooleantrue, falseNo
ipv4_l2_l3Booleantrue, falseNo
ipv4_peer_asBooleantrue, falseNo
ipv4_prefixBooleantrue, falseNo
ipv4_prefix_portBooleantrue, falseNo
ipv4_prefix_tosBooleantrue, falseNo
ipv4_protocol_portBooleantrue, falseNo
ipv4_protocol_port_tosBooleantrue, falseNo
ipv4_source_prefixBooleantrue, falseNo
ipv4_source_prefix_tosBooleantrue, falseNo
ipv6Booleantrue, falseNo
ipv6_destinationBooleantrue, falseNo
ipv6_extendedBooleantrue, falseNo
ipv6_gtpBooleantrue, falseNo
ipv6_l2_l3Booleantrue, falseNo
ipv6_peer_asBooleantrue, falseNo
ipv6_srv6Booleantrue, falseNo
map_tBooleantrue, falseNo
mplsBooleantrue, falseNo
mpls_ipv4_fieldsBooleantrue, falseNo
mpls_ipv4_ipv6_fieldsBooleantrue, falseNo
mpls_ipv6_fieldsBooleantrue, falseNo
mpls_labelsIntegermin: 1, max: 6No
sflowBooleantrue, falseNo

options (iosxr.devices.configuration.flow.exporters.version)

Section titled “options (iosxr.devices.configuration.flow.exporters.version)”
NameTypeConstraintMandatoryDefault Value
class_table_timeoutIntegermin: 0, max: 604800No
interface_table_timeoutIntegermin: 0, max: 604800No
sampler_table_timeoutIntegermin: 0, max: 604800No
vrf_table_timeoutIntegermin: 0, max: 604800No

template (iosxr.devices.configuration.flow.exporters.version)

Section titled “template (iosxr.devices.configuration.flow.exporters.version)”
NameTypeConstraintMandatoryDefault Value
data_timeoutIntegermin: 1, max: 604800No
options_timeoutIntegermin: 1, max: 604800No
timeoutIntegermin: 1, max: 604800No

Example-1: Flow exporter with v9 export format.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
flow:
exporters:
- name: EXPORTER1
destination_address: 192.0.2.1
destination_vrf: "MGMT"
source_interface: GigabitEthernet0/0/0/1
dscp: 46
packet_length: 1468
dfbit_set: true
transport:
udp_destination: 5000
version:
format: v9
template:
data_timeout: 600
options_timeout: 600
timeout: 600
options:
interface_table_timeout: 600
sampler_table_timeout: 600
class_table_timeout: 255
vrf_table_timeout: 300

Example-2: IPv4 flow monitoring with exporter and sampler.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
flow:
exporters:
- name: EXPORTER1
destination_address: 192.0.2.1
transport:
udp_destination: 9995
version:
format: v9
monitors:
- name: "FLOW_MONITOR_IPV4"
record:
ipv4: true
exporters:
- name: "EXPORTER1"
cache:
entries: 10000
timeout_active: 60
timeout_inactive: 15
samplers:
- name: "SAMPLER_1"
random: 1
out_of: 1000

Example-3: IPv4 extended monitoring with sFlow options.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
flow:
exporters:
- name: EXPORTER1
destination_address: 10.0.0.1
transport:
udp_destination: 9995
version:
format: v9
- name: SFLOW_EXPORTER
destination_address: 10.0.0.2
transport:
udp_destination: 6343
version:
format: sflow
monitors:
- name: "FLOW_IPV4_EXTENDED"
record:
ipv4_extended: true
exporters:
- name: "EXPORTER1"
cache:
entries: 50000
timeout_active: 120
timeout_inactive: 30
timeout_update: 60
options:
outphysint: true
filtered: true
- name: "SFLOW_MONITOR"
record:
sflow: true
options:
sflow: true
sflow_extended_router: true
sflow_extended_gateway: true
sflow_if_counters_polling_interval: 300
sflow_sample_header_size: 256
sflow_input_ifindex: physical
sflow_output_ifindex: physical
exporters:
- name: "SFLOW_EXPORTER"
cache:
entries: 100000
timeout_inactive: 60
samplers:
- name: "HIGH"
random: 1
out_of: 100
- name: "LOW"
random: 1
out_of: 10000

Example-4: Hardware cache with immediate mode.

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
flow:
monitors:
- name: "HW_FLOW_MONITOR"
record:
ipv4: true
exporters:
- name: "EXPORTER1"
cache:
entries: 500000
timeout_active: 300
timeout_inactive: 60
timeout_rate_limit: 5000
type: immediate
hw_timeout_inactive: 300
options:
bgpattr: true
outbundlemember: true