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