Skip to contentSkip to conversation

doc: add nf_conntrack sysctl api documentation

PATCH Applied Jiri Pirko 4 participants 5 messages Jan 18, 2013 – Jan 21, 2013

Subsystems (4)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH v3 1/1 doc: add nf_conntrack sysctl api documentation

I grepped through the code and picked bits about nf_conntrack sysctl api and put that into one documentation file.

---

v2->v3:
processed in changes suggested by Pablo Neira Ayuso

v1->v2:
processed in changes suggested by Florian Westphal

 Documentation/networking/nf_conntrack-sysctl.txt | 177 +++++++++++++++++++++++
 1 file changed, 177 insertions(+)
 create mode 100644 Documentation/networking/nf_conntrack-sysctl.txt
Documentation/networking/nf_conntrack-sysctl.txt new file +177 -0
new file mode 100644
index 0000000..11e450e
@@ -0,0 +1,177 @@
+/proc/sys/net/netfilter/nf_conntrack_* Variables:
+
+nf_conntrack_acct - BOOLEAN
+	0 - disabled (default)
+	not 0 - enabled
+
+	Enable connection tracking flow accounting. 64-bits byte and packet
+	counters per flow are added.
+
+nf_conntrack_buckets - INTEGER (read-only)
+	Size of hash table.  Value depends on total memory size according to
+	following rules:
+	Use 1/16384 of memory.
+	If memory size is bigger than 1GB have 16384 buckets.
+	Minimum value is 32.
+
+nf_conntrack_checksum - BOOLEAN
+	0 - disabled
+	not 0 - enabled (default)
+
+	Verify checksum of incoming packets.  Packets with bad checksum
+	will not be considered for connection tracking, i.e. such packets
+	will be in INVALID state.
+
+nf_conntrack_count - INTEGER (read-only)
+	Number of currently allocated flow entries.
+
+nf_conntrack_events - BOOLEAN
+	0 - disabled
+	not 0 - enabled (default)
+
+	If this option is enabled, the connection tracking code will
+	provide userspace with connection tracking events via ctnetlink.
+
+nf_conntrack_events_retry_timeout - INTEGER (seconds)
+	default 15
+
+	This option is only relevant when "reliable connection tracking
+	events" are used.  Normally, ctnetlink is "lossy", i.e. when
+	userspace listeners can't keep up, events are dropped.
+
+	Userspace can request "reliable event mode".  When this mode is
+	active, the conntrack will only be destroyed after the event was
+	delivered.  If event delivery fails, the kernel periodically
+	re-tries to send the event to userspace.
+
+	This is the maximum interval the kernel should use when re-trying
+	to deliver the destroy event.
+
+	Higher number means less delivery re-tries (but it will then take
+	longer for a backlog to be processed).
+
+nf_conntrack_expect_max - INTEGER
+	Maximum size of expectation table.  Default value is
+	nf_conntrack_buckets / 256. Minimum is 1.
+
+nf_conntrack_frag6_high_thresh - INTEGER
+	default 262144
+
+	Maximum memory used to reassemble IPv6 fragments.  When
+	nf_conntrack_frag6_high_thresh bytes of memory is allocated for this
+	purpose, the fragment handler will toss packets until
+	nf_conntrack_frag6_low_thresh is reached.
+
+nf_conntrack_frag6_low_thresh - INTEGER
+	default 196608
+
+	See nf_conntrack_frag6_low_thresh
+
+nf_conntrack_frag6_timeout - INTEGER (seconds)
+	default 60
+
+	Time to keep an IPv6 fragment in memory.
+
+nf_conntrack_generic_timeout - INTEGER (seconds)
+	default 600
+
+	Default for generic timeout.  This refers to layer 4 unknown/unsupported
+	protocols.
+
+nf_conntrack_helper - BOOLEAN
+	0 - disabled
+	not 0 - enabled (default)
+
+	Enable automatic conntrack helper assignment.
+
+nf_conntrack_icmp_timeout - INTEGER (seconds)
+	default 30
+
+	Default for ICMP timeout.
+
+nf_conntrack_icmpv6_timeout - INTEGER (seconds)
+	default 30
+
+	Default for ICMP6 timeout.
+
+nf_conntrack_log_invalid - INTEGER
+	0   - disable (default)
+	1   - log ICMP packets
+	6   - log TCP packets
+	17  - log UDP packets
+	33  - log DCCP packets
+	41  - log ICMPv6 packets
+	136 - log UDPLITE packets
+	255 - log packets of any protocol
+
+	Log invalid packets of a type specified by value.
+
+nf_conntrack_max - INTEGER
+	Size of connection tracking table.  Default value is
+	nf_conntrack_buckets value * 4.
+
+nf_conntrack_tcp_be_liberal - BOOLEAN
+	0 - disabled (default)
+	not 0 - enabled
+
+	Be conservative in what you do, be liberal in what you accept from others.
+	If it's non-zero, we mark only out of window RST segments as INVALID.
+
+nf_conntrack_tcp_loose - BOOLEAN
+	0 - disabled
+	not 0 - enabled (default)
+
+	If it is set to zero, we disable picking up already established
+	connections.
+
+nf_conntrack_tcp_max_retrans - INTEGER
+	default 3
+
+	Max number of the retransmitted packets without receiving an
+	(acceptable) ACK from the destination.  If this number is reached,
+	a shorter timer will be started.
+
+nf_conntrack_tcp_timeout_close - INTEGER (seconds)
+	default 10
+
+nf_conntrack_tcp_timeout_close_wait - INTEGER (seconds)
+	default 60
+
+nf_conntrack_tcp_timeout_established - INTEGER (seconds)
+	default 432000 (5 days)
+
+nf_conntrack_tcp_timeout_fin_wait - INTEGER (seconds)
+	default 120
+
+nf_conntrack_tcp_timeout_last_ack - INTEGER (seconds)
+	default 30
+
+nf_conntrack_tcp_timeout_max_retrans - INTEGER (seconds)
+	default 300
+
+nf_conntrack_tcp_timeout_syn_recv - INTEGER (seconds)
+	default 60
+
+nf_conntrack_tcp_timeout_syn_sent - INTEGER (seconds)
+	default 120
+
+nf_conntrack_tcp_timeout_time_wait - INTEGER (seconds)
+	default 120
+
+nf_conntrack_tcp_timeout_unacknowledged - INTEGER (seconds)
+	default 300
+
+nf_conntrack_timestamp - BOOLEAN
+	0 - disabled (default)
+	not 0 - enabled
+
+	Enable connection tracking flow timestamping.
+
+nf_conntrack_udp_timeout - INTEGER (seconds)
+	default 30
+
+nf_conntrack_udp_timeout_stream2 - INTEGER (seconds)
+	default 180
+
+	This extended timeout will be used in case there is an UDP stream
+	detected.
Signature · 1 line
1.8.1
#1 lore raw

Grammar nazi again. I grok that these were pulled from code. If they're OK, maybe they can find their way back to the source files in due time.

N

Documentation/networking/nf_conntrack-sysctl.txt line 7

Quoted 13 lines · Jiri Pirko
(quoted diff) +0 -0

b/Documentation/networking/nf_conntrack-sysctl.txt new file mode 100644 index 0000000..11e450e

Documentation/networking/nf_conntrack-sysctl.txt new file +7 -0
@@ -0,0 +1,177 @@
+/proc/sys/net/netfilter/nf_conntrack_* Variables:
+
+nf_conntrack_acct - BOOLEAN
+	0 - disabled (default)
+	not 0 - enabled
+
+	Enable connection tracking flow accounting. 64-bits byte and packet

Make it '64-bit' (singular).

Documentation/networking/nf_conntrack-sysctl.txt line 15

Quoted 8 lines
Documentation/networking/nf_conntrack-sysctl.txt new file +8 -0
+	counters per flow are added.
+
+nf_conntrack_buckets - INTEGER (read-only)
+	Size of hash table.  Value depends on total memory size according to
+	following rules:
+	Use 1/16384 of memory.
+	If memory size is bigger than 1GB have 16384 buckets.
+	Minimum value is 32.

This might be clearer: "Size of hash table. Divide total memory by 16384 to determine the number of buckets. But the hash table will never have fewer than 32 or more than 16384 buckets."

Documentation/networking/nf_conntrack-sysctl.txt line 23

Quoted 8 lines
Documentation/networking/nf_conntrack-sysctl.txt new file +8 -0
+
+nf_conntrack_checksum - BOOLEAN
+	0 - disabled
+	not 0 - enabled (default)
+
+	Verify checksum of incoming packets.  Packets with bad checksum
+	will not be considered for connection tracking, i.e. such packets
+	will be in INVALID state.

Perhaps clearer: "... Packets with bad checksums are in INVALID state. If this is enabled, such packets will not be considered for connection tracking."

Quoted 7 lines
Documentation/networking/nf_conntrack-sysctl.txt new file +7 -0
+
+nf_conntrack_count - INTEGER (read-only)
+	Number of currently allocated flow entries.
+
+nf_conntrack_events - BOOLEAN
+	0 - disabled
+	not 0 - enabled (default)

Documentation/networking/nf_conntrack-sysctl.txt line 40

Quoted 10 lines
Documentation/networking/nf_conntrack-sysctl.txt new file +10 -0
+
+	If this option is enabled, the connection tracking code will
+	provide userspace with connection tracking events via ctnetlink.
+
+nf_conntrack_events_retry_timeout - INTEGER (seconds)
+	default 15
+
+	This option is only relevant when "reliable connection tracking
+	events" are used.  Normally, ctnetlink is "lossy", i.e. when
+	userspace listeners can't keep up, events are dropped.

Minor tweak: "... Cnetlink is normally "lossy"; that is, events are normally dropped when userspace listeners can't keep up."

Documentation/networking/nf_conntrack-sysctl.txt line 51

Quoted 11 lines
Documentation/networking/nf_conntrack-sysctl.txt new file +11 -0
+
+	Userspace can request "reliable event mode".  When this mode is
+	active, the conntrack will only be destroyed after the event was
+	delivered.  If event delivery fails, the kernel periodically
+	re-tries to send the event to userspace.
+
+	This is the maximum interval the kernel should use when re-trying
+	to deliver the destroy event.
+
+	Higher number means less delivery re-tries (but it will then take
+	longer for a backlog to be processed).

Better: "A higher number means there will be fewer delivery retries and it will take longer for a backlog to be processed."

Quoted 14 lines
Documentation/networking/nf_conntrack-sysctl.txt new file +8 -0
+
+nf_conntrack_expect_max - INTEGER
+	Maximum size of expectation table.  Default value is
+	nf_conntrack_buckets / 256. Minimum is 1.
+
+nf_conntrack_frag6_high_thresh - INTEGER
+	default 262144
+
 
...
Quoted 2 lines

+nf_conntrack_tcp_loose - BOOLEAN

Documentation/networking/nf_conntrack-sysctl.txt new file +2 -0
+	0 - disabled
+	not 0 - enabled (default)

Documentation/networking/nf_conntrack-sysctl.txt line 132

Quoted 10 lines
Documentation/networking/nf_conntrack-sysctl.txt new file +10 -0
+
+	If it is set to zero, we disable picking up already established
+	connections.
+
+nf_conntrack_tcp_max_retrans - INTEGER
+	default 3
+
+	Max number of the retransmitted packets without receiving an
+	(acceptable) ACK from the destination.  If this number is reached,
+	a shorter timer will be started.

Maybe better: "Maximum number of packets that can be retransmitted without receiving an ..."

Quoted 7 lines
Documentation/networking/nf_conntrack-sysctl.txt new file +7 -0
+
+nf_conntrack_tcp_timeout_close - INTEGER (seconds)
+	default 10
+
+nf_conntrack_tcp_timeout_close_wait - INTEGER (seconds)
+	default 60
+
#2 lore raw
In reply to Jiri Pirko
Quoted 2 lines · Jiri Pirko

I grepped through the code and picked bits about nf_conntrack sysctl api and put that into one documentation file.

[...]

Thank you very much for your time and effort!

maintainer Applied
#3 lore raw
In reply to Jiri Pirko
Quoted 2 lines · Jiri Pirko

I grepped through the code and picked bits about nf_conntrack sysctl api and put that into one documentation file.

Applied, thanks a lot Jiri.

I have also included some grammar improvements that Neil Murphy has proposed (he seems to have accidentally trimmed off the CC list).

author
#4 lore raw
Quoted 8 lines · Mon, Jan 21, 2013 at 12:52:02PM CET, [email protected] wrote:
Quoted 2 lines · Jiri Pirko

I grepped through the code and picked bits about nf_conntrack sysctl api and put that into one documentation file.

Applied, thanks a lot Jiri.

I have also included some grammar improvements that Neil Murphy has proposed (he seems to have accidentally trimmed off the CC list).

Okay, Thanks a lot Pablo