connectivity/networking/net_config_guide.html · connectivity/networking/net_config_guide.rst 공식 원문 ↗

Zephyr 3.7.0 · Connectivity · Networking

Network Configuration Guide

제한된 memory와 concurrency 요구에 맞춰 packet buffer, connection, socket, protocol window와 network thread를 조정합니다.

Official pathconnectivity/networking/net_config_guide.html
Source fileconnectivity/networking/net_config_guide.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

Network resource를 결정하는 Kconfig option을 기능별로 설명하고, 기본값·memory trade-off·의존 관계와 tuning 위험을 함께 정리합니다.

Memory

Packet · Buffer · Window

Endpoints

Connection · Socket · TLS

Scheduling

Traffic class · Stack

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 7A3BFD28BF08FFD22A17442ED598B2046199DF62C4EDD7612EE5D2C1299A47C9
.. _network_configuration_guide:

Network Configuration Guide
###########################

.. contents::
    :local:
    :depth: 2

This document describes how various network configuration options can be
set according to available resources in the system.

Network Buffer Configuration Options
************************************

The network buffer configuration options control how much data we
are able to either send or receive at the same time.

:kconfig:option:`CONFIG_NET_PKT_RX_COUNT`
  Maximum amount of network packets we can receive at the same time.

:kconfig:option:`CONFIG_NET_PKT_TX_COUNT`
  Maximum amount of network packet sends pending at the same time.

:kconfig:option:`CONFIG_NET_BUF_RX_COUNT`
  How many network buffers are allocated for receiving data.
  Each net_buf contains a small header and either a fixed or variable
  length data buffer. The :kconfig:option:`CONFIG_NET_BUF_DATA_SIZE`
  is used when :kconfig:option:`CONFIG_NET_BUF_FIXED_DATA_SIZE` is set.
  This is the default setting. The default size of the buffer is 128 bytes.

  The :kconfig:option:`CONFIG_NET_BUF_VARIABLE_DATA_SIZE` is an experimental
  setting. There each net_buf data portion is allocated from a memory pool and
  can be the amount of data we have received from the network.
  When data is received from the network, it is placed into net_buf data portion.
  Depending on device resources and desired network usage, user can tweak
  the size of the fixed buffer by setting :kconfig:option:`CONFIG_NET_BUF_DATA_SIZE`, and
  the size of the data pool size by setting :kconfig:option:`CONFIG_NET_PKT_BUF_RX_DATA_POOL_SIZE`
  and :kconfig:option:`CONFIG_NET_PKT_BUF_TX_DATA_POOL_SIZE` if variable size buffers are used.

  When using the fixed size data buffers, the memory consumption of network buffers
  can be tweaked by selecting the size of the data part according to what kind of network
  data we are receiving. If one sets the data size to 256, but only receives packets
  that are 32 bytes long, then we are "wasting" 224 bytes for each packet because we
  cannot utilize the remaining data. One should not set the data size too low because
  there is some overhead involved for each net_buf. For these reasons the default
  network buffer size is set to 128 bytes.

  The variable size data buffer feature is marked as experimental as it has not
  received as much testing as the fixed size buffers. Using variable size data
  buffers tries to improve memory utilization by allocating minimum amount of
  data we need for the network data. The extra cost here is the amount of time
  that is needed when dynamically allocating the buffer from the memory pool.

  For example, in Ethernet the maximum transmission unit (MTU) size is 1500 bytes.
  If one wants to receive two full frames, then the net_pkt RX count should be set to 2,
  and net_buf RX count to (1500 / 128) * 2 which is 24.
  If TCP is being used, then these values need to be higher because we can queue the
  packets internally before delivering to the application.

:kconfig:option:`CONFIG_NET_BUF_TX_COUNT`
  How many network buffers are allocated for sending data. This is similar setting
  as the receive buffer count but for sending.


Connection Options
******************

:kconfig:option:`CONFIG_NET_MAX_CONN`
  This option tells how many network connection endpoints are supported.
  For example each TCP connection requires one connection endpoint. Similarly
  each listening UDP connection requires one connection endpoint.
  Also various system services like DHCP and DNS need connection endpoints to work.
  The network shell command **net conn** can be used at runtime to see the
  network connection information.

:kconfig:option:`CONFIG_NET_MAX_CONTEXTS`
  Number of network contexts to allocate. Each network context describes a network
  5-tuple that is used when listening or sending network traffic. Each BSD socket in the
  system uses one network context.


Socket Options
**************

:kconfig:option:`CONFIG_NET_SOCKETS_POLL_MAX`
  Maximum number of supported poll() entries. One needs to select proper value here depending
  on how many BSD sockets are polled in the system.

:kconfig:option:`CONFIG_ZVFS_OPEN_MAX`
  Maximum number of open file descriptors, this includes files, sockets, special devices, etc.
  One needs to select proper value here depending on how many BSD sockets are created in
  the system.

:kconfig:option:`CONFIG_NET_SOCKETPAIR_BUFFER_SIZE`
  This option is used by socketpair() function. It sets the size of the
  internal intermediate buffer, in bytes. This sets the limit how large
  messages can be passed between two socketpair endpoints.


TLS Options
***********

:kconfig:option:`CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS`
  Maximum number of TLS/DTLS contexts. Each TLS/DTLS connection needs one context.

:kconfig:option:`CONFIG_NET_SOCKETS_TLS_MAX_CREDENTIALS`
  This variable sets maximum number of TLS/DTLS credentials that can be
  used with a specific socket.

:kconfig:option:`CONFIG_NET_SOCKETS_TLS_MAX_CIPHERSUITES`
  Maximum number of TLS/DTLS ciphersuites per socket.
  This variable sets maximum number of TLS/DTLS ciphersuites that can
  be used with specific socket, if set explicitly by socket option.
  By default, all ciphersuites that are available in the system are
  available to the socket.

:kconfig:option:`CONFIG_NET_SOCKETS_TLS_MAX_APP_PROTOCOLS`
  Maximum number of supported application layer protocols.
  This variable sets maximum number of supported application layer
  protocols over TLS/DTLS that can be set explicitly by a socket option.
  By default, no supported application layer protocol is set.

:kconfig:option:`CONFIG_NET_SOCKETS_TLS_MAX_CLIENT_SESSION_COUNT`
  This variable specifies maximum number of stored TLS/DTLS sessions,
  used for TLS/DTLS session resumption.

:kconfig:option:`CONFIG_TLS_MAX_CREDENTIALS_NUMBER`
   Maximum number of TLS credentials that can be registered.
   Make sure that this value is high enough so that all the
   certificates can be loaded to the store.


IPv4/6 Options
**************

:kconfig:option:`CONFIG_NET_IF_MAX_IPV4_COUNT`
   Maximum number of IPv4 network interfaces in the system.
   This tells how many network interfaces there will be in the system
   that will have IPv4 enabled.
   For example if you have two network interfaces, but only one of them
   can use IPv4 addresses, then this value can be set to 1.
   If both network interface could use IPv4, then the setting should be
   set to 2.

:kconfig:option:`CONFIG_NET_IF_MAX_IPV6_COUNT`
   Maximum number of IPv6 network interfaces in the system.
   This is similar setting as the IPv4 count option but for IPv6.


TCP Options
***********

:kconfig:option:`CONFIG_NET_TCP_TIME_WAIT_DELAY`
  How long to wait in TCP *TIME_WAIT* state (in milliseconds).
  To avoid a (low-probability) issue when delayed packets from
  previous connection get delivered to next connection reusing
  the same local/remote ports,
  `RFC 793 <https://www.rfc-editor.org/rfc/rfc793>`_ (TCP) suggests
  to keep an old, closed connection in a special *TIME_WAIT* state for
  the duration of 2*MSL (Maximum Segment Lifetime). The RFC
  suggests to use MSL of 2 minutes, but notes

  *This is an engineering choice, and may be changed if experience indicates
  it is desirable to do so.*

  For low-resource systems, having large MSL may lead to quick
  resource exhaustion (and related DoS attacks). At the same time,
  the issue of packet misdelivery is largely alleviated in the modern
  TCP stacks by using random, non-repeating port numbers and initial
  sequence numbers. Due to this, Zephyr uses much lower value of 1500ms
  by default. Value of 0 disables *TIME_WAIT* state completely.

:kconfig:option:`CONFIG_NET_TCP_RETRY_COUNT`
  Maximum number of TCP segment retransmissions.
  The following formula can be used to determine the time (in ms)
  that a segment will be buffered awaiting retransmission:

  .. math::

     \sum_{n=0}^{\mathtt{NET\_TCP\_RETRY\_COUNT}} \bigg(1 \ll n\bigg)\times
     \mathtt{NET\_TCP\_INIT\_RETRANSMISSION\_TIMEOUT}

  With the default value of 9, the IP stack will try to
  retransmit for up to 1:42 minutes.  This is as close as possible
  to the minimum value recommended by
  `RFC 1122 <https://www.rfc-editor.org/rfc/rfc1122>`_ (1:40 minutes).
  Only 5 bits are dedicated for the retransmission count, so accepted
  values are in the 0-31 range.  It's highly recommended to not go
  below 9, though.

  Should a retransmission timeout occur, the receive callback is
  called with :code:`-ETIMEDOUT` error code and the context is dereferenced.

:kconfig:option:`CONFIG_NET_TCP_MAX_SEND_WINDOW_SIZE`
  Maximum sending window size to use.
  This value affects how the TCP selects the maximum sending window
  size. The default value 0 lets the TCP stack select the value
  according to amount of network buffers configured in the system.
  Note that if there are multiple active TCP connections in the system,
  then this value might require finetuning (lowering), otherwise multiple
  TCP connections could easily exhaust net_buf pool for the queued TX data.

:kconfig:option:`CONFIG_NET_TCP_MAX_RECV_WINDOW_SIZE`
  Maximum receive window size to use.
  This value defines the maximum TCP receive window size. Increasing
  this value can improve connection throughput, but requires more
  receive buffers available in the system for efficient operation.
  The default value 0 lets the TCP stack select the value
  according to amount of network buffers configured in the system.

:kconfig:option:`CONFIG_NET_TCP_RECV_QUEUE_TIMEOUT`
  How long to queue received data (in ms).
  If we receive out-of-order TCP data, we queue it. This value tells
  how long the data is kept before it is discarded if we have not been
  able to pass the data to the application. If set to 0, then receive
  queueing is not enabled. The value is in milliseconds.

  Note that we only queue data sequentially in current version i.e.,
  there should be no holes in the queue. For example, if we receive
  SEQs 5,4,3,6 and are waiting SEQ 2, the data in segments 3,4,5,6 is
  queued (in this order), and then given to application when we receive
  SEQ 2. But if we receive SEQs 5,4,3,7 then the SEQ 7 is discarded
  because the list would not be sequential as number 6 is be missing.


Traffic Class Options
*********************

It is possible to configure multiple traffic classes (queues) when receiving
or sending network data. Each traffic class queue is implemented as a thread
with different priority. This means that higher priority network packet can
be placed to a higher priority network queue in order to send or receive it
faster or slower. Because of thread scheduling latencies, in practice the
fastest way to send a packet out, is to directly send the packet without
using a dedicated traffic class thread. This is why by default the
:kconfig:option:`CONFIG_NET_TC_TX_COUNT` option is set to 0 if userspace is
not enabled. If userspace is enabled, then the minimum TX traffic class
count is 1. Reason for this is that the userspace application does not
have enough permissions to deliver the message directly.

In receiving side, it is recommended to have at least one receiving traffic
class queue. Reason is that typically the network device driver is running
in IRQ context when it receives the packet, in which case it should not try
to deliver the network packet directly to the upper layers, but to place
the packet to the traffic class queue. If the network device driver is not
running in IRQ context when it gets the packet, then the RX traffic class
option :kconfig:option:`CONFIG_NET_TC_RX_COUNT` could be set to 0.


Stack Size Options
******************

There several network specific threads in a network enabled system.
Some of the threads might depend on a configure option which can be
used to enable or disable a feature. Each thread stack size is optimized
to allow normal network operations.

The network management API is using a dedicated thread by default. The thread
is responsible to deliver network management events to the event listeners that
are setup in the system if the :kconfig:option:`CONFIG_NET_MGMT` and
:kconfig:option:`CONFIG_NET_MGMT_EVENT` options are enabled.
If the options are enabled, the user is able to register a callback function
that the net_mgmt thread is calling for each network management event.
By default the net_mgmt event thread stack size is rather small.
The idea is that the callback function does minimal things so that new
events can be delivered to listeners as fast as possible and they are not lost.
The net_mgmt event thread stack size is controlled by
:kconfig:option:`CONFIG_NET_MGMT_EVENT_QUEUE_SIZE` option. It is recommended
to not do any blocking operations in the callback function.

The network thread stack utilization can be monitored from kernel shell by
the **kernel threads** command.

Part 3

한국어 전문 번역

Network Configuration Guide

이 문서는 system에서 사용할 수 있는 resource에 맞춰 여러 network configuration option을 설정하는 방법을 설명합니다.

Network buffer 설정 option

Network buffer configuration option은 동시에 송신하거나 수신할 수 있는 data 양을 제어합니다.

CONFIG_NET_PKT_RX_COUNT

동시에 수신할 수 있는 network packet의 최대 개수입니다.

CONFIG_NET_PKT_TX_COUNT

동시에 송신 대기 상태로 둘 수 있는 network packet의 최대 개수입니다.

CONFIG_NET_BUF_RX_COUNT

Data 수신용으로 할당할 network buffer 개수입니다.

각 net_buf에는 작은 header와 고정 길이 또는 가변 길이 data buffer가 들어 있습니다. 기본 설정인 CONFIG_NET_BUF_FIXED_DATA_SIZE를 사용하면 CONFIG_NET_BUF_DATA_SIZE가 data buffer 크기를 정하며 기본값은 128 byte입니다.

CONFIG_NET_BUF_VARIABLE_DATA_SIZE는 실험적 설정입니다. 이 방식에서는 각 net_buf의 data 부분을 memory pool에서 할당하며 실제 network에서 수신한 data 양만큼만 잡을 수 있습니다. 수신 data는 net_buf의 data 부분에 저장됩니다.

Device resource와 network 사용 방식에 따라 고정 buffer 크기는 CONFIG_NET_BUF_DATA_SIZE로 조절합니다. Variable size buffer를 사용한다면 data pool 크기를 CONFIG_NET_PKT_BUF_RX_DATA_POOL_SIZE와 CONFIG_NET_PKT_BUF_TX_DATA_POOL_SIZE로 설정합니다.

Fixed size data buffer의 memory 소비량은 예상하는 network data 크기에 맞춰 data 부분의 크기를 정해 조절할 수 있습니다. Data size를 256으로 설정했는데 32 byte packet만 수신하면 packet마다 남은 영역을 사용할 수 없어 224 byte를 낭비합니다. 반대로 너무 작게 설정하면 net_buf마다 필요한 overhead가 늘어납니다. 이런 절충 때문에 기본 network buffer 크기는 128 byte입니다.

Variable size data buffer 기능은 fixed size buffer만큼 충분히 검증되지 않아 experimental로 표시됩니다. 필요한 최소 data 양만 memory pool에서 동적으로 할당해 memory utilization을 높이려 하지만, buffer를 동적으로 할당하는 시간이 추가 비용으로 발생합니다.

예를 들어 Ethernet MTU는 1500 byte입니다. Full frame 두 개를 받으려면 net_pkt RX count를 2로, net_buf RX count를 (1500 / 128) × 2인 24로 설정해야 합니다. TCP를 사용하면 application에 전달하기 전에 packet을 내부 queue에 보관할 수 있으므로 이 값들을 더 크게 잡아야 합니다.

CONFIG_NET_BUF_TX_COUNT

Data 송신용으로 할당할 network buffer 개수입니다. 수신 buffer count와 같은 개념을 송신 방향에 적용한 설정입니다.

Connection option

CONFIG_NET_MAX_CONN

지원할 network connection endpoint 개수입니다. TCP connection 하나마다 endpoint 하나가 필요하고, listen 중인 UDP connection도 하나씩 필요합니다. DHCP와 DNS 같은 system service 역시 동작하려면 connection endpoint가 필요합니다.

Runtime에는 network shell의 net conn command로 network connection 정보를 확인할 수 있습니다.

CONFIG_NET_MAX_CONTEXTS

할당할 network context 개수입니다. 각 network context는 network traffic을 listen하거나 송신할 때 사용하는 network 5-tuple을 나타냅니다. System의 BSD socket 하나마다 network context 하나를 사용합니다.

Socket option

CONFIG_NET_SOCKETS_POLL_MAX

poll()이 지원하는 entry의 최대 개수입니다. System에서 poll할 BSD socket 수에 맞춰 적절한 값을 선택해야 합니다.

CONFIG_ZVFS_OPEN_MAX

열 수 있는 file descriptor의 최대 개수입니다. File, socket, special device 등이 모두 포함되므로 system에서 생성할 BSD socket 수와 다른 descriptor를 함께 고려해 설정합니다.

CONFIG_NET_SOCKETPAIR_BUFFER_SIZE

socketpair()가 사용하는 내부 intermediate buffer의 byte 크기입니다. 두 socketpair endpoint 사이에서 전달할 수 있는 message의 최대 크기를 제한합니다.

TLS option

CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS

TLS/DTLS context의 최대 개수입니다. TLS/DTLS connection마다 context 하나가 필요합니다.

CONFIG_NET_SOCKETS_TLS_MAX_CREDENTIALS

특정 socket에서 사용할 수 있는 TLS/DTLS credential의 최대 개수입니다.

CONFIG_NET_SOCKETS_TLS_MAX_CIPHERSUITES

Socket 하나당 TLS/DTLS ciphersuite의 최대 개수입니다. Socket option으로 명시적으로 설정할 때 사용할 수 있는 수를 제한합니다. 기본적으로는 system에서 사용할 수 있는 모든 ciphersuite가 socket에도 제공됩니다.

CONFIG_NET_SOCKETS_TLS_MAX_APP_PROTOCOLS

TLS/DTLS 위에서 지원할 application layer protocol의 최대 개수입니다. Socket option으로 명시적으로 설정할 수 있는 수를 제한하며, 기본값에서는 지원 application layer protocol을 따로 설정하지 않습니다.

CONFIG_NET_SOCKETS_TLS_MAX_CLIENT_SESSION_COUNT

TLS/DTLS session resumption에 사용할 수 있도록 저장하는 TLS/DTLS session의 최대 개수입니다.

CONFIG_TLS_MAX_CREDENTIALS_NUMBER

등록할 수 있는 TLS credential의 최대 개수입니다. 필요한 certificate를 모두 store에 적재할 수 있을 만큼 충분히 크게 설정해야 합니다.

IPv4/IPv6 option

CONFIG_NET_IF_MAX_IPV4_COUNT

System에서 IPv4를 활성화할 network interface의 최대 개수입니다. Interface가 두 개여도 IPv4 address를 사용할 수 있는 것이 하나뿐이면 1로 설정할 수 있습니다. 둘 다 IPv4를 사용할 수 있으면 2로 설정합니다.

CONFIG_NET_IF_MAX_IPV6_COUNT

System에서 IPv6를 활성화할 network interface의 최대 개수입니다. IPv4 count option과 같은 개념을 IPv6에 적용합니다.

TCP option

CONFIG_NET_TCP_TIME_WAIT_DELAY

TCP TIME_WAIT state에서 기다릴 시간이며 millisecond 단위입니다.

이전 connection에서 지연된 packet이 같은 local/remote port를 재사용하는 다음 connection에 전달되는 낮은 확률의 문제를 막기 위해 RFC 793은 닫힌 connection을 2 × MSL(Maximum Segment Lifetime) 동안 TIME_WAIT에 유지하라고 제안합니다. RFC가 제시하는 MSL은 2분이지만 실제 경험에 따라 바꿀 수 있는 engineering choice라고 명시합니다.

Resource가 적은 system에서는 큰 MSL이 resource를 빠르게 고갈시켜 DoS attack과 연결될 수 있습니다. 현대 TCP stack은 random이며 반복되지 않는 port number와 initial sequence number를 사용해 잘못된 packet 전달 위험을 크게 줄입니다.

따라서 Zephyr 기본값은 훨씬 짧은 1500ms입니다. 0으로 설정하면 TIME_WAIT state를 완전히 비활성화합니다.

CONFIG_NET_TCP_RETRY_COUNT

TCP segment retransmission의 최대 횟수입니다. Segment가 retransmission을 기다리며 buffer에 남아 있는 시간은 다음 식으로 구할 수 있습니다.

Σ(n=0..NET_TCP_RETRY_COUNT) (1 << n) × NET_TCP_INIT_RETRANSMISSION_TIMEOUT

기본값 9이면 IP stack은 최대 1분 42초 동안 retransmission을 시도합니다. 이는 RFC 1122가 권장하는 최소값 1분 40초에 최대한 가깝습니다.

Retransmission count에는 5 bit만 사용하므로 허용 범위는 0~31입니다. 9보다 낮추지 않는 것을 강하게 권장합니다.

Retransmission timeout이 발생하면 receive callback을 -ETIMEDOUT error code와 함께 호출하고 context reference를 해제합니다.

CONFIG_NET_TCP_MAX_SEND_WINDOW_SIZE

사용할 최대 send window 크기입니다. 기본값 0이면 구성된 network buffer 양에 따라 TCP stack이 값을 선택합니다. Active TCP connection이 여러 개라면 queue에 쌓인 TX data가 net_buf pool을 쉽게 소진하지 않도록 값을 낮추는 tuning이 필요할 수 있습니다.

CONFIG_NET_TCP_MAX_RECV_WINDOW_SIZE

사용할 최대 TCP receive window 크기입니다. 값을 키우면 connection throughput이 향상될 수 있지만 효율적으로 동작하려면 더 많은 receive buffer가 필요합니다. 기본값 0이면 구성된 network buffer 양에 따라 TCP stack이 값을 선택합니다.

CONFIG_NET_TCP_RECV_QUEUE_TIMEOUT

수신 data를 queue에 유지할 millisecond 단위 시간입니다. Out-of-order TCP data를 받으면 application에 전달할 수 있을 때까지 queue에 보관하고, 이 시간이 지나면 폐기합니다. 0이면 receive queueing을 사용하지 않습니다.

현재 version은 연속된 data만 queue에 보관할 수 있어 중간에 hole이 없어야 합니다. SEQ 2를 기다리는 중 5, 4, 3, 6을 받으면 segment 3, 4, 5, 6을 이 순서로 queue에 넣고 SEQ 2가 오면 application에 전달합니다. 반면 5, 4, 3, 7을 받으면 6이 없어 연속 list가 되지 않으므로 SEQ 7을 버립니다.

Traffic class option

Network data를 송수신할 때 여러 traffic class queue를 구성할 수 있습니다. 각 traffic class queue는 서로 다른 priority를 가진 thread로 구현됩니다. Priority가 높은 network packet을 더 높은 priority의 queue에 넣어 더 빠르게 처리하거나, 반대로 낮은 priority로 늦출 수 있습니다.

Thread scheduling latency 때문에 실제로 packet을 가장 빨리 내보내는 방법은 전용 traffic class thread를 거치지 않고 직접 전송하는 것입니다. 그래서 userspace를 사용하지 않을 때 CONFIG_NET_TC_TX_COUNT의 기본값은 0입니다.

Userspace가 활성화되면 TX traffic class count의 최솟값은 1입니다. Userspace application에는 message를 직접 전달할 권한이 충분하지 않기 때문입니다.

수신 방향에는 traffic class queue를 하나 이상 두는 것이 권장됩니다. Network device driver는 packet 수신 시 보통 IRQ context에서 실행되므로 upper layer로 직접 전달하지 않고 traffic class queue에 넣어야 합니다.

Device driver가 packet을 받을 때 IRQ context에서 실행되지 않는다면 RX traffic class option CONFIG_NET_TC_RX_COUNT를 0으로 설정할 수 있습니다.

Stack size option

Networking이 활성화된 system에는 network 전용 thread가 여러 개 있습니다. 일부 thread는 feature를 켜거나 끄는 configuration option에 따라 존재하며, 각 thread stack size는 일반적인 network 동작이 가능하도록 최적화돼 있습니다.

Network management API는 기본적으로 전용 thread를 사용합니다. CONFIG_NET_MGMT와 CONFIG_NET_MGMT_EVENT를 켜면 이 thread가 system에 등록된 event listener로 network management event를 전달합니다.

Option이 활성화되면 사용자가 callback function을 등록할 수 있고 net_mgmt thread가 각 network management event마다 이를 호출합니다.

기본 net_mgmt event thread stack은 비교적 작습니다. Callback이 최소한의 작업만 수행해 새 event가 최대한 빠르게 listener에 전달되고 유실되지 않도록 설계됐기 때문입니다.

CONFIG_NET_MGMT_EVENT_QUEUE_SIZE option이 net_mgmt event thread stack size를 제어합니다. Callback function에서는 blocking operation을 하지 않는 것이 권장됩니다.

Kernel shell의 kernel threads command로 network thread stack utilization을 감시할 수 있습니다.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.