Part 1
요약·해설
Build-time으로 선택 가능한 21개 기능, 4개 link layer와 networking source tree 6개 영역을 설명합니다.
IP
IPv6 · IPv4 · UDP · TCP
Services
TLS · MQTT · CoAP · HTTP · DNS
Links
Ethernet · Wi-Fi · 802.15.4
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
원문 SHA-256
2C36496E6171384528FCBDEE8470238E1DF2F1D69E1E6F03E74E5D9DBFEBF70A
.. _ip_stack_overview:
Overview
########
.. contents::
:local:
:depth: 2
Supported Features
******************
The networking IP stack is modular and highly configurable via build-time
configuration options. You can minimize system memory consumption by enabling
only those network features required by your application. Almost all features
can be disabled if not needed.
* **IPv6** The support for IPv6 is enabled by default. Various IPv6 sub-options
can be enabled or disabled depending on networking needs.
* Developer can set the number of unicast and multicast IPv6 addresses that
are active at the same time.
* The IPv6 address for the device can be set either statically or
dynamically using SLAAC (Stateless Address Auto Configuration)
(`RFC 4862 <https://tools.ietf.org/html/rfc4862>`_).
* The system also supports multiple IPv6 prefixes and the maximum
IPv6 prefix count can be configured at build time.
* The IPv6 neighbor cache can be disabled if not needed, and its size can be
configured at build time.
* The IPv6 neighbor discovery support
(`RFC 4861 <https://tools.ietf.org/html/rfc4861>`_) is enabled by default.
* Multicast Listener Discovery v2 support
(`RFC 3810 <https://tools.ietf.org/html/rfc3810>`_) is enabled by default.
* IPv6 header compression (6lo) is available for IPv6 connectivity for
IEEE 802.15.4 networks (`RFC 4944 <https://tools.ietf.org/html/rfc4944>`_).
* **IPv4** The legacy IPv4 is supported by the networking stack. It
cannot be used by IEEE 802.15.4 as this network technology supports
only IPv6. IPv4 can be used in Ethernet based networks. By default
IPv4 support is disabled.
* DHCP (Dynamic Host Configuration Protocol) client is supported
(`RFC 2131 <https://tools.ietf.org/html/rfc2131>`_).
* The IPv4 address can also be configured manually. Static IPv4 addresses
are supported by default.
* **Dual stack support.** The networking stack allows a developer to configure
the system to use both IPv6 and IPv4 at the same time.
* **UDP** User Datagram Protocol
(`RFC 768 <https://tools.ietf.org/html/rfc768>`_) is supported.
The developer can send UDP datagrams (client side support) or create a
listener to receive UDP packets destined to certain port (server side
support).
* **TCP** Transmission Control Protocol
(`RFC 793 <https://tools.ietf.org/html/rfc793>`_) is supported. Both server
and client roles can be used the application. The amount of TCP sockets
that are available to applications can be configured at build time.
* **BSD Sockets API** Support for a subset of a
:ref:`BSD sockets compatible API <bsd_sockets_interface>` is
implemented. Both blocking and non-blocking datagram (UDP) and stream (TCP)
sockets are supported.
* **Secure Sockets API** Experimental support for TLS/DTLS secure protocols and
configuration options for sockets API. Secure functions for the implementation
are provided by mbedTLS library.
* **MQTT** Message Queue Telemetry Transport (ISO/IEC PRF 20922) is supported.
A sample :zephyr:code-sample:`mqtt-publisher` client application for MQTT v3.1.1 is
implemented.
* **CoAP** Constrained Application Protocol
(`RFC 7252 <https://tools.ietf.org/html/rfc7252>`_) is supported.
Both :zephyr:code-sample:`coap-client` and :zephyr:code-sample:`coap-server` sample
applications are implemented.
* **LWM2M** OMA Lightweight Machine-to-Machine Protocol
(`LwM2M specification 1.0.2`_) is supported via the "Bootstrap", "Client
Registration", "Device Management & Service Enablement" and "Information
Reporting" interfaces. The required core LwM2M objects are implemented as
well as several IPSO Smart Objects. (`LwM2M specification 1.1.1`_) is
supported in similar manner when enabled with a Kconfig option.
:zephyr:code-sample:`lwm2m-client` sample implements the library as an example.
* **HTTP** Hypertext Transfer Protocol client and server are supported.
:ref:`http_client_interface` library supports HTTP/1.1 (`RFC 2616`_).
:ref:`http_server_interface` library supports HTTP/1.1 (`RFC 2616`_) and
HTTP/2 (`RFC 9113`_).
:zephyr:code-sample:`sockets-http-client` and
:zephyr:code-sample:`sockets-http-server` samples are provided.
* **DNS** Domain Name Service
(`RFC 1035 <https://tools.ietf.org/html/rfc1035>`_) client functionality
is supported.
Applications can use the DNS API to query domain name information or IP
addresses from the DNS server. Both IPv4 (A) and IPv6 (AAAA) records can
be queried.
Both multicast DNS (mDNS) (`RFC 6762 <https://tools.ietf.org/html/rfc6762>`_)
and link-local multicast name resolution
(LLMNR) (`RFC 4795 <https://tools.ietf.org/html/rfc4795>`_) are supported.
* **Network Management API.** Applications can use network management API to
listen management events generated by core stack when for example IP address
is added to the device, or network interface is coming up etc.
* **Wi-Fi Management API.** Applications can use Wi-Fi management API to
manage the interface, in example to connect to Wi-Fi network and to scan
available Wi-Fi networks.
* **Wi-Fi Network Manager API.** Wi-Fi Network Managers can now register
themselves to the Wi-Fi stack. The Network Managers can then implement
the Wi-Fi Management API and manage the Wi-Fi interface.
* **Multiple Network Technologies.** The Zephyr OS can be configured to
support multiple network technologies at the same time simply by enabling
them in Kconfig: for example, Ethernet, Wi-Fi and 802.15.4 support. Note
that no automatic IP routing functionality is provided between these
technologies. Applications can send data according to their needs to desired
network interface.
* **Minimal Copy Network Buffer Management.** It is possible to have minimal
copy network data path. This means that the system tries to avoid copying
application data when it is sent to the network.
* **Virtual LAN support.** Virtual LANs (VLANs) allow partitioning of physical
ethernet networks into logical networks.
See :ref:`VLAN support <vlan_interface>` for more details.
* **Network traffic classification.** The sent and received network packets can
be prioritized depending on application needs.
See :ref:`traffic classification <traffic-class-support>` for more details.
* **Time Sensitive Networking.** The gPTP (generalized Precision Time Protocol)
is supported. See :ref:`gPTP support <gptp_interface>` for more details.
* **Network shell.** The network shell provides helpers for figuring out
network status, enabling/disabling features, and issuing commands like ping
or DNS resolving. The net-shell is useful when developing network software.
See :ref:`network shell <net_shell>` for more details.
Additionally these network technologies (link layers) are supported in
Zephyr OS v1.7 and later:
* IEEE 802.15.4
* Bluetooth
* Ethernet
* SLIP (IP over serial line). Used for testing with QEMU. It provides
ethernet interface to host system (like Linux) and test applications
can be run in Linux host and send network data to Zephyr OS device.
Source Tree Layout
******************
The networking stack source code tree is organized as follows:
``subsys/net/ip/``
This is where the IP stack code is located.
``subsys/net/l2/``
This is where the IP stack layer 2 code is located. This includes generic
support for Ethernet, IEEE 802.15.4 and Wi-Fi.
``subsys/net/lib/``
Application-level protocols (DNS, MQTT, etc.) and additional stack
components (BSD Sockets, etc.).
``include/net/``
Public API header files. These are the header files applications need
to include to use IP networking functionality.
``samples/net/``
Sample networking code. This is a good reference to get started with
network application development.
``tests/net/``
Test applications. These applications are used to verify the
functionality of the IP stack, but are not the best
source for sample code (see ``samples/net`` instead).
.. _LwM2M specification 1.0.2:
http://openmobilealliance.org/release/LightweightM2M/V1_0_2-20180209-A/OMA-TS-LightweightM2M-V1_0_2-20180209-A.pdf
.. _LwM2M specification 1.1.1:
http://openmobilealliance.org/release/LightweightM2M/V1_1_1-20190617-A/
.. _RFC 2616:
https://tools.ietf.org/html/rfc2616
.. _RFC 9113:
https://tools.ietf.org/html/rfc9113
Part 3
한국어 전문 번역
Networking Overview
지원 기능
Networking IP stack은 module 방식이며 build-time configuration option으로 폭넓게 구성할 수 있습니다. Application에 필요한 network 기능만 켜 system memory 소비를 최소화할 수 있고, 필요하지 않은 기능은 거의 모두 비활성화할 수 있습니다.
- IPv6. IPv6 지원은 기본으로 활성화되며 network 요구에 따라 여러 세부 option을 켜거나 끌 수 있습니다.
- 동시에 활성화할 unicast·multicast IPv6 address 수를 지정할 수 있습니다.
- Device IPv6 address는 static으로 설정하거나 RFC 4862 SLAAC(Stateless Address Auto Configuration)로 동적 설정할 수 있습니다.
- 여러 IPv6 prefix를 지원하며 최대 prefix 수를 build time에 정할 수 있습니다.
- IPv6 neighbor cache가 필요 없으면 끌 수 있고 크기도 build time에 설정할 수 있습니다.
- RFC 4861 IPv6 Neighbor Discovery는 기본으로 활성화됩니다.
- RFC 3810 Multicast Listener Discovery v2도 기본으로 활성화됩니다.
- IEEE 802.15.4 network의 IPv6 connectivity에는 RFC 4944 IPv6 header compression(6Lo)을 사용할 수 있습니다.
- IPv4. 기존 IPv4도 network stack이 지원합니다. IEEE 802.15.4는 IPv6만 지원하므로 IPv4를 사용할 수 없고, Ethernet 기반 network에서는 사용할 수 있습니다. IPv4 지원 기본값은 비활성화입니다.
- RFC 2131 DHCP client를 지원합니다.
- IPv4 address를 수동으로 설정할 수도 있으며 static IPv4 address는 기본 지원됩니다.
- Dual stack. IPv6와 IPv4를 동시에 사용하도록 system을 구성할 수 있습니다.
- UDP. RFC 768 User Datagram Protocol을 지원합니다. Client로 datagram을 보내거나 특정 port로 오는 UDP packet을 받는 server listener를 만들 수 있습니다.
- TCP. RFC 793 Transmission Control Protocol을 지원합니다. Application이 server와 client 역할을 모두 사용할 수 있고 사용 가능한 TCP socket 수를 build time에 설정합니다.
- BSD Sockets API. BSD socket compatible API subset을 구현합니다. Blocking·non-blocking datagram(UDP) 및 stream(TCP) socket을 모두 지원합니다.
- Secure Sockets API. TLS/DTLS secure protocol과 socket API configuration option을 실험적으로 지원합니다. 실제 secure function은 mbedTLS library가 제공합니다.
- MQTT. ISO/IEC PRF 20922 Message Queue Telemetry Transport를 지원하며 MQTT v3.1.1 publisher client sample을 제공합니다.
- CoAP. RFC 7252 Constrained Application Protocol을 지원하며 coap-client와 coap-server sample을 제공합니다.
- LwM2M. OMA Lightweight Machine-to-Machine 1.0.2의 Bootstrap, Client Registration, Device Management & Service Enablement, Information Reporting interface를 지원합니다. 필수 core object와 여러 IPSO Smart Object를 구현합니다. Kconfig를 켜면 1.1.1도 비슷한 방식으로 지원하며 lwm2m-client sample이 library 사용 예를 제공합니다.
- HTTP. HTTP client와 server를 지원합니다. Client library는 HTTP/1.1, server library는 HTTP/1.1과 HTTP/2를 지원하며 sockets-http-client·server sample을 제공합니다.
- DNS. RFC 1035 DNS client 기능을 제공합니다. Domain name 또는 IP address를 질의하며 IPv4 A record와 IPv6 AAAA record를 모두 조회할 수 있습니다. RFC 6762 mDNS와 RFC 4795 LLMNR도 지원합니다.
- Network Management API. Device에 IP address가 추가되거나 network interface가 up 상태가 되는 등 core stack이 생성한 management event를 application이 수신할 수 있습니다.
- Wi-Fi Management API. Wi-Fi network 연결과 사용 가능한 network scan 같은 interface 관리 기능을 제공합니다.
- Wi-Fi Network Manager API. Wi-Fi Network Manager가 Wi-Fi stack에 자신을 등록하고 Wi-Fi Management API를 구현해 interface를 관리할 수 있습니다.
- Multiple Network Technologies. Kconfig에서 Ethernet, Wi-Fi, IEEE 802.15.4 등을 켜 여러 network technology를 동시에 지원할 수 있습니다. Technology 사이의 automatic IP routing은 제공하지 않으므로 application이 목적에 맞는 network interface로 data를 보내야 합니다.
- Minimal Copy Network Buffer Management. 송신 시 application data 복사를 피하려는 minimal-copy network data path를 구성할 수 있습니다.
- Virtual LAN. VLAN으로 physical Ethernet network를 여러 logical network로 나눌 수 있습니다.
- Network traffic classification. Application 요구에 따라 송수신 network packet의 priority를 정할 수 있습니다.
- Time Sensitive Networking. gPTP(generalized Precision Time Protocol)를 지원합니다.
- Network shell. Network status 확인, 기능 활성화·비활성화, ping, DNS resolve command를 제공하며 network software 개발에 유용합니다.
Zephyr OS v1.7 이후에는 다음 network technology(link layer)도 지원합니다.
- IEEE 802.15.4
- Bluetooth
- Ethernet
- SLIP(IP over serial line). QEMU test에 사용하며 Linux 같은 host에 Ethernet interface를 제공해 host test application이 Zephyr device로 network data를 보낼 수 있습니다.
Source tree 구조
subsys/net/ip/- IP stack code가 위치합니다.
subsys/net/l2/- IP stack layer 2 code가 위치하며 Ethernet, IEEE 802.15.4, Wi-Fi 공통 지원을 포함합니다.
subsys/net/lib/- DNS·MQTT 같은 application-level protocol과 BSD Sockets 같은 추가 stack component가 위치합니다.
include/net/- IP networking을 사용하는 application이 include할 public API header file입니다.
samples/net/- Network application 개발을 시작할 때 참고하기 좋은 sample networking code입니다.
tests/net/- IP stack 기능 검증용 test application입니다. Sample code 출처로는 적합하지 않으므로 samples/net을 사용하십시오.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.