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