Repository navigation
Description
Problem
Exporters encode application identity differently, so application data needs to be mapped per vendor inside template handling and stored in the standard flow tables:
- Cisco NBAR2/AVC, Citrix SD-WAN and VMware SD-WAN send
applicationId(IE 95) as defined in RFC 6759: one classification engine byte (13 for NBAR2) followed by a selector, with names in an options template (IE 95 scope, IE 96 name, IE 94 description). - Fortinet sends IE 95 as 9 bytes, with names in an options template scoped on the system rather than on the application id, and its template ids change between firmware versions.
- Palo Alto sends the App-ID name inline as a string in an enterprise field (PEN 25461, field 56701) in its enterprise templates.
- SonicWall (PEN 8741, field 22) and Citrix NetScaler (PEN 5951) use their own private fields.
Today develop keys templates by exporter address and template id only, skips options templates, drops field 95 in the v9 path, and has no application column in the raw partitions. The NBAR work in #295 and #297 adds a second decoder in front of process_fv9() with its own template cache: any record carrying field 95 is treated as Cisco NBAR, stored as hex in a separate set of NBAR tables, and IPFIX is not covered.
Proposal
One template path for every vendor, with a match layer on top of it, built in stages:
- Template recording. Fix the template walk (NetFlow v9 and IPFIX template handling in the collector #326, IPFIX field decoding: reduced size, enterprise and variable length fields #327) and key templates by flow version, exporter, source id (v9) or observation domain (IPFIX), and template id (Key NetFlow v9 and IPFIX templates by exporter, observation domain and template id #338). Every template layout is recorded in
plugin_flowview_device_templates, including options templates. - Field dispatch. Look fields up by (enterprise number, element id); skip unknown fields by their length instead of failing the template. When a template is recorded, choose a vendor handler once for it from its enterprise numbers and fields (for example: IE 95 present with an RFC 6759 engine byte; PEN 25461 field 56701; PEN 8741 field 22), with a per-device vendor setting as an override for v9 exporters that cannot be told apart.
- Names from options data. Parse options records in the same walk (Read NetFlow v9 and IPFIX options records #339) and recognise application name tables by their fields (IE 95 with IE 96 or IE 94), whatever their scope, storing names per exporter and domain.
- Schema. Add nullable application columns to the raw flow partitions through a versioned upgrade, as was done for the post-NAT columns: an application key, classification engine, enterprise number, selector, inline name and how it was learned. Reports join names at query time; existing partitions get the columns on upgrade.
- Fallbacks. Name from the options table, else the inline vendor name, else optional user port rules, else show
engine:selector, and label the remaining traffic as unclassified.
This is the approach the mature collectors take: nfdump, pmacct, GoFlow2 and IPFIXcol2 key templates by exporter, domain and template id, skip unknown fields by length, and nfdump keeps the raw application id and joins names learned from options data when reporting. Commercial tools (SolarWinds NTA, ManageEngine, Kentik, ElastiFlow) trust the exporter's classification and add user rules on top.
Open questions
- Fortinet's 9-byte application id layout is not documented publicly; a capture from a FortiGate would settle it.
- SonicWall's application table template (261) fields, and Juniper, Check Point, Sophos and Meraki export formats, were not confirmed from primary sources.
- Whether application history should also keep the hourly and daily summaries from Application visibility in the raw flow partitions: Cisco NBAR2 and vendor equivalents (continues #295) #297, built on the standard tables instead of a separate table family.
Activity