xref: /freebsd/share/man/man4/siftr.4 (revision f4b37ed0f8b307b1f3f0f630ca725d68f1dff30d)
1.\"
2.\" Copyright (c) 2010 The FreeBSD Foundation
3.\" All rights reserved.
4.\"
5.\" Portions of this software were developed at the Centre for Advanced
6.\" Internet Architectures, Swinburne University of Technology, Melbourne,
7.\" Australia by Lawrence Stewart under sponsorship from the FreeBSD
8.\" Foundation.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright
14.\"    notice, this list of conditions, and the following disclaimer,
15.\"    without modification, immediately at the beginning of the file.
16.\" 2. The name of the author may not be used to endorse or promote products
17.\"    derived from this software without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
23.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\" $FreeBSD$
32.\"
33.Dd March 18, 2015
34.Dt SIFTR 4
35.Os
36.Sh NAME
37.Nm SIFTR
38.Nd Statistical Information For TCP Research
39.Sh SYNOPSIS
40To load
41the driver
42as a module at run-time, run the following command as root:
43.Bd -literal -offset indent
44kldload siftr
45.Ed
46.Pp
47Alternatively, to load
48the driver
49as a module at boot time, add the following line into the
50.Xr loader.conf 5
51file:
52.Bd -literal -offset indent
53siftr_load="YES"
54.Ed
55.Sh DESCRIPTION
56The
57.Nm
58.Po
59.Em S Ns tatistical
60.Em I Ns nformation
61.Em F Ns or
62.Em T Ns CP
63.Em R Ns esearch
64.Pc
65kernel module logs a range of statistics on active TCP connections to
66a log file.
67It provides the ability to make highly granular measurements of TCP connection
68state, aimed at system administrators, developers and researchers.
69.Ss Compile-time Configuration
70The default operation of
71.Nm
72is to capture IPv4 TCP/IP packets.
73.Nm
74can be configured to support IPv4 and IPv6 by uncommenting:
75.Bd -literal -offset indent
76CFLAGS+=-DSIFTR_IPV6
77.Ed
78.Pp
79in
80.Aq sys/modules/siftr/Makefile
81and recompiling.
82.Pp
83In the IPv4-only (default) mode, standard dotted decimal notation (e.g.
84"136.186.229.95") is used to format IPv4 addresses for logging.
85In IPv6 mode, standard dotted decimal notation is used to format IPv4 addresses,
86and standard colon-separated hex notation (see RFC 4291) is used to format IPv6
87addresses for logging. Note that SIFTR uses uncompressed notation to format IPv6
88addresses.
89For example, the address "fe80::20f:feff:fea2:531b" would be logged as
90"fe80:0:0:0:20f:feff:fea2:531b".
91.Ss Run-time Configuration
92.Nm
93utilises the
94.Xr sysctl 8
95interface to export its configuration variables to user-space.
96The following variables are available:
97.Bl -tag -offset indent -width Va
98.It Va net.inet.siftr.enabled
99controls whether the module performs its
100measurements or not.
101By default, the value is set to 0, which means the module
102will not be taking any measurements.
103Having the module loaded with
104.Va net.inet.siftr.enabled
105set to 0 will have no impact on the performance of the network stack, as the
106packet filtering hooks are only inserted when
107.Va net.inet.siftr.enabled
108is set to 1.
109.El
110.Bl -tag -offset indent -width Va
111.It Va net.inet.siftr.ppl
112controls how many inbound/outbound packets for a given TCP connection will cause
113a log message to be generated for the connection.
114By default, the value is set to 1, which means the module will log a message for
115every packet of every TCP connection.
116The value can be set to any integer in the range [1,2^32], and can be changed at
117any time, even while the module is enabled.
118.El
119.Bl -tag -offset indent -width Va
120.It Va net.inet.siftr.logfile
121controls the path to the file that the module writes its log messages to.
122By default, the file /var/log/siftr.log is used.
123The path can be changed at any time, even while the module is enabled.
124.El
125.Bl -tag -offset indent -width Va
126.It Va net.inet.siftr.genhashes
127controls whether a hash is generated for each TCP packet seen by
128.Nm .
129By default, the value is set to 0, which means no hashes are generated.
130The hashes are useful to correlate which TCP packet triggered the generation of
131a particular log message, but calculating them adds additional computational
132overhead into the fast path.
133.El
134.Ss Log Format
135A typical
136.Nm
137log file will contain 3 different types of log message.
138All messages are written in plain ASCII text.
139.Pp
140Note: The
141.Qq \e
142present in the example log messages in this section indicates a
143line continuation and is not part of the actual log message.
144.Pp
145The first type of log message is written to the file when the module is
146enabled and starts collecting data from the running kernel. The text below
147shows an example module enable log. The fields are tab delimited key-value
148pairs which describe some basic information about the system.
149.Bd -literal -offset indent
150enable_time_secs=1238556193    enable_time_usecs=462104 \\
151siftrver=1.2.2    hz=1000    tcp_rtt_scale=32 \\
152sysname=FreeBSD    sysver=604000    ipmode=4
153.Ed
154.Pp
155Field descriptions are as follows:
156.Bl -tag -offset indent -width Va
157.It Va enable_time_secs
158time at which the module was enabled, in seconds since the UNIX epoch.
159.El
160.Bl -tag -offset indent -width Va
161.It Va enable_time_usecs
162time at which the module was enabled, in microseconds since enable_time_secs.
163.El
164.Bl -tag -offset indent -width Va
165.It Va siftrver
166version of
167.Nm .
168.El
169.Bl -tag -offset indent -width Va
170.It Va hz
171tick rate of the kernel in ticks per second.
172.El
173.Bl -tag -offset indent -width Va
174.It Va tcp_rtt_scale
175smoothed RTT estimate scaling factor.
176.El
177.Bl -tag -offset indent -width Va
178.It Va sysname
179operating system name.
180.El
181.Bl -tag -offset indent -width Va
182.It Va sysver
183operating system version.
184.El
185.Bl -tag -offset indent -width Va
186.It Va ipmode
187IP mode as defined at compile time.
188An ipmode of "4" means IPv6 is not supported and IP addresses are logged in
189regular dotted quad format.
190An ipmode of "6" means IPv6 is supported, and IP addresses are logged in dotted
191quad or hex format, as described in the
192.Qq Compile-time Configuration
193subsection.
194.El
195.Pp
196The second type of log message is written to the file when a data log message
197is generated.
198The text below shows an example data log triggered by an IPv4
199TCP/IP packet.
200The data is CSV formatted.
201.Bd -literal -offset indent
202o,0xbec491a5,1238556193.463551,172.16.7.28,22,172.16.2.5,55931, \\
2031073725440,172312,6144,66560,66608,8,1,4,1448,936,1,996,255, \\
20433304,208,66608,0,208,0
205.Ed
206.Pp
207Field descriptions are as follows:
208.Bl -tag -offset indent -width Va
209.It Va 1
210Direction of packet that triggered the log message.
211Either
212.Qq i
213for in, or
214.Qq o
215for out.
216.El
217.Bl -tag -offset indent -width Va
218.It Va 2
219Hash of the packet that triggered the log message.
220.El
221.Bl -tag -offset indent -width Va
222.It Va 3
223Time at which the packet that triggered the log message was processed by
224the
225.Xr pfil 9
226hook function, in seconds and microseconds since the UNIX epoch.
227.El
228.Bl -tag -offset indent -width Va
229.It Va 4
230The IPv4 or IPv6 address of the local host, in dotted quad (IPv4 packet)
231or colon-separated hex (IPv6 packet) notation.
232.El
233.Bl -tag -offset indent -width Va
234.It Va 5
235The TCP port that the local host is communicating via.
236.El
237.Bl -tag -offset indent -width Va
238.It Va 6
239The IPv4 or IPv6 address of the foreign host, in dotted quad (IPv4 packet)
240or colon-separated hex (IPv6 packet) notation.
241.El
242.Bl -tag -offset indent -width Va
243.It Va 7
244The TCP port that the foreign host is communicating via.
245.El
246.Bl -tag -offset indent -width Va
247.It Va 8
248The slow start threshold for the flow, in bytes.
249.El
250.Bl -tag -offset indent -width Va
251.It Va 9
252The current congestion window for the flow, in bytes.
253.El
254.Bl -tag -offset indent -width Va
255.It Va 10
256The current bandwidth-controlled window for the flow, in bytes.
257.El
258.Bl -tag -offset indent -width Va
259.It Va 11
260The current sending window for the flow, in bytes.
261The post scaled value is reported, except during the initial handshake (first
262few packets), during which time the unscaled value is reported.
263.El
264.Bl -tag -offset indent -width Va
265.It Va 12
266The current receive window for the flow, in bytes.
267The post scaled value is always reported.
268.El
269.Bl -tag -offset indent -width Va
270.It Va 13
271The current window scaling factor for the sending window.
272.El
273.Bl -tag -offset indent -width Va
274.It Va 14
275The current window scaling factor for the receiving window.
276.El
277.Bl -tag -offset indent -width Va
278.It Va 15
279The current state of the TCP finite state machine, as defined
280in
281.Aq Pa netinet/tcp_fsm.h .
282.El
283.Bl -tag -offset indent -width Va
284.It Va 16
285The maximum segment size for the flow, in bytes.
286.El
287.Bl -tag -offset indent -width Va
288.It Va 17
289The current smoothed RTT estimate for the flow, in units of TCP_RTT_SCALE * HZ,
290where TCP_RTT_SCALE is a define found in tcp_var.h, and HZ is the kernel's tick
291timer.
292Divide by TCP_RTT_SCALE * HZ to get the RTT in secs. TCP_RTT_SCALE and HZ are
293reported in the enable log message.
294.El
295.Bl -tag -offset indent -width Va
296.It Va 18
297SACK enabled indicator. 1 if SACK enabled, 0 otherwise.
298.El
299.Bl -tag -offset indent -width Va
300.It Va 19
301The current state of the TCP flags for the flow.
302See
303.Aq Pa netinet/tcp_var.h
304for information about the various flags.
305.El
306.Bl -tag -offset indent -width Va
307.It Va 20
308The current retransmission timeout length for the flow, in units of HZ, where HZ
309is the kernel's tick timer.
310Divide by HZ to get the timeout length in seconds. HZ is reported in the
311enable log message.
312.El
313.Bl -tag -offset indent -width Va
314.It Va 21
315The current size of the socket send buffer in bytes.
316.El
317.Bl -tag -offset indent -width Va
318.It Va 22
319The current number of bytes in the socket send buffer.
320.El
321.Bl -tag -offset indent -width Va
322.It Va 23
323The current size of the socket receive buffer in bytes.
324.El
325.Bl -tag -offset indent -width Va
326.It Va 24
327The current number of bytes in the socket receive buffer.
328.El
329.Bl -tag -offset indent -width Va
330.It Va 25
331The current number of unacknowledged bytes in-flight.
332Bytes acknowledged via SACK are not excluded from this count.
333.El
334.Bl -tag -offset indent -width Va
335.It Va 26
336The current number of segments in the reassembly queue.
337.El
338.Bl -tag -offset indent -width Va
339.It Va 27
340Flowid for the connection.
341A caveat: Zero '0' either represents a valid flowid or a default value when it's
342not being set. There is no easy way to differentiate without looking at actual
343network interface card and drivers being used.
344.El
345.Bl -tag -offset indent -width Va
346.It Va 28
347Flow type for the connection.
348Flowtype defines which protocol fields are hashed to produce the flowid.
349A complete listing is available in
350.Pa sys/mbuf.h
351under
352.Dv M_HASHTYPE_* .
353.El
354.Pp
355The third type of log message is written to the file when the module is disabled
356and ceases collecting data from the running kernel.
357The text below shows an example module disable log.
358The fields are tab delimited key-value pairs which provide statistics about
359operations since the module was most recently enabled.
360.Bd -literal -offset indent
361disable_time_secs=1238556197    disable_time_usecs=933607 \\
362num_inbound_tcp_pkts=356    num_outbound_tcp_pkts=627 \\
363total_tcp_pkts=983    num_inbound_skipped_pkts_malloc=0 \\
364num_outbound_skipped_pkts_malloc=0    num_inbound_skipped_pkts_mtx=0 \\
365num_outbound_skipped_pkts_mtx=0    num_inbound_skipped_pkts_tcb=0 \\
366num_outbound_skipped_pkts_tcb=0    num_inbound_skipped_pkts_icb=0 \\
367num_outbound_skipped_pkts_icb=0    total_skipped_tcp_pkts=0 \\
368flow_list=172.16.7.28;22-172.16.2.5;55931,
369.Ed
370.Pp
371Field descriptions are as follows:
372.Bl -tag -offset indent -width Va
373.It Va disable_time_secs
374Time at which the module was disabled, in seconds since the UNIX epoch.
375.El
376.Bl -tag -offset indent -width Va
377.It Va disable_time_usecs
378Time at which the module was disabled, in microseconds since disable_time_secs.
379.El
380.Bl -tag -offset indent -width Va
381.It Va num_inbound_tcp_pkts
382Number of TCP packets that traversed up the network stack.
383This only includes inbound TCP packets during the periods when
384.Nm
385was enabled.
386.El
387.Bl -tag -offset indent -width Va
388.It Va num_outbound_tcp_pkts
389Number of TCP packets that traversed down the network stack.
390This only includes outbound TCP packets during the periods when
391.Nm
392was enabled.
393.El
394.Bl -tag -offset indent -width Va
395.It Va total_tcp_pkts
396The summation of num_inbound_tcp_pkts and num_outbound_tcp_pkts.
397.El
398.Bl -tag -offset indent -width Va
399.It Va num_inbound_skipped_pkts_malloc
400Number of inbound packets that were not processed because of failed malloc() calls.
401.El
402.Bl -tag -offset indent -width Va
403.It Va num_outbound_skipped_pkts_malloc
404Number of outbound packets that were not processed because of failed malloc() calls.
405.El
406.Bl -tag -offset indent -width Va
407.It Va num_inbound_skipped_pkts_mtx
408Number of inbound packets that were not processed because of failure to add the
409packet to the packet processing queue.
410.El
411.Bl -tag -offset indent -width Va
412.It Va num_outbound_skipped_pkts_mtx
413Number of outbound packets that were not processed because of failure to add the
414packet to the packet processing queue.
415.El
416.Bl -tag -offset indent -width Va
417.It Va num_inbound_skipped_pkts_tcb
418Number of inbound packets that were not processed because of failure to find the
419TCP control block associated with the packet.
420.El
421.Bl -tag -offset indent -width Va
422.It Va num_outbound_skipped_pkts_tcb
423Number of outbound packets that were not processed because of failure to find
424the TCP control block associated with the packet.
425.El
426.Bl -tag -offset indent -width Va
427.It Va num_inbound_skipped_pkts_icb
428Number of inbound packets that were not processed because of failure to find the
429IP control block associated with the packet.
430.El
431.Bl -tag -offset indent -width Va
432.It Va num_outbound_skipped_pkts_icb
433Number of outbound packets that were not processed because of failure to find
434the IP control block associated with the packet.
435.El
436.Bl -tag -offset indent -width Va
437.It Va total_skipped_tcp_pkts
438The summation of all skipped packet counters.
439.El
440.Bl -tag -offset indent -width Va
441.It Va flow_list
442A CSV list of TCP flows that triggered data log messages to be generated since
443the module was loaded.
444Each flow entry in the CSV list is
445formatted as
446.Qq local_ip;local_port-foreign_ip;foreign_port .
447If there are no entries in the list (i.e., no data log messages were generated),
448the value will be blank.
449If there is at least one entry in the list, a trailing comma will always be
450present.
451.El
452.Pp
453The total number of data log messages found in the log file for a module
454enable/disable cycle should equate to total_tcp_pkts - total_skipped_tcp_pkts.
455.Sh IMPLEMENTATION NOTES
456.Nm
457hooks into the network stack using the
458.Xr pfil 9
459interface.
460In its current incarnation, it hooks into the AF_INET/AF_INET6 (IPv4/IPv6)
461.Xr pfil 9
462filtering points, which means it sees packets at the IP layer of the network
463stack.
464This means that TCP packets inbound to the stack are intercepted before
465they have been processed by the TCP layer.
466Packets outbound from the stack are intercepted after they have been processed
467by the TCP layer.
468.Pp
469The diagram below illustrates how
470.Nm
471inserts itself into the stack.
472.Bd -literal -offset indent
473----------------------------------
474           Upper Layers
475----------------------------------
476    ^                       |
477    |                       |
478    |                       |
479    |                       v
480 TCP in                  TCP out
481----------------------------------
482    ^                      |
483    |________     _________|
484            |     |
485            |     v
486           ---------
487           | SIFTR |
488           ---------
489            ^     |
490    ________|     |__________
491    |                       |
492    |                       v
493IPv{4/6} in            IPv{4/6} out
494----------------------------------
495    ^                       |
496    |                       |
497    |                       v
498Layer 2 in             Layer 2 out
499----------------------------------
500          Physical Layer
501----------------------------------
502.Ed
503.Pp
504.Nm
505uses the
506.Xr alq 9
507interface to manage writing data to disk.
508.Pp
509At first glance, you might mistakenly think that
510.Nm
511extracts information from
512individual TCP packets.
513This is not the case.
514.Nm
515uses TCP packet events (inbound and outbound) for each TCP flow originating from
516the system to trigger a dump of the state of the TCP control block for that
517flow.
518With the PPL set to 1, we are in effect sampling each TCP flow's control block
519state as frequently as flow packets enter/leave the system.
520For example, setting PPL to 2 halves the sampling rate i.e., every second flow
521packet (inbound OR outbound) causes a dump of the control block state.
522.Pp
523The distinction between interrogating individual packets versus interrogating the
524control block is important, because
525.Nm
526does not remove the need for packet capturing tools like
527.Xr tcpdump 1 .
528.Nm
529allows you to correlate and observe the cause-and-affect relationship between
530what you see on the wire (captured using a tool like
531.Xr tcpdump 1 Ns )
532and changes in the TCP control block corresponding to the flow of interest.
533It is therefore useful to use
534.Nm
535and a tool like
536.Xr tcpdump 1
537to gather the necessary data to piece together the complete picture.
538Use of either tool on its own will not be able to provide all of the necessary
539data.
540.Pp
541As a result of needing to interrogate the TCP control block, certain packets
542during the lifecycle of a connection are unable to trigger a
543.Nm
544log message.
545The initial handshake takes place without the existence of a control block and
546the final ACK is exchanged when the connection is in the TIMEWAIT state.
547.Pp
548.Nm
549was designed to minimise the delay introduced to packets traversing the network
550stack.
551This design called for a highly optimised and minimal hook function that
552extracted the minimal details necessary whilst holding the packet up, and
553passing these details to another thread for actual processing and logging.
554.Pp
555This multithreaded design does introduce some contention issues when accessing
556the data structure shared between the threads of operation.
557When the hook function tries to place details in the structure, it must first
558acquire an exclusive lock.
559Likewise, when the processing thread tries to read details from the structure,
560it must also acquire an exclusive lock to do so.
561If one thread holds the lock, the other must wait before it can obtain it.
562This does introduce some additional bounded delay into the kernel's packet
563processing code path.
564.Pp
565In some cases (e.g., low memory, connection termination), TCP packets that enter
566the
567.Nm
568.Xr pfil 9
569hook function will not trigger a log message to be generated.
570.Nm
571refers to this outcome as a
572.Qq skipped packet .
573Note that
574.Nm
575always ensures that packets are allowed to continue through the stack, even if
576they could not successfully trigger a data log message.
577.Nm
578will therefore not introduce any packet loss for TCP/IP packets traversing the
579network stack.
580.Ss Important Behaviours
581The behaviour of a log file path change whilst the module is enabled is as
582follows:
583.Bl -enum
584.It
585Attempt to open the new file path for writing.
586If this fails, the path change will fail and the existing path will continue to
587be used.
588.It
589Assuming the new path is valid and opened successfully:
590.Bl -dash
591.It
592Flush all pending log messages to the old file path.
593.It
594Close the old file path.
595.It
596Switch the active log file pointer to point at the new file path.
597.It
598Commence logging to the new file.
599.El
600.El
601.Pp
602During the time between the flush of pending log messages to the old file and
603commencing logging to the new file, new log messages will still be generated and
604buffered.
605As soon as the new file path is ready for writing, the accumulated log messages
606will be written out to the file.
607.Sh EXAMPLES
608To enable the module's operations, run the following command as root:
609sysctl net.inet.siftr.enabled=1
610.Pp
611To change the granularity of log messages such that 1 log message is
612generated for every 10 TCP packets per connection, run the following
613command as root:
614sysctl net.inet.siftr.ppl=10
615.Pp
616To change the log file location to /tmp/siftr.log, run the following
617command as root:
618sysctl net.inet.siftr.logfile=/tmp/siftr.log
619.Sh SEE ALSO
620.Xr tcpdump 1 ,
621.Xr tcp 4 ,
622.Xr sysctl 8 ,
623.Xr alq 9 ,
624.Xr pfil 9
625.Sh ACKNOWLEDGEMENTS
626Development of this software was made possible in part by grants from the
627Cisco University Research Program Fund at Community Foundation Silicon Valley,
628and the FreeBSD Foundation.
629.Sh HISTORY
630.Nm
631first appeared in
632.Fx 7.4
633and
634.Fx 8.2 .
635.Pp
636.Nm
637was first released in 2007 by Lawrence Stewart and James Healy whilst working on
638the NewTCP research project at Swinburne University of Technology's Centre for
639Advanced Internet Architectures, Melbourne, Australia, which was made possible
640in part by a grant from the Cisco University Research Program Fund at Community
641Foundation Silicon Valley.
642More details are available at:
643.Pp
644http://caia.swin.edu.au/urp/newtcp/
645.Pp
646Work on
647.Nm
648v1.2.x was sponsored by the FreeBSD Foundation as part of
649the
650.Qq Enhancing the FreeBSD TCP Implementation
651project 2008-2009.
652More details are available at:
653.Pp
654http://www.freebsdfoundation.org/
655.Pp
656http://caia.swin.edu.au/freebsd/etcp09/
657.Sh AUTHORS
658.An -nosplit
659.Nm
660was written by
661.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org
662and
663.An James Healy Aq Mt jimmy@deefa.com .
664.Pp
665This manual page was written by
666.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org .
667.Sh BUGS
668Current known limitations and any relevant workarounds are outlined below:
669.Bl -dash
670.It
671The internal queue used to pass information between the threads of operation is
672currently unbounded.
673This allows
674.Nm
675to cope with bursty network traffic, but sustained high packet-per-second
676traffic can cause exhaustion of kernel memory if the processing thread cannot
677keep up with the packet rate.
678.It
679If using
680.Nm
681on a machine that is also running other modules utilising the
682.Xr pfil 9
683framework e.g.
684.Xr dummynet 4 ,
685.Xr ipfw 8 ,
686.Xr pf 4 Ns ,
687the order in which you load the modules is important.
688You should kldload the other modules first, as this will ensure TCP packets
689undergo any necessary manipulations before
690.Nm
691.Qq sees
692and processes them.
693.It
694There is a known, harmless lock order reversal warning between the
695.Xr pfil 9
696mutex and tcbinfo TCP lock reported by
697.Xr witness 4
698when
699.Nm
700is enabled in a kernel compiled with
701.Xr witness 4
702support.
703.It
704There is no way to filter which TCP flows you wish to capture data for.
705Post processing is required to separate out data belonging to particular flows
706of interest.
707.It
708The module does not detect deletion of the log file path.
709New log messages will simply be lost if the log file being used by
710.Nm
711is deleted whilst the module is set to use the file.
712Switching to a new log file using the
713.Em net.inet.siftr.logfile
714variable will create the new file and allow log messages to begin being written
715to disk again.
716The new log file path must differ from the path to the deleted file.
717.It
718The hash table used within the code is sized to hold 65536 flows.  This is not a
719hard limit, because chaining is used to handle collisions within the hash table
720structure.
721However, we suspect (based on analogies with other hash table performance data)
722that the hash table look up performance (and therefore the module's packet
723processing performance) will degrade in an exponential manner as the number of
724unique flows handled in a module enable/disable cycle approaches and surpasses
72565536.
726.It
727There is no garbage collection performed on the flow hash table.
728The only way currently to flush it is to disable
729.Nm .
730.It
731The PPL variable applies to packets that make it into the processing thread,
732not total packets received in the hook function.
733Packets are skipped before the PPL variable is applied, which means there may be
734a slight discrepancy in the triggering of log messages.
735For example, if PPL was set to 10, and the 8th packet since the last log message
736is skipped, the 11th packet will actually trigger the log message to be
737generated.
738This is discussed in greater depth in CAIA technical report 070824A.
739.It
740At the time of writing, there was no simple way to hook into the TCP layer
741to intercept packets.
742.Nm Ap s
743use of IP layer hook points means all IP
744traffic will be processed by the
745.Nm
746.Xr pfil 9
747hook function, which introduces minor, but nonetheless unnecessary packet delay
748and processing overhead on the system for non-TCP packets as well.
749Hooking in at the IP layer is also not ideal from the data gathering point of
750view.
751Packets traversing up the stack will be intercepted and cause a log message
752generation BEFORE they have been processed by the TCP layer, which means we
753cannot observe the cause-and-affect relationship between inbound events and the
754corresponding TCP control block as precisely as could be.
755Ideally,
756.Nm
757should intercept packets after they have been processed by the TCP layer i.e.
758intercept packets coming up the stack after they have been processed by
759tcp_input(), and intercept packets coming down the stack after they have been
760processed by tcp_output().
761The current code still gives satisfactory granularity though, as inbound events
762tend to trigger outbound events, allowing the cause-and-effect to be observed
763indirectly by capturing the state on outbound events as well.
764.It
765The
766.Qq inflight bytes
767value logged by
768.Nm
769does not take into account bytes that have been
770.No SACK Ap ed
771by the receiving host.
772.It
773Packet hash generation does not currently work for IPv6 based TCP packets.
774.It
775Compressed notation is not used for IPv6 address representation.
776This consumes more bytes than is necessary in log output.
777.El
778