| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540 | <!-- Creator     : groff version 1.22.4 --><!-- CreationDate: Sat Aug 13 06:54:00 2022 --><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><meta name="generator" content="groff -Thtml, see www.gnu.org"><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><meta name="Content-Style" content="text/css"><style type="text/css">       p       { margin-top: 0; margin-bottom: 0; vertical-align: top }       pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }       table   { margin-top: 0; margin-bottom: 0; vertical-align: top }       h1      { text-align: center }</style><title></title></head><body><hr><p>SOFTFLOWD(8) BSD System Manager’s ManualSOFTFLOWD(8)</p><p style="margin-top: 1em"><b>NAME</b></p><p style="margin-left:6%;"><b>softflowd</b> — Trafficflow monitoring</p><p style="margin-top: 1em"><b>SYNOPSIS</b></p><p style="margin-left:19%;"><b>softflowd</b>[<b>-6dDhbalN</b>] [<b>-L </b><i>hoplimit</i>][<b>-T </b><i>track_level</i>][<b>-c </b><i>ctl_sock</i>] [</p><p><b>-i </b> [ <i><br>if_ndx</i>:]<i>interface</i> ][<b>-m </b><i>max_flows</i>][<b>-n </b><i>host:port</i>][<b>-p </b><i>pidfile</i>][<b>-r </b><i>pcap_file</i>][<b>-t </b><i>timeout_name=seconds</i>][<b>-v </b><i>netflow_version</i>][<b>-P </b><i>transport_protocol</i>][<b>-A </b><i>time_format</i>][<b>-s </b><i>sampling_rate</i>][<b>-C </b><i>capture_length</i>][<b>-R </b><i>receive_port</i>][<b>-S </b><i>send_interface_name</i>][<b>-x </b><i>number_of_mpls_labels</i>][bpf_expression]</p><p style="margin-top: 1em"><b>DESCRIPTION</b></p><p style="margin-left:6%;"><b>softflowd</b> is a softwareimplementation of a flow-based network traffic monitor.<b>softflowd</b> reads network traffic and gathersinformation about active traffic flows. A "trafficflow" is communication between two IP addresses or (ifthe overlying protocol is TCP or UDP) address/porttuples.</p><p style="margin-left:6%; margin-top: 1em">The intended useof <b>softflowd</b> is as a software implementation ofCisco’s NetFlow(tm) traffic account system.<b>softflowd</b> supports data export using versions 1, 5, 9or 10 (a.k.a. IPFIX) of the NetFlow protocol.<b>softflowd</b> can also run in statistics-only mode, whereit just collects summary information. However, too fewstatistics are collected to make this mode really useful foranything other than debugging.</p><p style="margin-left:6%; margin-top: 1em">Network trafficmay be obtained by listening on a promiscuous networkinterface (unless the <b>-N</b> option is given) or byreading stored pcap(3) files, such as those written bytcpdump(8). Traffic may be filtered with an optional bpf(4)program, specified on the command-line as<i>bpf_expression</i>. <b>softflowd</b> is IPv6 capable andwill track IPv6 flows if the NetFlow export protocolsupports it (currently only NetFlow v.9 possesses an IPv6export capability).</p><p style="margin-left:6%; margin-top: 1em"><b>softflowd</b>tries to track only active traffic flows. When the flow hasbeen quiescent for a period of time it is expiredautomatically. Flows may also be expired early if theyapproach their traffic counts exceed 2 Gib or if the numberof flows being tracked exceeds <i>max_flows</i> (default:8192). In this last case, flows are expiredoldest-first.</p><p style="margin-left:6%; margin-top: 1em">Upon expiry, theflow information is accumulated into statistics which may beviewed using softflowctl(8). If the <b>-n</b> option hasbeen specified the flow information is formatted in a UDPdatagram which is compatible with versions 1, 5 or 9 ofCisco’s NetFlow(tm) accounting export format. Theserecords are sent to the specified <i>host</i> and<i>port</i>. The host may represent a unicast host or amulticast group.</p><p style="margin-left:6%; margin-top: 1em">The command-lineoptions are as follows:</p><p style="margin-top: 1em"><b>-n</b> <i>host:port</i></p><p style="margin-left:17%;">Specify the <i>host</i> and<i>port</i> that the accounting datagrams are to be sent to.The host may be specified using a hostname or using anumeric IPv4 or IPv6 address. Numeric IPv6 addresses shouldbe enclosed in square brackets to avoid ambiguity betweenthe address and the port. The destination port may be aportname listed in services(5) or a numeric port. Comma canbe used for specifying multiple destinations.</p><p style="margin-top: 1em"><b>-N</b></p><p style="margin-left:17%; margin-top: 1em">Do not put theinterface into promiscuous mode. Note that the interfacemight be in promiscuous mode for some other reason.</p><p style="margin-top: 1em"><b>-i</b> <br>[ <i><br>if_ndx</i>:]<i>interface</i></p><p style="margin-left:17%;">Specify a network interface onwhich to listen for traffic. Either the <b>-i</b> or the<b>-r</b> options must be specified.</p><p style="margin-top: 1em"><b>-r</b> <i>pcap_file</i></p><p style="margin-left:17%;">Specify that <b>softflowd</b>should read from a pcap(3) packet capture file (such as onecreated with the <b>-w</b> option of tcpdump(8)) file ratherthan a network interface. <b>softflowd</b> processes thewhole capture file and only expires flows when<i>max_flows</i> is exceeded. In this mode, <b>softflowd</b>will not fork and will automatically print summarystatistics before exiting.</p><p style="margin-top: 1em"><b>-p</b> <i>pidfile</i></p><p style="margin-left:17%;">Specify an alternate locationto store the process ID when in daemon mode. Default is<i>/var/run/softflowd.pid</i></p><p style="margin-top: 1em"><b>-c</b> <i>ctlsock</i></p><p style="margin-left:17%;">Specify an alternate locationfor the remote control socket in daemon mode. Default is<i>/var/run/softflowd.ctl</i></p><p style="margin-top: 1em"><b>-m</b> <i>max_flows</i></p><p style="margin-left:17%;">Specify the maximum number offlows to concurrently track. If this limit is exceeded, theflows which have least recently seen traffic are forciblyexpired. In practice, the actual maximum may briefly exceedthis limit by a small amount as expiry processing happensless frequently than traffic collection. The default is 8192flows, which corresponds to slightly less than 800k ofworking data.</p><p style="margin-top: 1em"><b>-t</b><i>timeout_name=time</i></p><p style="margin-left:17%;">Set the timeout names<i>timeout_name</i> to <i>time</i>. Refer to the<i>Timeouts</i> section for the valid timeout names andtheir meanings. The <i>time</i> parameter may be specifiedusing one of the formats explained in the <i>TimeFormats</i> section below.</p><p style="margin-top: 1em"><b>-d</b></p><p style="margin-left:17%; margin-top: 1em">Specify that<b>softflowd</b> should not fork and daemonise itself.</p><p style="margin-top: 1em"><b>-6</b></p><p style="margin-left:17%; margin-top: 1em">Force<b>softflowd</b> to track IPv6 flows even if the NetFlowexport protocol does not support reporting them. This isuseful for debugging and statistics gathering only.</p><p style="margin-top: 1em"><b>-D</b></p><p style="margin-left:17%; margin-top: 1em">Places<b>softflowd</b> in a debugging mode. This implies the<b>-d</b> and <b>-6</b> flags and turns on additionaldebugging output.</p><p style="margin-top: 1em"><b>-B</b> <i>size_bytes</i></p><p style="margin-left:17%;">Libpcap buffer size inbytes</p><p style="margin-top: 1em"><b>-b</b></p><p style="margin-left:17%; margin-top: 1em">Bidirectionalmode in IPFIX (-b work with -v 10)</p><p style="margin-top: 1em"><b>-a</b></p><p style="margin-left:17%; margin-top: 1em">Adjusting timefor reading pcap file (-a work with -r)</p><p style="margin-top: 1em"><b>-l</b></p><p style="margin-left:17%; margin-top: 1em">Load balancingmode for multiple destinations which are specified with-n</p><p style="margin-top: 1em"><b>-x</b><i>number_of_mpls_labels</i></p><p style="margin-left:17%;">specify number of mpls labelsfor export</p><p style="margin-top: 1em"><b>-h</b></p><p style="margin-left:17%; margin-top: 1em">Displaycommand-line usage information.</p><p style="margin-top: 1em"><b>-L</b> <i>hoplimit</i></p><p style="margin-left:17%;">Set the IPv4 TTL or the IPv6hop limit to <i>hoplimit</i>. <b>softflowd</b> will use thedefault system TTL when exporting flows to a unicast host.When exporting to a multicast group, the default TTL will be1 (i.e. link-local).</p><p style="margin-top: 1em"><b>-T</b> <i>track_level</i></p><p style="margin-left:17%;">Specify which flow elements<b>softflowd</b> should be used to define a flow.<i>track_level</i> may be one of: “ether” (trackeverything including source and destination addresses,source and destination port, source and destination ethernetaddress, vlanid and protocol), “vlan” (tracksource and destination addresses, source and destinationport, vlanid and protocol), “full” (track sourceand destination addresses, source and destination port andprotocol in the flow, the default), “proto”(track source and destination addresses and protocol), or“ip” (only track source and destinationaddresses). Selecting either of the latter options willproduce flows with less information in them (e.g. TCP/UDPports will not be recorded). This will cause flows to beconsolidated, reducing the quantity of output and CPU loadthat <b>softflowd</b> will place on the system at the costof some detail being lost.</p><p style="margin-top: 1em"><b>-v</b><i>netflow_version</i></p><p style="margin-left:17%;">Specify which version of theNetFlow(tm) protocol <b>softflowd</b> should use for exportof the flow data. Supported versions are 1, 5, 9, 10(IPFIX),and psamp. Default is version 5.</p><p style="margin-top: 1em"><b>-P</b><i>transport_protocol</i></p><p style="margin-left:17%;">Specify transport layerprotocol for exporting packets. Supported transport layerprotocols are udp, tcp, and sctp.</p><p style="margin-top: 1em"><b>-A</b> <i>time_format</i></p><p style="margin-left:17%;">Specify absolute time formatform exporting records. Supported time formats are sec,milli, micro, and nano.</p><p style="margin-top: 1em"><b>-s</b><i>sampling_rate</i></p><p style="margin-left:17%;">Specify periodical samplingrate (denominator).</p><p style="margin-top: 1em"><b>-C</b><i>capture_length</i></p><p style="margin-left:17%;">Specify length for packetcapture (snaplen).</p><p style="margin-top: 1em"><b>-R</b><i>receive_port</i></p><p style="margin-left:17%;">Specify port number for PSAMPreceive mode.</p><p style="margin-top: 1em"><b>-S</b><i>send_interface_name</i></p><p style="margin-left:17%;">Specify send interface name.(This option works on Linux only because of use ofSO_BINDTODEVICE for setsockopt.)</p><p style="margin-left:6%; margin-top: 1em">Any furthercommand-line arguments will be concatenated together andapplied as a bpf(4) packet filter. This filter will cause<b>softflowd</b> to ignore the specified traffic.</p><p style="margin-left:6%; margin-top: 1em"><b>Timeouts <br>softflowd</b> will expire quiescent flows afteruser-configurable periods. The exact timeout used depends onthe nature of the flow. The various timeouts that may be setfrom the command-line (using the <b>-t</b> option) and theirmeanings are:</p><p style="margin-top: 1em"><i>general</i></p><p style="margin-left:17%;">This is the general timeoutapplied to all traffic unless overridden by one of the othertimeouts.</p><p style="margin-top: 1em"><i>tcp</i></p><p style="margin-left:17%; margin-top: 1em">This is thegeneral TCP timeout, applied to open TCP connections.</p><p style="margin-top: 1em"><i>tcp.rst</i></p><p style="margin-left:17%;">This timeout is applied to aTCP connection when a RST packet has been sent by one orboth endpoints.</p><p style="margin-top: 1em"><i>tcp.fin</i></p><p style="margin-left:17%;">This timeout is applied to aTCP connection when a FIN packet has been sent by bothendpoints.</p><p style="margin-top: 1em"><i>udp</i></p><p style="margin-left:17%; margin-top: 1em">This is thegeneral UDP timeout, applied to all UDP connections.</p><p style="margin-top: 1em"><i>maxlife</i></p><p style="margin-left:17%;">This is the maximum lifetimethat a flow may exist for. All flows are forcibly expiredwhen they pass <i>maxlife</i> seconds. To disable thisfeature, specify a <i>maxlife</i> of 0.</p><p style="margin-top: 1em"><i>expint</i></p><p style="margin-left:17%; margin-top: 1em">Specify theinterval between expiry checks. Increase this to group moreflows into a NetFlow packet. To disable this feature,specify a <i>expint</i> of 0.</p><p style="margin-left:6%; margin-top: 1em">Flows may alsobe expired if there are not enough flow entries to hold themor if their traffic exceeds 2 Gib in either direction.softflowctl(8) may be used to print information on theaverage lifetimes of flows and the reasons for theirexpiry.</p><p style="margin-left:6%; margin-top: 1em"><b>Time Formats<br>softflowd</b> command-line arguments that specify time maybe expressed using a sequence of the form:<i>time</i>[<i>qualifier</i>], where <i>time</i> is apositive integer value and <i>qualifier</i> is one of thefollowing:</p><p style="margin-top: 1em"><b><none></b></p><p style="margin-left:24%; margin-top: 1em">seconds</p><p><b>s</b> | <b>S</b></p><p style="margin-left:24%; margin-top: 1em">seconds</p><p><b>m</b> | <b>M</b></p><p style="margin-left:24%; margin-top: 1em">minutes</p><p><b>h</b> | <b>H</b></p><p style="margin-left:24%; margin-top: 1em">hours</p><p><b>d</b> | <b>D</b></p><p style="margin-left:24%; margin-top: 1em">days</p><p><b>w</b> | <b>W</b></p><p style="margin-left:24%; margin-top: 1em">weeks</p><p style="margin-left:6%; margin-top: 1em">Each member ofthe sequence is added together to calculate the total timevalue.</p><p style="margin-left:6%; margin-top: 1em">Time formatexamples:</p><p style="margin-top: 1em">600</p><p style="margin-left:24%; margin-top: 1em">600 seconds (10minutes)</p><p>10m</p><p style="margin-left:24%; margin-top: 1em">10 minutes</p><p>1h30m</p><p style="margin-left:24%; margin-top: 1em">1 hour 30minutes (90 minutes)</p><p style="margin-left:6%; margin-top: 1em"><b>Run-timeControl</b> <br>A daemonised <b>softflowd</b> instance may be controlledusing the softflowctl(8) command. This interface allows oneto shut down the daemon, force expiry of all tracked flowsand extract debugging and summary data. Also, receipt of aSIGTERM or SIGINT will cause <b>softflowd</b> to exit, afterexpiring all flows (and thus sending flow export packets if<b>-n</b> was specified on the command-line). If you do notwant to export flows upon shutdown, clear them first withsoftflowctl(8) or use softflowctl(8) ’s“exit” command.</p><p style="margin-top: 1em"><b>EXAMPLES</b> <br>softflowd -i fxp0</p><p style="margin-left:17%;">This command-line will cause<b>softflowd</b> to listen on interface fxp0 and to run instatistics gathering mode only (i.e. no NetFlow dataexport).</p><p style="margin-top: 1em">softflowd -i fxp0 -n10.1.0.2:4432</p><p style="margin-left:17%;">This command-line will cause<b>softflowd</b> to listen on interface fxp0 and to exportNetFlow v.5 datagrams on flow expiry to a flow collectorrunning on 10.1.0.2 port 4432.</p><p style="margin-top: 1em">softflowd -i fxp0 -n10.1.0.2:4432,10.1.0.3:4432</p><p style="margin-left:17%;">This command-line will cause<b>softflowd</b> to listen on interface fxp0 and to exportNetFlow v.5 datagrams on flow expiry to a flow collectorrunning on 10.1.0.2 port 4432 and 10.1.0.3 port 4432.</p><p style="margin-top: 1em">softflowd -i fxp0 -l -n10.1.0.2:4432,10.1.0.3:4432</p><p style="margin-left:17%;">This command-line will cause<b>softflowd</b> to listen on interface fxp0 and to exportNetFlow v.5 datagrams on flow expiry to a flow collectorrunning on 10.1.0.2 port 4432 and 10.1.0.3 port 4432 withload balncing mode. Odd netflow packets will be sent to10.1.0.2 port 4432 and even netflow packets will be sent to10.1.0.3 port 4432.</p><p style="margin-top: 1em">softflowd -v 5 -i fxp0 -n10.1.0.2:4432 -m 65536 -t udp=1m30s</p><p style="margin-left:17%;">This command-line increases thenumber of concurrent flows that <b>softflowd</b> will trackto 65536 and increases the timeout for UDP flows to 90seconds.</p><p style="margin-top: 1em">softflowd -v 9 -i fxp0 -n224.0.1.20:4432 -L 64</p><p style="margin-left:17%;">This command-line will exportNetFlow v.9 flows to the multicast group 224.0.1.20. Theexport datagrams will have their TTL set to 64, so multicastreceivers can be many hops away.</p><p style="margin-top: 1em">softflowd -i fxp0 -p/var/run/sfd.pid.fxp0 -c /var/run/sfd.ctl.fxp0</p><p style="margin-left:17%;">This command-line specifiesalternate locations for the control socket and pid file.Similar command-lines are useful when running multipleinstances of <b>softflowd</b> on a single machine.</p><p style="margin-top: 1em"><b>FILES</b> <br>/var/run/softflowd.pid</p><p style="margin-left:17%;">This file stores the process IDwhen <b>softflowd</b> is in daemon mode. This location maybe overridden using the <b>-p</b> command-line option.</p><p style="margin-top: 1em">/var/run/softflowd.ctl</p><p style="margin-left:17%;">This is the remote controlsocket. <b>softflowd</b> listens on this socket for commandsfrom softflowctl(8). This location may be overridden usingthe <b>-c</b> command-line option.</p><p style="margin-top: 1em"><b>BUGS</b></p><p style="margin-left:6%;">Currently <b>softflowd</b> doesnot handle maliciously fragmented packets properly, i.e.packets fragemented such that the UDP or TCP header does notfit into the first fragment. It will product correct trafficcounts when presented with maliciously fragmented packets,but will not record TCP or UDP port information. Pleasereport bugs in softflowd tohttps://github.com/irino/softflowd/issues</p><p style="margin-top: 1em"><b>AUTHORS</b></p><p style="margin-left:6%;">Damien Miller<djm@mindrot.org> <br>Hitoshi Irino (current maintainer)<irino@sfc.wide.ad.jp></p><p style="margin-top: 1em"><b>SEE ALSO</b></p><p style="margin-left:6%;">softflowctl(8), tcpdump(8),pcap(3), bpf(4)</p><p style="margin-left:6%; margin-top: 1em">http://www.ietf.org/rfc/rfc3954.txt<br>http://www.cisco.com/en/US/products/sw/netmgtsw/ps1964/products_implementation_design_guide09186a00800d6a11.html<br>http://www.ietf.org/rfc/rfc5101.txt <br>http://www.ietf.org/rfc/rfc5103.txt</p><p style="margin-left:6%; margin-top: 1em">BSDNovember 17, 2019 BSD</p><hr></body></html>
 |