NetFlow v5, v9, IPFIX or sFlow? Which protocol to export to EdgeWarden

What each protocol carries, how much it delays DDoS detection and which one to configure in each scenario, on ports 2055 and 6343.

Why the protocol choice matters

EdgeWarden receives NetFlow v5, NetFlow v9 and IPFIX on 2055/UDP and sFlow v5 on 6343/UDP. All four feed the same detection engine, but they don't deliver the same data: your choice decides whether you see IPv6 and VRFs, and whether an alarm fires in under a second or after a full minute.

This guide compares the four, shows which one to pick in each scenario and covers the configuration that applies to every vendor. Full commands are in the per-platform guides.

Prerequisites

  • EdgeWarden installed per the installation guide, with the collector at 192.0.2.10 in the examples.
  • An edge router with a fixed source address for export, preferably the loopback (198.51.100.1 in the examples).
  • A free exporter slot on your license (Starter 1, Professional 2, Enterprise 10). Over the quota, flows are dropped with no error on screen.

What each protocol carries

NetFlow v5NetFlow v9IPFIXsFlow v5
StandardCisco, fixed formatRFC 3954RFC 7011 (version 10)sflow.org
Port on EdgeWarden2055/UDP2055/UDP2055/UDP6343/UDP
FormatFixed recordTemplateTemplate, variable-length and enterprise fieldsPacket sample + counters
IPv6NoYesYesYes
VRF (IE 234/235)NoYes, if in the templateYes, if in the templateNo
BGP next hopNoIPv4IPv4 and IPv6Extended Gateway
Sampling rateManual entryAnnounced (Options Template)Announced (Options Template)In every sample
HTTP Host, TLS SNI, DNSNoNoWith packet sectionYes, from the sampled header

NetFlow v5 is a fixed-size IPv4 5-tuple, with 16-bit interface indexes and ASNs. v9 replaced the fixed record with templates: the router declares which fields it will send, which brings IPv6, VRF, direction and the announced sampling rate. IPFIX is the IETF standardization of v9, with version 10 in the header, fields (Information Elements) from the IANA registry and variable-length fields.

sFlow doesn't build flows. The device randomly picks 1 out of every N packets, copies the start of the header (128 bytes by default) and sends it along with interface counters. The collector rebuilds traffic from the samples.

With v5, EdgeWarden reads the sampling field from the header but does not apply it. If you don't fill in the rate on the device record, a router sampling at 1:1000 shows one thousandth of the real traffic and every threshold becomes meaningless.

Detection latency: active timeout vs. sampling

The EdgeWarden engine runs analysis cycles every 10 s (configurable down to 1 s). What differs between protocols is how long the data takes to arrive.

With NetFlow and IPFIX, the router keeps each flow in its cache and only exports it when the flow ends (inactive timeout) or hits the active timeout. A sustained volumetric attack against a customer is a long-lived flow, so it only shows up after the active timeout. At 60 seconds, the alarm can only fire after those 60 s plus the analysis cycle. Lower values detect faster and add load on the router and the collector.

With sFlow, the agent sends each sample within 1 second at most, per the specification. EdgeWarden uses that in its burst detector: a 1 s window in 100 ms buckets per destination, firing from 5 Gbps or 2 Mpps. This detector only runs when the analysis cycle is below 5 s; at the default 10 s it is off. Sub-second detection requires sFlow or the Packet Sensor plus a shorter cycle.

The trade-off with sFlow is accuracy at low volumes. At 1:1000, a 1 Mpps flood yields about 1,000 samples per second and is measured comfortably, but a 500 pps stream yields one sample every two seconds and becomes a rough estimate.

What IPFIX adds

When the exporter sends them, EdgeWarden uses these IPFIX fields. VRF and the IPv4 BGP next hop also arrive over NetFlow v9; the IPv6 next hop, tunnel fields and packet section come only over IPFIX:

  • BGP next hop for IPv4 and IPv6 (IE 18 and 63), to see which neighbor the attacked traffic leaves through.
  • Ingress and egress VRF (IE 234 ingressVRFID and 235 egressVRFID), which feed the per-VRF visibility screen on L3VPN networks.
  • Tunnel fields, such as the VxLAN and GENEVE VNI (IE 351) and the outer tunnel addresses.
  • Packet section (IE 313 to 317), aka inline monitoring: a slice of the real packet inside the record. With the Ethernet frame (IE 315), EdgeWarden extracts HTTP Host, TLS SNI and DNS queries for the Applications screen.

EdgeWarden also writes a warning to the core log (/opt/flowspec-analyzer/logs/core.log.*, message Exportador não envia) when a field a detector depends on is missing: without tcpControlBits (IE 6), the TCP flag detectors go idle; without minimumTTL (IE 52) or the fragmentation fields (IE 88 and 197), so do TTL Variance and Fragment Flood.

Which one to pick for each scenario

ScenarioPickWhy
Edge router with IPFIXIPFIXIPv6, VRF, BGP next hop and announced rate
Device without IPFIXNetFlow v9Templates, IPv6 and VRF
You need to react to sub-second burstssFlow or Packet SensorNo cache, no active timeout
You want applications (SNI, Host, DNS) without a dedicated sensorsFlow, or IPFIX with packet sectionThe data comes from the sampled packet
Legacy device that only speaks v5NetFlow v5IPv4 only, with the rate entered manually

When in doubt, use IPFIX: it covers IPv4 and IPv6 and announces its own sampling rate.

Step 1: open the ports on the server

Allow collection only from each router's source IP. Anyone who can reach 2055/UDP can inject forged flows.

EdgeWarden server: firewall by source
# NetFlow v5/v9 and IPFIX
sudo ufw allow from 198.51.100.1 to any port 2055 proto udp
# sFlow, only if the device exports sFlow
sudo ufw allow from 198.51.100.1 to any port 6343 proto udp
sudo ufw status numbered

Step 2: choose the version and port on the router

The version is an exporter setting. Where it lives on each platform:

VendorWhere to set itIPFIXNetFlow v9
Juniper MX (inline J-Flow)services flow-monitoring and the sampling instance flow-serverversion-ipfixversion9
Huawei NE40E/NE8000ip netstream export versionipfix9
Cisco IOS-XEflow exporterexport-protocol ipfixexport-protocol netflow-v9
Cisco IOS-XRflow exporter-mapversion ipfixversion v9
MikroTik RouterOS v7/ip traffic-flow targetversion=ipfixversion=9

On all of them, point the destination to 192.0.2.10 on port 2055, IPFIX included. These keywords apply to current releases of each OS; on older releases, check the vendor documentation to confirm the IPFIX option exists.

The registered port for IPFIX is 4739 (RFC 7011), and many configuration examples use it. EdgeWarden listens for NetFlow and IPFIX together on 2055 and identifies the version from the first two bytes of the packet. Always set port 2055 explicitly on the exporter.

Step 3: timeouts and sampling

  • Active timeout: 60 s is the common starting point. Lower values detect faster and add load.
  • Inactive timeout: 15 s.
  • Template refresh: every 60 s or less. Over UDP, the collector drops records until it receives the template, for example after a restart.
  • Sampling: use the same rate on all interfaces of a router. The rate is per exporter, not per interface.

EdgeWarden multiplies bytes and packets by the rate before storing them. A rate announced via Options Template (v9 and IPFIX) always wins; with no announcement, the Taxa de Amostragem de Flow (flow sampling rate) on the device record applies; with sFlow, the rate comes in every sample.

Step 4: register the device

Under Configurações → Rede → Dispositivos (Settings → Network → Devices), add the router with:

  1. Endereço IP (IP address) matching the export source (198.51.100.1). If it doesn't match, interfaces show up as if:12 instead of their names.
  2. SNMP: the flow only carries the ifIndex; interface name and capacity come from SNMP. Export the ingress and egress interfaces in the template.
  3. Taxa de Amostragem de Flow, mandatory for v5 and recommended when the router doesn't announce its rate.

Verification on the router

Confirm which version the device is exporting:

VendorCommandWhat to check
Juniper MXshow services accounting status inline-jflow fpc-slot 0IPV4 export format: Version-IPFIX
Huawei NEdisplay netstream globalThe export version and the configured host
Cisco IOS-XEshow flow exporter EW-EXPExport protocol: IPFIX (Version 10) and port 2055
Cisco IOS-XRshow flow exporter-map EW-EXPExport Version: IPFIX and TransportDestPort: 2055
MikroTik v7/ip traffic-flow target printversion and port

Verification on EdgeWarden

The first two bytes of NetFlow and IPFIX are the version: 0005, 0009 or 000a (IPFIX). In an IPv4 packet without options, they are the seventh group on the 0x0010 line of tcpdump -x:

EdgeWarden server: which version is arriving on 2055
sudo tcpdump -i any -n -c 1 -x udp dst port 2055 and src host 198.51.100.1
10:15:02.481233 ens18 In  IP 198.51.100.1.40312 > 192.0.2.10.2055: UDP, length 1380
        0x0000:  4500 0580 1a2b 0000 3f11 7003 c633 6401
        0x0010:  c000 020a 9d78 0807 056c 3c1e 000a 0564

For sFlow, tcpdump itself decodes the header on 6343:

EdgeWarden server: sFlow arriving on 6343
sudo tcpdump -i any -n -c 3 udp dst port 6343
10:15:04.102877 ens18 In  IP 198.51.100.1.50000 > 192.0.2.10.6343: sFlowv5, IPv4 agent 198.51.100.1, agent-id 0, length 1316

The line should show sFlowv5, the agent IP and the datagram length.

Then, in the web UI:

  1. Within 1 to 2 minutes, flows show up on the Flows screen.
  2. Under Dispositivos (Devices), the rate carries the detectado (detected, announced via v9 or IPFIX) or manual badge; cadastro: 1:N (ignorado) means the router announces a different value.
  3. In the Fluxo × SNMP nas interfaces panel on the Análise do instante screen, flow volume should match SNMP. If it shows 1/N, the rate is missing; if it shows N times, it was applied twice.

Common pitfalls

  • IPFIX on 4739. The collector receives nothing and tcpdump on 2055 stays empty. Capture with udp port 4739 to confirm.
  • Huawei on v5 without noticing. Per Huawei's documentation, the default format for ip netstream export version is v5: without the command, the NE exports v5, with no IPv6 and no announced rate.
  • High default active timeout. RouterOS defaults to 30 minutes: an attack only shows up once it ends or 30 minutes after it starts. Lower active-flow-timeout to 1m.
  • The same traffic through two paths. Two targets for the same collector, or sFlow and IPFIX from the same interfaces, count the traffic twice.
  • Full receive buffer. Check nstat -az | grep -iE "Udp.*(InErrors|RcvbufErrors)" and apply the sysctl settings from the installation guide.

Next steps

Now follow the guide for your platform: Juniper MX with inline J-Flow, Huawei NE40E/NE8000, Cisco Flexible NetFlow or MikroTik RouterOS v7. If flows don't show up, use the flow troubleshooting checklist. To tune the rate and timeouts, see sampling and timeouts; for VRF and BGP next hop, the advanced IPFIX guide. For ports and collector tuning, go back to the installation guide; under Features, see how these flows turn into detection and mitigation.

Related articles

All articles

Want to see these flows in EdgeWarden?

Create your account in the Customer area and generate the demo license: 7 days with every Enterprise feature, on your own server. Then follow the installation guide to bring up the collector.