IPFIX

IPFIX

IPFIX

IPFIX flow-export configuration and a console monitor for IPFIX export records. set and get write and read the IPFIX configuration of a port. start and stop control a monitor that prints or counts the exported records. Type the sub-command in full; abbreviations are not accepted.

With no argument the command prints the monitor status (IPFIX Deamon Status: <Running|Not Running>.), the report options and the number of records received.

Trident 3 has no IPFIX engine. On a SONiC Trident 3 switch ipfix get fails with IPFIX: ERROR: Feature unavailable followed by Failed to execute the diagnostic command. Error: Operation failed., and set fails the same way. SONiC does not use this command.

Status, report without options and get are read-only. start, stop and report +… change only the shell’s monitor. set writes the port’s IPFIX configuration into the switch.

Unvalidated — Monitor status

drivshell> IPFIX
IPFIX start

Start the IPFIX monitor: turn on the export FIFO, polled once a second, and print or count the received records. IPFIX stop stops it. Starting it twice prints <cmd>: IPFIX thread already running..

Unvalidated

drivshell> ipfix start
IPFIX report [<+|-><option> ...]

Show the report options (IPFIX Reporting on for: / off for:), or turn them on with + and off with -. The options are Count, Decode and @ALL (or @*).

Unvalidated

drivshell> ipfix report +Decode
IPFIX set Port=<n> [Stage=<n>] [<Key>=<1|0> ...] [Ip4SrcMask=<ip>] [DscpMap=<identical|zero>] [Limit=<n>] [MinTime=<n>] [MaxTime=<n>] [MaxIdleTime=<n>] [SampleRate=<n>]

Apply an IPFIX configuration to one port and stage. Port is a port number, not a port name. The keys are:

  • what to record: EnableL2, EnableIp4, EnableIp6, RecordNonDiscard, RecordDiscard, CheckFlowEnd, UseL2ForIp4, UseL2ForIp6

  • flow key fields: KeySrcIp, KeyDstIp, KeyIpProt, KeyIpDscp, KeyIpEcn, KeyL4SrcPort, KeyL4DstPort, KeyIp6Flow, KeyIcmpType, KeyIcmpCode, KeyMacDa, KeyMacSa, KeyVlanId, KeyVlanPri, KeyEtherType, KeyVlanTagged and KeySourcePort. KeySourcePort is not in the built-in help.

  • address masks: Ip4SrcMask, Ip4DstMask, TunnelIp4SrcMask, TunnelIp4DstMask (IPv4), and Ip6SrcMask, Ip6DstMask, TunnelIp6SrcMask, TunnelIp6DstMask (IPv6)

  • DscpMap: identical (the default) keeps the DSCP, zero clears it

  • Limit (entry limit, default 8191), MinTime, MaxTime, MaxIdleTime (default 32767) and SampleRate (default 1)

The built-in help writes the time keys as MaXTime, MiNTime and MaxIdletime. The shell accepts MinTime, MaxTime and MaxIdleTime, so the short forms the help suggests may not work. Type these keys in full. A key the shell does not know prints the usage.

Unvalidated

drivshell> ipfix set Port=1 EnableIp4=1 KeySrcIp=1 KeyDstIp=1 KeyIpProt=1 KeyL4SrcPort=1 KeyL4DstPort=1
IPFIX get Port=<n> [Stage=<n>]

Print a port’s IPFIX configuration: one BCM_IPFIX_CONFIG_* name per enabled option, then entry_limit=<n> min_time=<n> max_time=<n>, max_idle_time=<n> sample_rate=<n> and the four address masks. get is not in the built-in help. Read-only.

Hardware-validated

drivshell> ipfix get Port=1
IPFIX: ERROR: Feature unavailable

Failed to execute the diagnostic command. Error: Operation failed.

Built-in help

Parameters: [report +/-<values>] [set <values>] [stop|start]
      start  - Start the IPFIX deamon
      stop   - Stop the IPFIX deamon
      report - Configure reporting to the console
          count   - print export entry # only
          decode  - dump decoded export entry
          Prepend + to set, - to clear
      set    - Configure IPFIX for a port
         Port=<port> [Stage=<stage>] [EnableL2=<1/0>] [EnableIp4=<1/0>]
         [EnableIp6=<1/0>] [RecordNonDiscard=<1/0>] [RecordDiscard=<1/0>]
         [CheckFlowEnd=<1/0>] [UseL2ForIp4=<1/0>] [UseL2ForIp6=<1/0>]
         [KeySrcIp=<1/0>] [KeyIpProt=<1/0>] [KeyIpDscp=<1/0>] [KeyIpEcn=<1/0>]
         [KeyDstIp=<1/0>] [KeyIpEcn=<1/0>] [KeyL4SrcPort=<1/0>] [KeyL4DstPort=<1/0>]
         [KeyIp6Flow=<1/0>] [KeyIcmpType=<1/0>] [KeyIcmpCode=<1/0>] [KeyMacDa=<1/0>]
         [KeyMacSa=<1/0>] [KeyVlanId=<1/0>] [KeyVlanPri=<1/0>] [KeyEtherType=<1/0>]
         [KeyVlanTagged=<1/0>] [TunnelIp4SrcMask=<adr>]
         [TunnelIp4DstMask=<adr>] [TunnelIp6SrcMask=<adr>]
         [Ip4SrcMask=<adr>][Ip4DstMask=<adr>]
         [Ip6SrcMask=<adr>][Ip6DstMask=<adr>]
         [DscpMap=zero|identical][Limit=<val>]
         [MaXTime=<val>][MiNTime=<val>]
         [MaxIdletime=<val>][SampleRate=<val>]

Further reading

BCM_SDK命令.