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