← Documents Documentation/networking/batman-adv.rst GitHub 원문 ↗

Linux 6.18.37 · Networking

batman-adv

Layer 2 mesh switch인 batman-adv의 interface 구성, 사용, 진단을 설명합니다.

Source pathDocumentation/networking/batman-adv.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

batman-adv.rst:1-168

batman-adv는 여러 lower interface를 하나의 `bat0` Layer 2 mesh switch로 묶습니다. IP 설정은 lower interface가 아니라 `bat0`에 두며, topology 변화 감도와 overhead는 originator interval로 조절합니다.

batman-adv interface 계층
eth0masterbat0
wlan0masterbat0
VPN L2 interfacemasterbat0
bat0IPv4·IPv6·DHCP·IPX상위 protocol

여러 Ethernet-style link가 하나의 virtual switch interface로 합쳐집니다.

bat0 생명주기
작업iproute2batctl
생성ip link add name bat0 type batadvinterface create
lower link 추가ip link set dev eth0 master bat0interface add -M eth0
lower link 제거ip link set dev eth0 nomasterinterface del -M eth0
제거ip link delete bat0interface destroy

iproute2와 batctl의 대응 작업을 정리합니다.

Topology 반응성과 overhead
설정반응성Overhead
짧은 interval높음높음
긴 interval낮음낮음

originator interval을 줄이면 변화 감지는 빨라지지만 broadcast 비용이 증가합니다.

batman-adv 진단 경로
목적도구
Kernel messagedmesg | grep batman-adv
Trace eventtrace-cmd stream -e batadv:batadv_dbg
Route·TT 변경batctl -m bat0 loglevel routes tt
Packet counterethtool --statistics bat0
Mesh ping·traceroute·tcpdumpbatctl

문제 유형에 따라 확인할 도구를 고릅니다.

Mesh data 전달
Application·IP stackpacketbat0
bat0mesh forwarding 결정batman-adv
batman-adv선택된 hard interfacemesh peer

상위 stack은 lower interface 대신 bat0에 data를 넘깁니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ==========
4 batman-adv
5 ==========
6
7 Batman advanced is a new approach to wireless networking which does no longer
8 operate on the IP basis. Unlike the batman daemon, which exchanges information
9 using UDP packets and sets routing tables, batman-advanced operates on ISO/OSI
10 Layer 2 only and uses and routes (or better: bridges) Ethernet Frames. It
11 emulates a virtual network switch of all nodes participating. Therefore all
12 nodes appear to be link local, thus all higher operating protocols won't be
13 affected by any changes within the network. You can run almost any protocol
14 above batman advanced, prominent examples are: IPv4, IPv6, DHCP, IPX.
15
16 Batman advanced was implemented as a Linux kernel driver to reduce the overhead
17 to a minimum. It does not depend on any (other) network driver, and can be used
18 on wifi as well as ethernet lan, vpn, etc ... (anything with ethernet-style
19 layer 2).
20
21
22 Configuration
23 =============
24
25 Load the batman-adv module into your kernel::
26
27 $ insmod batman-adv.ko
28
29 The module is now waiting for activation. You must add some interfaces on which
30 batman-adv can operate. The batman-adv mesh-interface can be created using the
31 iproute2 tool ``ip``::
32
33 $ ip link add name bat0 type batadv
34
35 To activate a given interface simply attach it to the ``bat0`` interface::
36
37 $ ip link set dev eth0 master bat0
38
39 Repeat this step for all interfaces you wish to add. Now batman-adv starts
40 using/broadcasting on this/these interface(s).
41
42 To deactivate an interface you have to detach it from the "bat0" interface::
43
44 $ ip link set dev eth0 nomaster
45
46 The same can also be done using the batctl interface subcommand::
47
48 batctl -m bat0 interface create
49 batctl -m bat0 interface add -M eth0
50
51 To detach eth0 and destroy bat0::
52
53 batctl -m bat0 interface del -M eth0
54 batctl -m bat0 interface destroy
55
56 There are additional settings for each batadv mesh interface, vlan and hardif
57 which can be modified using batctl. Detailed information about this can be found
58 in its manual.
59
60 For instance, you can check the current originator interval (value
61 in milliseconds which determines how often batman-adv sends its broadcast
62 packets)::
63
64 $ batctl -M bat0 orig_interval
65 1000
66
67 and also change its value::
68
69 $ batctl -M bat0 orig_interval 3000
70
71 In very mobile scenarios, you might want to adjust the originator interval to a
72 lower value. This will make the mesh more responsive to topology changes, but
73 will also increase the overhead.
74
75 Information about the current state can be accessed via the batadv generic
76 netlink family. batctl provides a human readable version via its debug tables
77 subcommands.
78
79
80 Usage
81 =====
82
83 To make use of your newly created mesh, batman advanced provides a new
84 interface "bat0" which you should use from this point on. All interfaces added
85 to batman advanced are not relevant any longer because batman handles them for
86 you. Basically, one "hands over" the data by using the batman interface and
87 batman will make sure it reaches its destination.
88
89 The "bat0" interface can be used like any other regular interface. It needs an
90 IP address which can be either statically configured or dynamically (by using
91 DHCP or similar services)::
92
93 NodeA: ip link set up dev bat0
94 NodeA: ip addr add 192.168.0.1/24 dev bat0
95
96 NodeB: ip link set up dev bat0
97 NodeB: ip addr add 192.168.0.2/24 dev bat0
98 NodeB: ping 192.168.0.1
99
100 Note: In order to avoid problems remove all IP addresses previously assigned to
101 interfaces now used by batman advanced, e.g.::
102
103 $ ip addr flush dev eth0
104
105
106 Logging/Debugging
107 =================
108
109 All error messages, warnings and information messages are sent to the kernel
110 log. Depending on your operating system distribution this can be read in one of
111 a number of ways. Try using the commands: ``dmesg``, ``logread``, or looking in
112 the files ``/var/log/kern.log`` or ``/var/log/syslog``. All batman-adv messages
113 are prefixed with "batman-adv:" So to see just these messages try::
114
115 $ dmesg | grep batman-adv
116
117 When investigating problems with your mesh network, it is sometimes necessary to
118 see more detailed debug messages. This must be enabled when compiling the
119 batman-adv module. When building batman-adv as part of the kernel, use "make
120 menuconfig" and enable the option ``B.A.T.M.A.N. debugging``
121 (``CONFIG_BATMAN_ADV_DEBUG=y``).
122
123 Those additional debug messages can be accessed using the perf infrastructure::
124
125 $ trace-cmd stream -e batadv:batadv_dbg
126
127 The additional debug output is by default disabled. It can be enabled during
128 run time::
129
130 $ batctl -m bat0 loglevel routes tt
131
132 will enable debug messages for when routes and translation table entries change.
133
134 Counters for different types of packets entering and leaving the batman-adv
135 module are available through ethtool::
136
137 $ ethtool --statistics bat0
138
139
140 batctl
141 ======
142
143 As batman advanced operates on layer 2, all hosts participating in the virtual
144 switch are completely transparent for all protocols above layer 2. Therefore
145 the common diagnosis tools do not work as expected. To overcome these problems,
146 batctl was created. At the moment the batctl contains ping, traceroute, tcpdump
147 and interfaces to the kernel module settings.
148
149 For more information, please see the manpage (``man batctl``).
150
151 batctl is available on https://www.open-mesh.org/
152
153
154 Contact
155 =======
156
157 Please send us comments, experiences, questions, anything :)
158
159 IRC:
160 #batadv on ircs://irc.hackint.org/
161 Mailing-list:
162 b.a.t.m.a.n@lists.open-mesh.org (optional subscription at
163 https://lists.open-mesh.org/mailman3/postorius/lists/b.a.t.m.a.n.lists.open-mesh.org/)
164
165 You can also contact the Authors:
166
167 * Marek Lindner <marek.lindner@mailbox.org>
168 * Simon Wunderlich <sw@simonwunderlich.de>
169

3. 한국어 전문 번역

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

Layer 2 mesh 개요

1-20

`.. SPDX-License-Identifier: GPL-2.0`

batman-adv

Batman advanced는 IP를 기반으로 동작하지 않는 wireless networking 접근법입니다. UDP packet으로 정보를 교환하고 routing table을 설정하는 batman daemon과 달리, batman-advanced는 ISO/OSI Layer 2에서만 동작하며 Ethernet frame을 route하기보다 bridge합니다.

참여하는 모든 node를 하나의 virtual network switch처럼 보이게 하므로 모든 node가 link-local로 나타납니다. Network 내부 변경은 상위 protocol에 영향을 주지 않으며 IPv4, IPv6, DHCP, IPX를 비롯해 거의 모든 protocol을 그 위에서 실행할 수 있습니다.

Batman advanced는 overhead를 최소화하려고 Linux kernel driver로 구현되었습니다. 다른 network driver에 의존하지 않으며 Ethernet 방식 Layer 2를 제공하는 Wi-Fi, Ethernet LAN, VPN 등에서 사용할 수 있습니다.

.. SPDX-License-Identifier: GPL-2.0

==========
batman-adv
==========

Batman advanced is a new approach to wireless networking which does no longer
operate on the IP basis. Unlike the batman daemon, which exchanges information
using UDP packets and sets routing tables, batman-advanced operates on ISO/OSI
Layer 2 only and uses and routes (or better: bridges) Ethernet Frames. It
emulates a virtual network switch of all nodes participating. Therefore all
nodes appear to be link local, thus all higher operating protocols won't be
affected by any changes within the network. You can run almost any protocol
above batman advanced, prominent examples are: IPv4, IPv6, DHCP, IPX.

Batman advanced was implemented as a Linux kernel driver to reduce the overhead
to a minimum. It does not depend on any (other) network driver, and can be used
on wifi as well as ethernet lan, vpn, etc ... (anything with ethernet-style
layer 2).

Mesh interface 구성

21-79

구성

`insmod batman-adv.ko`로 module을 kernel에 load합니다. Module은 activation을 기다리며, batman-adv가 동작할 interface를 추가해야 합니다.

Iproute2의 `ip`로 `ip link add name bat0 type batadv`를 실행해 mesh interface `bat0`를 만듭니다. 특정 interface를 활성화하려면 `ip link set dev eth0 master bat0`로 `bat0`에 attach하고, 추가할 모든 interface에 반복합니다. 그러면 batman-adv가 해당 interface에서 사용·broadcast를 시작합니다.

비활성화는 `ip link set dev eth0 nomaster`로 `bat0`에서 분리합니다. 같은 작업을 batctl로 하려면 `batctl -m bat0 interface create`, `batctl -m bat0 interface add -M eth0`을 사용합니다. `eth0` 분리와 `bat0` 제거는 각각 `interface del -M eth0`, `interface destroy`입니다.

각 batadv mesh interface, VLAN, hard interface에는 batctl로 수정할 수 있는 추가 설정이 있으며 자세한 정보는 batctl manual에 있습니다.

`batctl -M bat0 orig_interval`은 batman-adv가 broadcast packet을 보내는 주기를 millisecond 단위로 확인하며 예시 값은 1000입니다. `batctl -M bat0 orig_interval 3000`처럼 변경합니다.

이동성이 매우 높은 환경에서는 originator interval을 더 낮춰 topology 변화에 빠르게 반응하게 할 수 있지만 overhead가 증가합니다.

현재 상태는 batadv generic netlink family로 접근할 수 있고, batctl의 debug table subcommand가 사람이 읽기 쉬운 형태로 제공합니다.


Configuration
=============

Load the batman-adv module into your kernel::

  $ insmod batman-adv.ko

The module is now waiting for activation. You must add some interfaces on which
batman-adv can operate. The batman-adv mesh-interface can be created using the
iproute2 tool ``ip``::

  $ ip link add name bat0 type batadv

To activate a given interface simply attach it to the ``bat0`` interface::

  $ ip link set dev eth0 master bat0

Repeat this step for all interfaces you wish to add. Now batman-adv starts
using/broadcasting on this/these interface(s).

To deactivate an interface you have to detach it from the "bat0" interface::

  $ ip link set dev eth0 nomaster

The same can also be done using the batctl interface subcommand::

  batctl -m bat0 interface create
  batctl -m bat0 interface add -M eth0

To detach eth0 and destroy bat0::

  batctl -m bat0 interface del -M eth0
  batctl -m bat0 interface destroy

There are additional settings for each batadv mesh interface, vlan and hardif
which can be modified using batctl. Detailed information about this can be found
in its manual.

For instance, you can check the current originator interval (value
in milliseconds which determines how often batman-adv sends its broadcast
packets)::

  $ batctl -M bat0 orig_interval
  1000

and also change its value::

  $ batctl -M bat0 orig_interval 3000

In very mobile scenarios, you might want to adjust the originator interval to a
lower value. This will make the mesh more responsive to topology changes, but
will also increase the overhead.

Information about the current state can be accessed via the batadv generic
netlink family. batctl provides a human readable version via its debug tables
subcommands.

bat0 사용

80-105

사용

새 mesh를 사용하려면 이후부터 batman advanced가 제공하는 `bat0` interface를 사용합니다. Batman advanced에 추가한 lower interface는 batman이 대신 관리하므로 상위 구성에서 직접 다루지 않습니다. Data를 batman interface에 넘기면 batman이 목적지까지 전달합니다.

`bat0`는 일반 interface처럼 사용하며 static address 또는 DHCP 같은 service로 동적 IP address를 설정합니다. 예시는 NodeA의 `bat0`에 `192.168.0.1/24`, NodeB에 `192.168.0.2/24`를 설정한 뒤 NodeB에서 NodeA를 ping합니다.

문제를 피하려면 이제 batman advanced가 사용하는 lower interface에 이전에 할당한 IP address를 모두 제거해야 합니다. 예: `ip addr flush dev eth0`.

Usage
=====

To make use of your newly created mesh, batman advanced provides a new
interface "bat0" which you should use from this point on. All interfaces added
to batman advanced are not relevant any longer because batman handles them for
you. Basically, one "hands over" the data by using the batman interface and
batman will make sure it reaches its destination.

The "bat0" interface can be used like any other regular interface. It needs an
IP address which can be either statically configured or dynamically (by using
DHCP or similar services)::

  NodeA: ip link set up dev bat0
  NodeA: ip addr add 192.168.0.1/24 dev bat0

  NodeB: ip link set up dev bat0
  NodeB: ip addr add 192.168.0.2/24 dev bat0
  NodeB: ping 192.168.0.1

Note: In order to avoid problems remove all IP addresses previously assigned to
interfaces now used by batman advanced, e.g.::

  $ ip addr flush dev eth0

Logging·debugging

106-139

Logging·Debugging

모든 error, warning, information message는 kernel log로 전송됩니다. Distribution에 따라 `dmesg`, `logread`, `/var/log/kern.log`, `/var/log/syslog`에서 읽습니다. Batman-adv message에는 `batman-adv:` prefix가 붙으므로 `dmesg | grep batman-adv`로 걸러낼 수 있습니다.

Mesh 문제를 조사하며 더 자세한 debug message가 필요하면 module compile 시 이를 켜야 합니다. Kernel 일부로 build할 때 `make menuconfig`에서 `B.A.T.M.A.N. debugging` 즉 `CONFIG_BATMAN_ADV_DEBUG=y`를 활성화합니다.

추가 debug message는 perf infrastructure를 통해 `trace-cmd stream -e batadv:batadv_dbg`로 읽습니다.

추가 debug 출력은 기본적으로 꺼져 있습니다. Runtime에 `batctl -m bat0 loglevel routes tt`를 실행하면 route와 translation table entry가 바뀔 때의 debug message를 활성화합니다.

Batman-adv module로 들어오고 나가는 packet 종류별 counter는 `ethtool --statistics bat0`에서 확인할 수 있습니다.

Logging/Debugging
=================

All error messages, warnings and information messages are sent to the kernel
log. Depending on your operating system distribution this can be read in one of
a number of ways. Try using the commands: ``dmesg``, ``logread``, or looking in
the files ``/var/log/kern.log`` or ``/var/log/syslog``. All batman-adv messages
are prefixed with "batman-adv:" So to see just these messages try::

  $ dmesg | grep batman-adv

When investigating problems with your mesh network, it is sometimes necessary to
see more detailed debug messages. This must be enabled when compiling the
batman-adv module. When building batman-adv as part of the kernel, use "make
menuconfig" and enable the option ``B.A.T.M.A.N. debugging``
(``CONFIG_BATMAN_ADV_DEBUG=y``).

Those additional debug messages can be accessed using the perf infrastructure::

  $ trace-cmd stream -e batadv:batadv_dbg

The additional debug output is by default disabled. It can be enabled during
run time::

  $ batctl -m bat0 loglevel routes tt

will enable debug messages for when routes and translation table entries change.

Counters for different types of packets entering and leaving the batman-adv
module are available through ethtool::

  $ ethtool --statistics bat0

batctl과 연락처

140-168

batctl

Batman advanced는 Layer 2에서 동작하므로 virtual switch에 참여한 모든 host가 Layer 2 위 protocol에는 완전히 투명합니다. 이 때문에 일반 진단 tool이 기대대로 작동하지 않을 수 있어 batctl이 만들어졌습니다.

Batctl은 ping, traceroute, tcpdump와 kernel module 설정 interface를 제공합니다. 자세한 정보는 `man batctl`을 보십시오. 문서에 기록된 배포 주소는 `https://www.open-mesh.org/`입니다.

연락처

의견, 사용 경험, 질문 등 무엇이든 보내 달라고 요청합니다. IRC는 `#batadv` on `ircs://irc.hackint.org/`, mailing list는 `b.a.t.m.a.n@lists.open-mesh.org`이며 선택적 구독 page 주소도 원문에 보존되어 있습니다.

작성자 연락처는 Marek Lindner `<marek.lindner@mailbox.org>`와 Simon Wunderlich `<sw@simonwunderlich.de>`입니다.

batctl
======

As batman advanced operates on layer 2, all hosts participating in the virtual
switch are completely transparent for all protocols above layer 2. Therefore
the common diagnosis tools do not work as expected. To overcome these problems,
batctl was created. At the moment the batctl contains ping, traceroute, tcpdump
and interfaces to the kernel module settings.

For more information, please see the manpage (``man batctl``).

batctl is available on https://www.open-mesh.org/


Contact
=======

Please send us comments, experiences, questions, anything :)

IRC:
  #batadv on ircs://irc.hackint.org/
Mailing-list:
  b.a.t.m.a.n@lists.open-mesh.org (optional subscription at
  https://lists.open-mesh.org/mailman3/postorius/lists/b.a.t.m.a.n.lists.open-mesh.org/)

You can also contact the Authors:

* Marek Lindner <marek.lindner@mailbox.org>
* Simon Wunderlich <sw@simonwunderlich.de>