← Documents Documentation/admin-guide/sysctl/net.rst GitHub 원문 ↗

Linux 6.18.37 · Administration

Documentation for /proc/sys/net/

`/proc/sys/net`의 BPF JIT, NAPI budget, socket buffer, RSS, namespace 상속, fallback tunnel, Appletalk와 TIPC 설정을 설명합니다.

Source pathDocumentation/admin-guide/sysctl/net.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

net.rst:1-519

network sysctl은 packet 처리량과 latency, socket memory, CPU 분산, network namespace 초기 상태, protocol별 timeout을 런타임에 조정합니다. 값의 단위가 packet·byte·microsecond·millisecond로 서로 다르므로 자동 조정 전에 단위를 확인해야 합니다.

영역대표 항목
BPF`bpf_jit_enable`, `bpf_jit_harden`, `bpf_jit_kallsyms`, `bpf_jit_limit`
NAPI·CPU`dev_weight*`, `netdev_budget*`, `rps_default_mask`, `gro_normal_batch`
socket memory`rmem_*`, `wmem_*`, `optmem_max`, `mem_pcpu_rsv`
namespace·tunnel`fb_tunnels_only_for_init_net`, `devconf_inherit_init_net`
protocol`unix_dgram_qlen`, Appletalk AARP, `tipc_rmem`, `named_timeout`

busy polling은 latency를 낮추는 대신 CPU와 전력을 더 사용하고, NAPI budget과 backlog는 처리량을 높이는 대신 한 CPU cycle의 독점을 늘릴 수 있습니다. workload와 NIC queue 구조를 측정한 뒤 단계적으로 조정해야 합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 ================================
2 Documentation for /proc/sys/net/
3 ================================
4
5 Copyright
6
7 Copyright (c) 1999
8
9 - Terrehon Bowden <terrehon@pacbell.net>
10 - Bodo Bauer <bb@ricochet.net>
11
12 Copyright (c) 2000
13
14 - Jorge Nerin <comandante@zaralinux.com>
15
16 Copyright (c) 2009
17
18 - Shen Feng <shen@cn.fujitsu.com>
19
20 For general info and legal blurb, please look in index.rst.
21
22 ------------------------------------------------------------------------------
23
24 This file contains the documentation for the sysctl files in
25 /proc/sys/net
26
27 The interface to the networking parts of the kernel is located in
28 /proc/sys/net. The following table shows all possible subdirectories. You may
29 see only some of them, depending on your kernel's configuration.
30
31
32 Table : Subdirectories in /proc/sys/net
33
34 ========= =================== = ========== ===================
35 Directory Content Directory Content
36 ========= =================== = ========== ===================
37 802 E802 protocol mptcp Multipath TCP
38 appletalk Appletalk protocol netfilter Network Filter
39 ax25 AX25 netrom NET/ROM
40 bridge Bridging rose X.25 PLP layer
41 core General parameter tipc TIPC
42 ethernet Ethernet protocol unix Unix domain sockets
43 ipv4 IP version 4 x25 X.25 protocol
44 ipv6 IP version 6
45 ========= =================== = ========== ===================
46
47 1. /proc/sys/net/core - Network core options
48 ============================================
49
50 bpf_jit_enable
51 --------------
52
53 This enables the BPF Just in Time (JIT) compiler. BPF is a flexible
54 and efficient infrastructure allowing to execute bytecode at various
55 hook points. It is used in a number of Linux kernel subsystems such
56 as networking (e.g. XDP, tc), tracing (e.g. kprobes, uprobes, tracepoints)
57 and security (e.g. seccomp). LLVM has a BPF back end that can compile
58 restricted C into a sequence of BPF instructions. After program load
59 through bpf(2) and passing a verifier in the kernel, a JIT will then
60 translate these BPF proglets into native CPU instructions. There are
61 two flavors of JITs, the newer eBPF JIT currently supported on:
62
63 - x86_64
64 - x86_32
65 - arm64
66 - arm32
67 - ppc64
68 - ppc32
69 - sparc64
70 - mips64
71 - s390x
72 - riscv64
73 - riscv32
74 - loongarch64
75 - arc
76
77 And the older cBPF JIT supported on the following archs:
78
79 - mips
80 - sparc
81
82 eBPF JITs are a superset of cBPF JITs, meaning the kernel will
83 migrate cBPF instructions into eBPF instructions and then JIT
84 compile them transparently. Older cBPF JITs can only translate
85 tcpdump filters, seccomp rules, etc, but not mentioned eBPF
86 programs loaded through bpf(2).
87
88 Values:
89
90 - 0 - disable the JIT (default value)
91 - 1 - enable the JIT
92 - 2 - enable the JIT and ask the compiler to emit traces on kernel log.
93
94 bpf_jit_harden
95 --------------
96
97 This enables hardening for the BPF JIT compiler. Supported are eBPF
98 JIT backends. Enabling hardening trades off performance, but can
99 mitigate JIT spraying.
100
101 Values:
102
103 - 0 - disable JIT hardening (default value)
104 - 1 - enable JIT hardening for unprivileged users only
105 - 2 - enable JIT hardening for all users
106
107 where "privileged user" in this context means a process having
108 CAP_BPF or CAP_SYS_ADMIN in the root user name space.
109
110 bpf_jit_kallsyms
111 ----------------
112
113 When BPF JIT compiler is enabled, then compiled images are unknown
114 addresses to the kernel, meaning they neither show up in traces nor
115 in /proc/kallsyms. This enables export of these addresses, which can
116 be used for debugging/tracing. If bpf_jit_harden is enabled, this
117 feature is disabled.
118
119 Values :
120
121 - 0 - disable JIT kallsyms export (default value)
122 - 1 - enable JIT kallsyms export for privileged users only
123
124 bpf_jit_limit
125 -------------
126
127 This enforces a global limit for memory allocations to the BPF JIT
128 compiler in order to reject unprivileged JIT requests once it has
129 been surpassed. bpf_jit_limit contains the value of the global limit
130 in bytes.
131
132 dev_weight
133 ----------
134
135 The maximum number of packets that kernel can handle on a NAPI interrupt,
136 it's a Per-CPU variable. For drivers that support LRO or GRO_HW, a hardware
137 aggregated packet is counted as one packet in this context.
138
139 Default: 64
140
141 dev_weight_rx_bias
142 ------------------
143
144 RPS (e.g. RFS, aRFS) processing is competing with the registered NAPI poll function
145 of the driver for the per softirq cycle netdev_budget. This parameter influences
146 the proportion of the configured netdev_budget that is spent on RPS based packet
147 processing during RX softirq cycles. It is further meant for making current
148 dev_weight adaptable for asymmetric CPU needs on RX/TX side of the network stack.
149 (see dev_weight_tx_bias) It is effective on a per CPU basis. Determination is based
150 on dev_weight and is calculated multiplicative (dev_weight * dev_weight_rx_bias).
151
152 Default: 1
153
154 dev_weight_tx_bias
155 ------------------
156
157 Scales the maximum number of packets that can be processed during a TX softirq cycle.
158 Effective on a per CPU basis. Allows scaling of current dev_weight for asymmetric
159 net stack processing needs. Be careful to avoid making TX softirq processing a CPU hog.
160
161 Calculation is based on dev_weight (dev_weight * dev_weight_tx_bias).
162
163 Default: 1
164
165 default_qdisc
166 -------------
167
168 The default queuing discipline to use for network devices. This allows
169 overriding the default of pfifo_fast with an alternative. Since the default
170 queuing discipline is created without additional parameters so is best suited
171 to queuing disciplines that work well without configuration like stochastic
172 fair queue (sfq), CoDel (codel) or fair queue CoDel (fq_codel). Don't use
173 queuing disciplines like Hierarchical Token Bucket or Deficit Round Robin
174 which require setting up classes and bandwidths. Note that physical multiqueue
175 interfaces still use mq as root qdisc, which in turn uses this default for its
176 leaves. Virtual devices (like e.g. lo or veth) ignore this setting and instead
177 default to noqueue.
178
179 Default: pfifo_fast
180
181 busy_read
182 ---------
183
184 Low latency busy poll timeout for socket reads. (needs CONFIG_NET_RX_BUSY_POLL)
185 Approximate time in us to busy loop waiting for packets on the device queue.
186 This sets the default value of the SO_BUSY_POLL socket option.
187 Can be set or overridden per socket by setting socket option SO_BUSY_POLL,
188 which is the preferred method of enabling. If you need to enable the feature
189 globally via sysctl, a value of 50 is recommended.
190
191 Will increase power usage.
192
193 Default: 0 (off)
194
195 busy_poll
196 ----------------
197 Low latency busy poll timeout for poll and select. (needs CONFIG_NET_RX_BUSY_POLL)
198 Approximate time in us to busy loop waiting for events.
199 Recommended value depends on the number of sockets you poll on.
200 For several sockets 50, for several hundreds 100.
201 For more than that you probably want to use epoll.
202 Note that only sockets with SO_BUSY_POLL set will be busy polled,
203 so you want to either selectively set SO_BUSY_POLL on those sockets or set
204 sysctl.net.busy_read globally.
205
206 Will increase power usage.
207
208 Default: 0 (off)
209
210 mem_pcpu_rsv
211 ------------
212
213 Per-cpu reserved forward alloc cache size in page units. Default 1MB per CPU.
214
215 rmem_default
216 ------------
217
218 The default setting of the socket receive buffer in bytes.
219
220 rmem_max
221 --------
222
223 The maximum receive socket buffer size in bytes.
224
225 Default: 4194304
226
227 rps_default_mask
228 ----------------
229
230 The default RPS CPU mask used on newly created network devices. An empty
231 mask means RPS disabled by default.
232
233 tstamp_allow_data
234 -----------------
235 Allow processes to receive tx timestamps looped together with the original
236 packet contents. If disabled, transmit timestamp requests from unprivileged
237 processes are dropped unless socket option SOF_TIMESTAMPING_OPT_TSONLY is set.
238
239 Default: 1 (on)
240
241
242 wmem_default
243 ------------
244
245 The default setting (in bytes) of the socket send buffer.
246
247 wmem_max
248 --------
249
250 The maximum send socket buffer size in bytes.
251
252 Default: 4194304
253
254 message_burst and message_cost
255 ------------------------------
256
257 These parameters are used to limit the warning messages written to the kernel
258 log from the networking code. They enforce a rate limit to make a
259 denial-of-service attack impossible. A higher message_cost factor, results in
260 fewer messages that will be written. Message_burst controls when messages will
261 be dropped. The default settings limit warning messages to one every five
262 seconds.
263
264 warnings
265 --------
266
267 This sysctl is now unused.
268
269 This was used to control console messages from the networking stack that
270 occur because of problems on the network like duplicate address or bad
271 checksums.
272
273 These messages are now emitted at KERN_DEBUG and can generally be enabled
274 and controlled by the dynamic_debug facility.
275
276 netdev_budget
277 -------------
278
279 Maximum number of packets taken from all interfaces in one polling cycle (NAPI
280 poll). In one polling cycle interfaces which are registered to polling are
281 probed in a round-robin manner. Also, a polling cycle may not exceed
282 netdev_budget_usecs microseconds, even if netdev_budget has not been
283 exhausted.
284
285 netdev_budget_usecs
286 ---------------------
287
288 Maximum number of microseconds in one NAPI polling cycle. Polling
289 will exit when either netdev_budget_usecs have elapsed during the
290 poll cycle or the number of packets processed reaches netdev_budget.
291
292 netdev_max_backlog
293 ------------------
294
295 Maximum number of packets, queued on the INPUT side, when the interface
296 receives packets faster than kernel can process them.
297
298 netdev_rss_key
299 --------------
300
301 RSS (Receive Side Scaling) enabled drivers use a 40 bytes host key that is
302 randomly generated.
303 Some user space might need to gather its content even if drivers do not
304 provide ethtool -x support yet.
305
306 ::
307
308 myhost:~# cat /proc/sys/net/core/netdev_rss_key
309 84:50:f4:00:a8:15:d1:a7:e9:7f:1d:60:35:c7:47:25:42:97:74:ca:56:bb:b6:a1:d8: ... (52 bytes total)
310
311 File contains nul bytes if no driver ever called netdev_rss_key_fill() function.
312
313 Note:
314 /proc/sys/net/core/netdev_rss_key contains 52 bytes of key,
315 but most drivers only use 40 bytes of it.
316
317 ::
318
319 myhost:~# ethtool -x eth0
320 RX flow hash indirection table for eth0 with 8 RX ring(s):
321 0: 0 1 2 3 4 5 6 7
322 RSS hash key:
323 84:50:f4:00:a8:15:d1:a7:e9:7f:1d:60:35:c7:47:25:42:97:74:ca:56:bb:b6:a1:d8:43:e3:c9:0c:fd:17:55:c2:3a:4d:69:ed:f1:42:89
324
325 netdev_tstamp_prequeue
326 ----------------------
327
328 If set to 0, RX packet timestamps can be sampled after RPS processing, when
329 the target CPU processes packets. It might give some delay on timestamps, but
330 permit to distribute the load on several cpus.
331
332 If set to 1 (default), timestamps are sampled as soon as possible, before
333 queueing.
334
335 netdev_unregister_timeout_secs
336 ------------------------------
337
338 Unregister network device timeout in seconds.
339 This option controls the timeout (in seconds) used to issue a warning while
340 waiting for a network device refcount to drop to 0 during device
341 unregistration. A lower value may be useful during bisection to detect
342 a leaked reference faster. A larger value may be useful to prevent false
343 warnings on slow/loaded systems.
344 Default value is 10, minimum 1, maximum 3600.
345
346 skb_defer_max
347 -------------
348
349 Max size (in skbs) of the per-cpu list of skbs being freed
350 by the cpu which allocated them. Used by TCP stack so far.
351
352 Default: 64
353
354 optmem_max
355 ----------
356
357 Maximum ancillary buffer size allowed per socket. Ancillary data is a sequence
358 of struct cmsghdr structures with appended data. TCP tx zerocopy also uses
359 optmem_max as a limit for its internal structures.
360
361 Default : 128 KB
362
363 fb_tunnels_only_for_init_net
364 ----------------------------
365
366 Controls if fallback tunnels (like tunl0, gre0, gretap0, erspan0,
367 sit0, ip6tnl0, ip6gre0) are automatically created. There are 3 possibilities
368 (a) value = 0; respective fallback tunnels are created when module is
369 loaded in every net namespaces (backward compatible behavior).
370 (b) value = 1; [kcmd value: initns] respective fallback tunnels are
371 created only in init net namespace and every other net namespace will
372 not have them.
373 (c) value = 2; [kcmd value: none] fallback tunnels are not created
374 when a module is loaded in any of the net namespace. Setting value to
375 "2" is pointless after boot if these modules are built-in, so there is
376 a kernel command-line option that can change this default. Please refer to
377 Documentation/admin-guide/kernel-parameters.txt for additional details.
378
379 Not creating fallback tunnels gives control to userspace to create
380 whatever is needed only and avoid creating devices which are redundant.
381
382 Default : 0 (for compatibility reasons)
383
384 devconf_inherit_init_net
385 ------------------------
386
387 Controls if a new network namespace should inherit all current
388 settings under /proc/sys/net/{ipv4,ipv6}/conf/{all,default}/. By
389 default, we keep the current behavior: for IPv4 we inherit all current
390 settings from init_net and for IPv6 we reset all settings to default.
391
392 If set to 1, both IPv4 and IPv6 settings are forced to inherit from
393 current ones in init_net. If set to 2, both IPv4 and IPv6 settings are
394 forced to reset to their default values. If set to 3, both IPv4 and IPv6
395 settings are forced to inherit from current ones in the netns where this
396 new netns has been created.
397
398 Default : 0 (for compatibility reasons)
399
400 txrehash
401 --------
402
403 Controls default hash rethink behaviour on socket when SO_TXREHASH option is set
404 to SOCK_TXREHASH_DEFAULT (i. e. not overridden by setsockopt).
405
406 If set to 1 (default), hash rethink is performed on listening socket.
407 If set to 0, hash rethink is not performed.
408
409 gro_normal_batch
410 ----------------
411
412 Maximum number of the segments to batch up on output of GRO. When a packet
413 exits GRO, either as a coalesced superframe or as an original packet which
414 GRO has decided not to coalesce, it is placed on a per-NAPI list. This
415 list is then passed to the stack when the number of segments reaches the
416 gro_normal_batch limit.
417
418 high_order_alloc_disable
419 ------------------------
420
421 By default the allocator for page frags tries to use high order pages (order-3
422 on x86). While the default behavior gives good results in most cases, some users
423 might have hit a contention in page allocations/freeing. This was especially
424 true on older kernels (< 5.14) when high-order pages were not stored on per-cpu
425 lists. This allows to opt-in for order-0 allocation instead but is now mostly of
426 historical importance.
427
428 Default: 0
429
430 2. /proc/sys/net/unix - Parameters for Unix domain sockets
431 ----------------------------------------------------------
432
433 There is only one file in this directory.
434 unix_dgram_qlen limits the max number of datagrams queued in Unix domain
435 socket's buffer. It will not take effect unless PF_UNIX flag is specified.
436
437
438 3. /proc/sys/net/ipv4 - IPV4 settings
439 -------------------------------------
440 Please see: Documentation/networking/ip-sysctl.rst and
441 Documentation/admin-guide/sysctl/net.rst for descriptions of these entries.
442
443
444 4. Appletalk
445 ------------
446
447 The /proc/sys/net/appletalk directory holds the Appletalk configuration data
448 when Appletalk is loaded. The configurable parameters are:
449
450 aarp-expiry-time
451 ----------------
452
453 The amount of time we keep an ARP entry before expiring it. Used to age out
454 old hosts.
455
456 aarp-resolve-time
457 -----------------
458
459 The amount of time we will spend trying to resolve an Appletalk address.
460
461 aarp-retransmit-limit
462 ---------------------
463
464 The number of times we will retransmit a query before giving up.
465
466 aarp-tick-time
467 --------------
468
469 Controls the rate at which expires are checked.
470
471 The directory /proc/net/appletalk holds the list of active Appletalk sockets
472 on a machine.
473
474 The fields indicate the DDP type, the local address (in network:node format)
475 the remote address, the size of the transmit pending queue, the size of the
476 received queue (bytes waiting for applications to read) the state and the uid
477 owning the socket.
478
479 /proc/net/atalk_iface lists all the interfaces configured for appletalk.It
480 shows the name of the interface, its Appletalk address, the network range on
481 that address (or network number for phase 1 networks), and the status of the
482 interface.
483
484 /proc/net/atalk_route lists each known network route. It lists the target
485 (network) that the route leads to, the router (may be directly connected), the
486 route flags, and the device the route is using.
487
488 5. TIPC
489 -------
490
491 tipc_rmem
492 ---------
493
494 The TIPC protocol now has a tunable for the receive memory, similar to the
495 tcp_rmem - i.e. a vector of 3 INTEGERs: (min, default, max)
496
497 ::
498
499 # cat /proc/sys/net/tipc/tipc_rmem
500 4252725 34021800 68043600
501 #
502
503 The max value is set to CONN_OVERLOAD_LIMIT, and the default and min values
504 are scaled (shifted) versions of that same value. Note that the min value
505 is not at this point in time used in any meaningful way, but the triplet is
506 preserved in order to be consistent with things like tcp_rmem.
507
508 named_timeout
509 -------------
510
511 TIPC name table updates are distributed asynchronously in a cluster, without
512 any form of transaction handling. This means that different race scenarios are
513 possible. One such is that a name withdrawal sent out by one node and received
514 by another node may arrive after a second, overlapping name publication already
515 has been accepted from a third node, although the conflicting updates
516 originally may have been issued in the correct sequential order.
517 If named_timeout is nonzero, failed topology updates will be placed on a defer
518 queue until another event arrives that clears the error, or until the timeout
519 expires. Value is in milliseconds.
520

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

문서 범위와 하위 디렉터리

1-46

이 문서는 Terrehon Bowden, Bodo Bauer, Jorge Nerin, Shen Feng이 작성한 `/proc/sys/net` sysctl 설명서입니다. 일반 정보와 법적 안내는 `index.rst`를 참조합니다.

커널 networking 영역의 인터페이스는 `/proc/sys/net`에 있습니다. 실제로 보이는 하위 디렉터리는 커널 구성에 따라 다음 목록의 일부일 수 있습니다.

디렉터리내용디렉터리내용
`802`E802 protocol`mptcp`Multipath TCP
`appletalk`Appletalk protocol`netfilter`Network Filter
`ax25`AX25`netrom`NET/ROM
`bridge`Bridging`rose`X.25 PLP layer
`core`일반 매개변수`tipc`TIPC
`ethernet`Ethernet protocol`unix`Unix domain socket
`ipv4`IP version 4`x25`X.25 protocol
`ipv6`IP version 6

1. /proc/sys/net/core - Network core options

47-49

`/proc/sys/net/core`의 network core 공통 옵션입니다.

bpf_jit_enable

50-93

BPF Just in Time(JIT) compiler를 활성화합니다. BPF는 여러 hook point에서 bytecode를 실행하는 유연하고 효율적인 기반이며 networking의 XDP·tc, tracing의 kprobes·uprobes·tracepoints, security의 seccomp 등에 사용됩니다.

LLVM BPF backend는 제한된 C를 BPF instruction으로 compile할 수 있습니다. `bpf(2)`로 program을 load하고 kernel verifier를 통과하면 JIT가 BPF proglet을 native CPU instruction으로 변환합니다.

새 eBPF JIT는 `x86_64`, `x86_32`, `arm64`, `arm32`, `ppc64`, `ppc32`, `sparc64`, `mips64`, `s390x`, `riscv64`, `riscv32`, `loongarch64`, `arc`에서 지원됩니다. 구형 cBPF JIT는 `mips`, `sparc`에서 지원됩니다.

eBPF JIT는 cBPF JIT의 상위 집합입니다. 커널은 cBPF instruction을 eBPF instruction으로 옮긴 뒤 투명하게 JIT compile합니다. 구형 cBPF JIT는 tcpdump filter와 seccomp rule 등만 변환할 수 있고 `bpf(2)`로 load한 eBPF program은 변환하지 못합니다.

동작
`0`JIT 비활성화(기본값)
`1`JIT 활성화
`2`JIT를 활성화하고 compiler가 trace를 kernel log에 출력하도록 요청

bpf_jit_harden

94-109

eBPF JIT backend의 hardening을 활성화합니다. 성능과 맞바꾸어 JIT spraying을 완화할 수 있습니다. 여기서 privileged user는 root user namespace에서 `CAP_BPF` 또는 `CAP_SYS_ADMIN`을 가진 프로세스를 뜻합니다.

동작
`0`JIT hardening 비활성화(기본값)
`1`비특권 사용자에게만 활성화
`2`모든 사용자에게 활성화

bpf_jit_kallsyms

110-123

BPF JIT가 만든 image 주소는 기본적으로 커널에 알려지지 않아 trace나 `/proc/kallsyms`에 나타나지 않습니다. 이 옵션은 디버깅과 tracing을 위해 주소를 내보냅니다. `bpf_jit_harden`이 켜져 있으면 이 기능은 비활성화됩니다.

동작
`0`JIT kallsyms export 비활성화(기본값)
`1`privileged user에게만 export

bpf_jit_limit

124-131

BPF JIT compiler의 memory 할당에 전역 한도를 적용합니다. 한도를 넘으면 비특권 JIT 요청을 거부하며 값의 단위는 byte입니다.

dev_weight

132-140

NAPI interrupt 한 번에 커널이 처리할 수 있는 최대 packet 수인 CPU별 변수입니다. LRO나 `GRO_HW`를 지원하는 driver에서는 hardware가 aggregate한 packet도 여기서는 packet 하나로 셉니다. 기본값은 `64`입니다.

dev_weight_rx_bias

141-153

RX softirq cycle에서 driver의 등록 NAPI poll function과 경쟁하는 RPS(RFS, aRFS 등)가 `netdev_budget` 중 얼마를 사용할지 비율에 영향을 줍니다. network stack의 비대칭 RX/TX CPU 요구에 맞춰 현재 `dev_weight`를 조정하기 위한 값이며 CPU별로 적용됩니다.

계산은 `dev_weight * dev_weight_rx_bias`입니다. `dev_weight_tx_bias`도 참조하십시오. 기본값은 `1`입니다.

dev_weight_tx_bias

154-164

TX softirq cycle에서 처리할 수 있는 최대 packet 수를 CPU별로 배율 조정합니다. network stack의 비대칭 처리 요구에 맞춰 `dev_weight`를 조정하지만 TX softirq가 CPU를 독점하지 않도록 주의해야 합니다.

계산은 `dev_weight * dev_weight_tx_bias`이며 기본값은 `1`입니다.

default_qdisc

165-180

network device에 사용할 기본 queuing discipline입니다. `pfifo_fast` 대신 다른 qdisc를 선택할 수 있습니다. 추가 매개변수 없이 생성되므로 stochastic fair queue(`sfq`), CoDel(`codel`), fair queue CoDel(`fq_codel`)처럼 설정 없이 잘 동작하는 qdisc가 적합합니다.

class와 bandwidth 설정이 필요한 Hierarchical Token Bucket이나 Deficit Round Robin에는 적합하지 않습니다. physical multiqueue interface는 root qdisc로 계속 `mq`를 사용하고 leaf에 이 기본값을 적용합니다. `lo`, `veth` 같은 virtual device는 이 설정을 무시하고 `noqueue`를 기본 사용합니다. 기본값은 `pfifo_fast`입니다.

busy_read

181-194

socket read의 low-latency busy poll timeout이며 `CONFIG_NET_RX_BUSY_POLL`이 필요합니다. device queue에서 packet을 기다리며 busy loop할 대략적인 시간이고 단위는 microsecond입니다. `SO_BUSY_POLL` socket option의 기본값을 정합니다.

socket마다 `SO_BUSY_POLL`로 설정하거나 덮어쓰는 방식이 권장됩니다. sysctl로 전역 활성화해야 한다면 `50`을 권장합니다. 전력 사용량이 늘며 기본값은 `0`(off)입니다.

busy_poll

195-209

`poll`과 `select`의 low-latency busy poll timeout이며 `CONFIG_NET_RX_BUSY_POLL`이 필요합니다. event를 기다리며 busy loop할 대략적인 시간이고 단위는 microsecond입니다.

권장값은 poll할 socket 수에 따라 여러 개면 `50`, 수백 개면 `100`입니다. 더 많으면 epoll 사용을 고려합니다. `SO_BUSY_POLL`이 설정된 socket만 busy poll하므로 필요한 socket에 선택적으로 설정하거나 `sysctl.net.busy_read`를 전역 설정해야 합니다. 전력 사용량이 늘며 기본값은 `0`(off)입니다.

mem_pcpu_rsv

210-214

CPU별 reserved forward allocation cache 크기이며 단위는 page입니다. 기본값은 CPU당 1MB입니다.

rmem_default

215-219

socket receive buffer의 기본 크기이며 단위는 byte입니다.

rmem_max

220-226

receive socket buffer의 최대 크기이며 단위는 byte입니다. 기본값은 `4194304`입니다.

rps_default_mask

227-232

새로 만드는 network device에 적용할 기본 RPS CPU mask입니다. 빈 mask는 RPS가 기본적으로 비활성화됨을 뜻합니다.

tstamp_allow_data

233-241

프로세스가 원래 packet 내용과 함께 loop된 TX timestamp를 받을 수 있게 합니다. 비활성화하면 `SOF_TIMESTAMPING_OPT_TSONLY` socket option이 없는 비특권 프로세스의 transmit timestamp 요청을 버립니다. 기본값은 `1`(on)입니다.

wmem_default

242-246

socket send buffer의 기본 크기이며 단위는 byte입니다.

wmem_max

247-253

send socket buffer의 최대 크기이며 단위는 byte입니다. 기본값은 `4194304`입니다.

message_burst and message_cost

254-263

networking code가 kernel log에 쓰는 warning message를 제한합니다. denial-of-service 공격을 막기 위해 rate limit을 적용하며 `message_cost`가 클수록 기록하는 message가 줄고 `message_burst`는 message를 버리기 시작할 시점을 제어합니다. 기본 설정은 5초마다 warning 하나로 제한합니다.

warnings

264-275

현재는 사용하지 않는 sysctl입니다. 예전에는 중복 주소나 잘못된 checksum 같은 network 문제로 network stack이 console에 내는 message를 제어했습니다. 이제 이 message는 `KERN_DEBUG` 수준으로 출력되며 일반적으로 `dynamic_debug` 기능으로 활성화하고 제어합니다.

netdev_budget

276-284

NAPI poll 한 cycle에서 모든 interface로부터 가져올 최대 packet 수입니다. poll에 등록된 interface를 round-robin 방식으로 검사합니다. `netdev_budget`을 다 쓰지 않았더라도 cycle은 `netdev_budget_usecs` microsecond를 넘을 수 없습니다.

netdev_budget_usecs

285-291

NAPI poll cycle 하나의 최대 microsecond 수입니다. 이 시간이 지나거나 처리 packet 수가 `netdev_budget`에 이르면 poll을 끝냅니다.

netdev_max_backlog

292-297

interface가 커널의 처리 속도보다 빨리 packet을 받을 때 INPUT 쪽에 queue할 최대 packet 수입니다.

netdev_rss_key

298-324

RSS(Receive Side Scaling) 지원 driver는 무작위로 생성한 40-byte host key를 사용합니다. 아직 `ethtool -x`를 지원하지 않는 driver에서도 사용자 공간이 내용을 읽어야 할 수 있습니다.

myhost:~# cat /proc/sys/net/core/netdev_rss_key
84:50:f4:00:a8:15:d1:a7:e9:7f:1d:60:35:c7:47:25:42:97:74:ca:56:bb:b6:a1:d8: ... (52 bytes total)

어떤 driver도 `netdev_rss_key_fill()`을 호출한 적이 없으면 파일에 NUL byte가 들어 있습니다. `/proc/sys/net/core/netdev_rss_key`에는 52 byte key가 있지만 대부분 driver는 그중 40 byte만 사용합니다.

myhost:~# ethtool -x eth0
RX flow hash indirection table for eth0 with 8 RX ring(s):
    0:    0     1     2     3     4     5     6     7
RSS hash key:
84:50:f4:00:a8:15:d1:a7:e9:7f:1d:60:35:c7:47:25:42:97:74:ca:56:bb:b6:a1:d8:43:e3:c9:0c:fd:17:55:c2:3a:4d:69:ed:f1:42:89

netdev_tstamp_prequeue

325-334

`0`이면 target CPU가 packet을 처리하는 RPS 뒤에 RX packet timestamp를 sample할 수 있습니다. timestamp가 조금 늦어질 수 있지만 여러 CPU에 부하를 분산할 수 있습니다. `1`(기본값)이면 queue에 넣기 전 가능한 한 빨리 sample합니다.

netdev_unregister_timeout_secs

335-345

network device unregister timeout의 초 단위 값입니다. unregister 중 device refcount가 0이 되기를 기다리며 warning을 내기까지의 시간을 정합니다. 낮은 값은 bisection 때 reference leak을 빨리 찾는 데 유용하고, 높은 값은 느리거나 부하가 큰 시스템의 false warning을 줄일 수 있습니다.

기본값은 `10`, 최솟값은 `1`, 최댓값은 `3600`입니다.

skb_defer_max

346-353

할당한 CPU가 해제하는 skb의 CPU별 목록 최대 크기이며 단위는 skb 수입니다. 현재 TCP stack이 사용합니다. 기본값은 `64`입니다.

optmem_max

354-362

socket마다 허용할 ancillary buffer 최대 크기입니다. ancillary data는 `struct cmsghdr` 구조체와 뒤따르는 data의 연속입니다. TCP TX zerocopy도 내부 구조체 한도로 `optmem_max`를 사용합니다. 기본값은 128KB입니다.

fb_tunnels_only_for_init_net

363-383

`tunl0`, `gre0`, `gretap0`, `erspan0`, `sit0`, `ip6tnl0`, `ip6gre0` 같은 fallback tunnel을 자동 생성할지 제어합니다.

동작
`0`module을 load할 때 모든 network namespace에 해당 fallback tunnel 생성(하위 호환 동작)
`1` (`initns`)init network namespace에만 생성하고 다른 namespace에는 만들지 않음
`2` (`none`)어떤 network namespace에서도 module load 때 만들지 않음

module이 built-in이면 boot 뒤 `2`로 바꿔도 의미가 없으므로 기본값을 바꾸는 kernel command-line 옵션이 있습니다. 자세한 내용은 `Documentation/admin-guide/kernel-parameters.txt`를 참조하십시오.

fallback tunnel을 자동 생성하지 않으면 사용자 공간이 필요한 device만 만들 수 있어 중복 device를 피할 수 있습니다. 호환성 때문에 기본값은 `0`입니다.

devconf_inherit_init_net

384-399

새 network namespace가 `/proc/sys/net/{ipv4,ipv6}/conf/{all,default}/`의 현재 설정을 어떻게 물려받을지 제어합니다.

동작
`0`기존 동작. IPv4는 `init_net`의 현재 설정을 상속하고 IPv6는 기본값으로 초기화
`1`IPv4와 IPv6 모두 `init_net`의 현재 설정을 강제로 상속
`2`IPv4와 IPv6 모두 기본값으로 강제 초기화
`3`새 namespace를 만든 현재 network namespace의 설정을 강제로 상속

호환성 때문에 기본값은 `0`입니다.

txrehash

400-408

`SO_TXREHASH` option이 `SOCK_TXREHASH_DEFAULT`, 즉 `setsockopt`으로 덮어쓰지 않은 상태일 때 socket의 기본 hash 재계산 동작을 제어합니다.

동작
`1`listening socket에서 hash 재계산 수행(기본값)
`0`재계산하지 않음

gro_normal_batch

409-417

GRO 출력에서 한 묶음으로 처리할 최대 segment 수입니다. packet이 coalesced superframe이거나 GRO가 합치지 않기로 한 원래 packet으로 GRO를 빠져나오면 NAPI별 목록에 놓입니다. segment 수가 `gro_normal_batch`에 이르면 목록을 stack으로 넘깁니다.

high_order_alloc_disable

418-429

기본적으로 page fragment allocator는 x86에서 order-3 같은 high-order page를 사용하려고 합니다. 대부분 좋은 결과를 내지만 일부 사용자는 page 할당·해제 경합을 겪을 수 있습니다. 특히 high-order page를 CPU별 목록에 저장하지 않던 5.14 이전 커널에서 두드러졌습니다.

대신 order-0 할당을 선택할 수 있게 하지만 현재는 주로 역사적 의미만 있습니다. 기본값은 `0`입니다.

2. /proc/sys/net/unix - Parameters for Unix domain sockets

430-437

이 디렉터리에는 파일 하나만 있습니다. `unix_dgram_qlen`은 Unix domain socket buffer에 queue할 datagram의 최대 개수를 제한합니다. `PF_UNIX` flag를 지정하지 않으면 효과가 없습니다.

3. /proc/sys/net/ipv4 - IPV4 settings

438-443

이 항목의 설명은 `Documentation/networking/ip-sysctl.rst`와 `Documentation/admin-guide/sysctl/net.rst`를 참조하십시오.

4. Appletalk

444-449

Appletalk가 load되면 `/proc/sys/net/appletalk`에 구성 데이터와 다음 매개변수가 나타납니다.

aarp-expiry-time

450-455

ARP entry를 만료시키기 전까지 유지하는 시간이며 오래된 host를 제거하는 데 사용합니다.

aarp-resolve-time

456-460

Appletalk 주소를 resolve하려고 시도할 시간입니다.

aarp-retransmit-limit

461-465

포기하기 전에 query를 재전송할 횟수입니다.

aarp-tick-time

466-487

만료 항목을 검사하는 비율을 제어합니다.

`/proc/net/appletalk`에는 machine의 활성 Appletalk socket 목록이 있습니다. 필드는 DDP type, `network:node` 형식 local 주소, remote 주소, transmit 대기 queue 크기, receive queue 크기(application이 읽기를 기다리는 byte), 상태, socket 소유 UID를 나타냅니다.

`/proc/net/atalk_iface`는 Appletalk에 구성된 모든 interface와 그 이름, Appletalk 주소, 해당 주소의 network 범위(phase 1 network에서는 network 번호), interface 상태를 표시합니다.

`/proc/net/atalk_route`는 알려진 각 network route의 target network, router(직접 연결일 수 있음), route flag, 사용하는 device를 표시합니다.

5. TIPC

488-490

TIPC protocol의 조정 항목입니다.

tipc_rmem

491-507

TIPC receive memory를 `tcp_rmem`처럼 조정하는 세 정수 `(min, default, max)` vector입니다.

# cat /proc/sys/net/tipc/tipc_rmem
4252725 34021800        68043600
#

최댓값은 `CONN_OVERLOAD_LIMIT`이고 default와 min은 같은 값을 shift해 조정한 값입니다. 현재 min은 의미 있게 사용되지 않지만 `tcp_rmem` 같은 항목과 일관성을 유지하려고 triplet 형식을 보존합니다.

named_timeout

508-519

TIPC name table update는 transaction 처리 없이 cluster에 비동기로 배포되므로 race가 생길 수 있습니다. 예를 들어 한 node의 name withdrawal이 다른 node에 도착하기 전에 세 번째 node의 겹치는 name publication이 받아들여져, 원래 순서가 올바른 update도 충돌할 수 있습니다.

`named_timeout`이 0이 아니면 실패한 topology update를 defer queue에 넣고, 오류를 해소하는 다른 event가 오거나 timeout이 끝날 때까지 기다립니다. 단위는 millisecond입니다.