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