Part 1
요약·해설
IEEE 802.1Q VLAN을 interface로 모델링하고 count·tag·IP 설정과 shell 제어를 설명합니다.
OSI L2
VLAN = virtual iface
Enable · Disable tag
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
A3D4A991059EF9ACCDEAE300195CCF7FEAF6A9FADA889E917573F729162A7BB0
.. _vlan_interface:
Virtual LAN (VLAN) Support
##########################
.. contents::
:local:
:depth: 2
Overview
********
`Virtual LAN <https://wikipedia.org/wiki/Virtual_LAN>`_ (VLAN) is a
partitioned and isolated computer network at the data link layer
(OSI layer 2). For ethernet network this refers to
`IEEE 802.1Q <https://en.wikipedia.org/wiki/IEEE_802.1Q>`_
In Zephyr, each individual VLAN is modeled as a virtual network interface.
This means that there is an ethernet network interface that corresponds to
a real physical ethernet port in the system. A virtual network interface is
created for each VLAN, and this virtual network interface connects to the
real network interface. This is similar to how Linux implements VLANs. The
*eth0* is the real network interface and *vlan0* is a virtual network interface
that is run on top of *eth0*.
VLAN support must be enabled at compile time by setting option
:kconfig:option:`CONFIG_NET_VLAN` and :kconfig:option:`CONFIG_NET_VLAN_COUNT` to reflect how
many network interfaces there will be in the system. For example, if there is
one network interface without VLAN support, and two with VLAN support, the
:kconfig:option:`CONFIG_NET_VLAN_COUNT` option should be set to 3.
Even if VLAN is enabled in a :file:`prj.conf` file, the VLAN needs to be
activated at runtime by the application. The VLAN API provides a
:c:func:`net_eth_vlan_enable` function to do that. The application needs
to give the network interface and desired VLAN tag as a parameter to that
function. The VLAN tagging for a given network interface can be disabled by a
:c:func:`net_eth_vlan_disable` function. The application needs to configure
the VLAN network interface itself, such as setting the IP address, etc.
See also the :zephyr:code-sample:`VLAN sample application <vlan>` for API usage
example. The source code for that sample application can be found at
:zephyr_file:`samples/net/vlan`.
The net-shell module contains *net vlan add* and *net vlan del* commands
that can be used to enable or disable VLAN tags for a given network interface.
See the `IEEE 802.1Q spec`_ for more information about ethernet VLANs.
.. _IEEE 802.1Q spec: https://ieeexplore.ieee.org/document/6991462/
API Reference
*************
.. doxygengroup:: vlan_api
Part 3
한국어 전문 번역
개요
Virtual LAN(VLAN)은 data link layer, 즉 OSI layer 2에서 분할되고 격리된 computer network입니다. Ethernet network에서는 IEEE 802.1Q를 가리킵니다.
Zephyr에서 개별 VLAN 하나는 virtual network interface 하나로 모델링됩니다. System의 실제 physical Ethernet port에 대응하는 Ethernet interface가 있고 각 VLAN마다 virtual interface를 만들어 실제 interface에 연결합니다. Linux VLAN 구현과 비슷합니다. eth0는 실제 network interface이고 vlan0는 eth0 위에서 실행되는 virtual network interface입니다.
CONFIG_NET_VLAN을 설정해 compile time에 VLAN support를 활성화하고, CONFIG_NET_VLAN_COUNT에는 system의 전체 network interface 수를 반영해야 합니다. 예를 들어 VLAN을 지원하지 않는 interface가 하나, 지원하는 interface가 둘이면 CONFIG_NET_VLAN_COUNT를 3으로 설정합니다.
prj.conf에서 VLAN을 활성화했더라도 application이 runtime에 VLAN을 활성화해야 합니다. net_eth_vlan_enable()에 network interface와 원하는 VLAN tag를 전달합니다. 특정 interface의 VLAN tagging은 net_eth_vlan_disable()로 끌 수 있습니다. IP address 설정 등 VLAN virtual interface 자체의 구성도 application이 해야 합니다.
API 사용 예는 VLAN sample application과 samples/net/vlan source를 참고하십시오.
net-shell의 net vlan add와 net vlan del 명령으로 특정 network interface의 VLAN tag를 활성화하거나 비활성화할 수 있습니다.
Ethernet VLAN의 자세한 내용은 IEEE 802.1Q specification을 참고하십시오.
API Reference
Doxygen group vlan_api가 API reference를 제공합니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.