← Documents Documentation/networking/generic-hdlc.rst GitHub 원문 ↗

Linux 6.18.37 · Networking

Generic HDLC layer

일반 HDLC 계층이 지원하는 WAN 프로토콜과 sethdlc를 이용한 물리 인터페이스, 클록, Frame Relay PVC 설정을 설명합니다.

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

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

1. 요약·해설

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

요약·해설

generic-hdlc.rst:1-170

Generic HDLC는 하드웨어별 드라이버 위에서 raw HDLC, Cisco HDLC, PPP, X.25, Frame Relay를 공통 설정 방식으로 제공합니다.

설정 축
물리 포트V.35, RS-232, X.21, T1, E1
클록외부, 내부, RX 파생
프로토콜raw HDLC, Cisco, PPP, X.25, Frame Relay
Frame RelayLMI, DTE/DCE, PVC/DLCI

`sethdlc`가 담당하는 설정 범위입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ==================
4 Generic HDLC layer
5 ==================
6
7 Krzysztof Halasa <khc@pm.waw.pl>
8
9
10 Generic HDLC layer currently supports:
11
12 1. Frame Relay (ANSI, CCITT, Cisco and no LMI)
13
14 - Normal (routed) and Ethernet-bridged (Ethernet device emulation)
15 interfaces can share a single PVC.
16 - ARP support (no InARP support in the kernel - there is an
17 experimental InARP user-space daemon available on:
18 http://www.kernel.org/pub/linux/utils/net/hdlc/).
19
20 2. raw HDLC - either IP (IPv4) interface or Ethernet device emulation
21 3. Cisco HDLC
22 4. PPP
23 5. X.25 (uses X.25 routines).
24
25 Generic HDLC is a protocol driver only - it needs a low-level driver
26 for your particular hardware.
27
28 Ethernet device emulation (using HDLC or Frame-Relay PVC) is compatible
29 with IEEE 802.1Q (VLANs) and 802.1D (Ethernet bridging).
30
31
32 Make sure the hdlc.o and the hardware driver are loaded. It should
33 create a number of "hdlc" (hdlc0 etc) network devices, one for each
34 WAN port. You'll need the "sethdlc" utility, get it from:
35
36 http://www.kernel.org/pub/linux/utils/net/hdlc/
37
38 Compile sethdlc.c utility::
39
40 gcc -O2 -Wall -o sethdlc sethdlc.c
41
42 Make sure you're using a correct version of sethdlc for your kernel.
43
44 Use sethdlc to set physical interface, clock rate, HDLC mode used,
45 and add any required PVCs if using Frame Relay.
46 Usually you want something like::
47
48 sethdlc hdlc0 clock int rate 128000
49 sethdlc hdlc0 cisco interval 10 timeout 25
50
51 or::
52
53 sethdlc hdlc0 rs232 clock ext
54 sethdlc hdlc0 fr lmi ansi
55 sethdlc hdlc0 create 99
56 ifconfig hdlc0 up
57 ifconfig pvc0 localIP pointopoint remoteIP
58
59 In Frame Relay mode, ifconfig master hdlc device up (without assigning
60 any IP address to it) before using pvc devices.
61
62
63 Setting interface:
64
65 * v35 | rs232 | x21 | t1 | e1
66 - sets physical interface for a given port
67 if the card has software-selectable interfaces
68 loopback
69 - activate hardware loopback (for testing only)
70 * clock ext
71 - both RX clock and TX clock external
72 * clock int
73 - both RX clock and TX clock internal
74 * clock txint
75 - RX clock external, TX clock internal
76 * clock txfromrx
77 - RX clock external, TX clock derived from RX clock
78 * rate
79 - sets clock rate in bps (for "int" or "txint" clock only)
80
81
82 Setting protocol:
83
84 * hdlc - sets raw HDLC (IP-only) mode
85
86 nrz / nrzi / fm-mark / fm-space / manchester - sets transmission code
87
88 no-parity / crc16 / crc16-pr0 (CRC16 with preset zeros) / crc32-itu
89
90 crc16-itu (CRC16 with ITU-T polynomial) / crc16-itu-pr0 - sets parity
91
92 * hdlc-eth - Ethernet device emulation using HDLC. Parity and encoding
93 as above.
94
95 * cisco - sets Cisco HDLC mode (IP, IPv6 and IPX supported)
96
97 interval - time in seconds between keepalive packets
98
99 timeout - time in seconds after last received keepalive packet before
100 we assume the link is down
101
102 * ppp - sets synchronous PPP mode
103
104 * x25 - sets X.25 mode
105
106 * fr - Frame Relay mode
107
108 lmi ansi / ccitt / cisco / none - LMI (link management) type
109
110 dce - Frame Relay DCE (network) side LMI instead of default DTE (user).
111
112 It has nothing to do with clocks!
113
114 - t391 - link integrity verification polling timer (in seconds) - user
115 - t392 - polling verification timer (in seconds) - network
116 - n391 - full status polling counter - user
117 - n392 - error threshold - both user and network
118 - n393 - monitored events count - both user and network
119
120 Frame-Relay only:
121
122 * create n | delete n - adds / deletes PVC interface with DLCI #n.
123 Newly created interface will be named pvc0, pvc1 etc.
124
125 * create ether n | delete ether n - adds a device for Ethernet-bridged
126 frames. The device will be named pvceth0, pvceth1 etc.
127
128
129
130
131 Board-specific issues
132 ---------------------
133
134 n2.o and c101.o need parameters to work::
135
136 insmod n2 hw=io,irq,ram,ports[:io,irq,...]
137
138 example::
139
140 insmod n2 hw=0x300,10,0xD0000,01
141
142 or::
143
144 insmod c101 hw=irq,ram[:irq,...]
145
146 example::
147
148 insmod c101 hw=9,0xdc000
149
150 If built into the kernel, these drivers need kernel (command line) parameters::
151
152 n2.hw=io,irq,ram,ports:...
153
154 or::
155
156 c101.hw=irq,ram:...
157
158
159
160 If you have a problem with N2, C101 or PLX200SYN card, you can issue the
161 "private" command to see port's packet descriptor rings (in kernel logs)::
162
163 sethdlc hdlc0 private
164
165 The hardware driver has to be build with #define DEBUG_RINGS.
166 Attaching this info to bug reports would be helpful. Anyway, let me know
167 if you have problems using this.
168
169 For patches and other info look at:
170 <http://www.kernel.org/pub/linux/utils/net/hdlc/>.
171

3. 한국어 전문 번역

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

지원 프로토콜

1-31

일반 HDLC 계층은 Frame Relay, raw HDLC, Cisco HDLC, PPP, X.25를 지원합니다. Frame Relay는 ANSI, CCITT, Cisco LMI와 LMI 없음 모드를 제공하며, 하나의 PVC에서 일반 routed 인터페이스와 Ethernet bridge용 에뮬레이션 인터페이스를 함께 사용할 수 있습니다.

ARP는 지원하지만 커널 내부 InARP는 지원하지 않습니다. 실험적인 사용자 공간 InARP 데몬이 별도로 제공됩니다. raw HDLC는 IPv4 전용 인터페이스 또는 Ethernet 장치 에뮬레이션으로 사용할 수 있고, X.25 모드는 기존 X.25 루틴을 이용합니다.

일반 HDLC는 프로토콜 드라이버일 뿐이므로 실제 하드웨어에 맞는 저수준 드라이버가 필요합니다. HDLC나 Frame Relay PVC를 이용한 Ethernet 장치 에뮬레이션은 IEEE 802.1Q VLAN과 IEEE 802.1D 브리징과 호환됩니다.

.. SPDX-License-Identifier: GPL-2.0

==================
Generic HDLC layer
==================

Krzysztof Halasa <khc@pm.waw.pl>


Generic HDLC layer currently supports:

1. Frame Relay (ANSI, CCITT, Cisco and no LMI)

   - Normal (routed) and Ethernet-bridged (Ethernet device emulation)
     interfaces can share a single PVC.
   - ARP support (no InARP support in the kernel - there is an
     experimental InARP user-space daemon available on:
     http://www.kernel.org/pub/linux/utils/net/hdlc/).

2. raw HDLC - either IP (IPv4) interface or Ethernet device emulation
3. Cisco HDLC
4. PPP
5. X.25 (uses X.25 routines).

Generic HDLC is a protocol driver only - it needs a low-level driver
for your particular hardware.

Ethernet device emulation (using HDLC or Frame-Relay PVC) is compatible
with IEEE 802.1Q (VLANs) and 802.1D (Ethernet bridging).

초기 설정

32-62

`hdlc.o`와 하드웨어 드라이버를 적재하면 WAN 포트마다 `hdlc0` 같은 네트워크 장치가 생성되어야 합니다. 설정에는 커널 버전과 맞는 `sethdlc` 유틸리티가 필요하며, 제공된 `sethdlc.c`는 `gcc -O2 -Wall -o sethdlc sethdlc.c`로 빌드합니다.

`sethdlc`로 물리 인터페이스, 클록 속도, HDLC 모드를 설정하고 Frame Relay라면 필요한 PVC를 만듭니다. 첫 예제는 내부 128000bps 클록과 Cisco keepalive 간격 10초, timeout 25초를 설정합니다. 둘째 예제는 RS-232 외부 클록과 ANSI LMI Frame Relay를 사용하고 DLCI 99 PVC를 만든 뒤 장치와 point-to-point IP를 올립니다.

Frame Relay 모드에서는 PVC 장치를 사용하기 전에 master `hdlc` 장치를 IP 주소 없이 `up` 상태로 만들어야 합니다.

Make sure the hdlc.o and the hardware driver are loaded. It should
create a number of "hdlc" (hdlc0 etc) network devices, one for each
WAN port. You'll need the "sethdlc" utility, get it from:

        http://www.kernel.org/pub/linux/utils/net/hdlc/

Compile sethdlc.c utility::

        gcc -O2 -Wall -o sethdlc sethdlc.c

Make sure you're using a correct version of sethdlc for your kernel.

Use sethdlc to set physical interface, clock rate, HDLC mode used,
and add any required PVCs if using Frame Relay.
Usually you want something like::

        sethdlc hdlc0 clock int rate 128000
        sethdlc hdlc0 cisco interval 10 timeout 25

or::

        sethdlc hdlc0 rs232 clock ext
        sethdlc hdlc0 fr lmi ansi
        sethdlc hdlc0 create 99
        ifconfig hdlc0 up
        ifconfig pvc0 localIP pointopoint remoteIP

In Frame Relay mode, ifconfig master hdlc device up (without assigning
any IP address to it) before using pvc devices.

물리 인터페이스와 클록

63-81

`v35`, `rs232`, `x21`, `t1`, `e1`은 카드가 소프트웨어 선택을 지원할 때 포트의 물리 인터페이스를 정합니다. `loopback`은 시험용 하드웨어 루프백을 켭니다.

`clock ext`는 RX와 TX 모두 외부 클록, `clock int`는 둘 다 내부 클록입니다. `clock txint`는 RX 외부/TX 내부, `clock txfromrx`는 RX 외부/TX가 RX에서 파생되는 구성입니다. `rate`는 `int` 또는 `txint`일 때만 bps 단위 클록 속도를 지정합니다.

HDLC 클록 모드
모드RXTX
ext외부외부
int내부내부
txint외부내부
txfromrx외부RX에서 파생

RX와 TX 클록 출처를 정리했습니다.

Setting interface:

* v35 | rs232 | x21 | t1 | e1
    - sets physical interface for a given port
      if the card has software-selectable interfaces
  loopback
    - activate hardware loopback (for testing only)
* clock ext
    - both RX clock and TX clock external
* clock int
    - both RX clock and TX clock internal
* clock txint
    - RX clock external, TX clock internal
* clock txfromrx
    - RX clock external, TX clock derived from RX clock
* rate
    - sets clock rate in bps (for "int" or "txint" clock only)

프로토콜 설정

82-119

`hdlc`는 IP 전용 raw HDLC 모드를 선택합니다. 전송 코드는 `nrz`, `nrzi`, `fm-mark`, `fm-space`, `manchester` 중에서 정하고, 오류 검사는 `no-parity`, `crc16`, preset zero CRC16, `crc32-itu`, ITU-T 다항식 CRC16과 그 preset zero 변형 중에서 고릅니다. `hdlc-eth`는 같은 인코딩과 CRC 설정을 쓰는 Ethernet 장치 에뮬레이션입니다.

`cisco`는 IP, IPv6, IPX를 지원하는 Cisco HDLC 모드입니다. `interval`은 keepalive 전송 간격이고 `timeout`은 마지막 keepalive 수신 후 링크가 내려갔다고 판단할 시간입니다. `ppp`는 동기식 PPP, `x25`는 X.25, `fr`은 Frame Relay 모드입니다.

Frame Relay의 `lmi ansi|ccitt|cisco|none`은 링크 관리 유형을 정합니다. `dce`는 기본 DTE 사용자 측 대신 DCE 네트워크 측 LMI로 동작하게 하며 클록 방향과는 무관합니다. `t391`은 사용자 측 링크 무결성 polling timer, `t392`는 네트워크 측 polling 검증 timer입니다. `n391`은 사용자 측 전체 상태 polling 횟수, `n392`는 양측 오류 임계값, `n393`은 양측이 감시할 이벤트 수입니다.

Setting protocol:

* hdlc - sets raw HDLC (IP-only) mode

  nrz / nrzi / fm-mark / fm-space / manchester - sets transmission code

  no-parity / crc16 / crc16-pr0 (CRC16 with preset zeros) / crc32-itu

  crc16-itu (CRC16 with ITU-T polynomial) / crc16-itu-pr0 - sets parity

* hdlc-eth - Ethernet device emulation using HDLC. Parity and encoding
  as above.

* cisco - sets Cisco HDLC mode (IP, IPv6 and IPX supported)

  interval - time in seconds between keepalive packets

  timeout - time in seconds after last received keepalive packet before
            we assume the link is down

* ppp - sets synchronous PPP mode

* x25 - sets X.25 mode

* fr - Frame Relay mode

  lmi ansi / ccitt / cisco / none - LMI (link management) type

  dce - Frame Relay DCE (network) side LMI instead of default DTE (user).

  It has nothing to do with clocks!

  - t391 - link integrity verification polling timer (in seconds) - user
  - t392 - polling verification timer (in seconds) - network
  - n391 - full status polling counter - user
  - n392 - error threshold - both user and network
  - n393 - monitored events count - both user and network

Frame Relay PVC

120-130

Frame Relay 전용 `create n`과 `delete n`은 DLCI 번호 `n`의 PVC 인터페이스를 추가하거나 삭제합니다. 새 routed 인터페이스 이름은 `pvc0`, `pvc1`처럼 정해집니다. `create ether n`과 `delete ether n`은 Ethernet bridge 프레임용 장치를 관리하며 이름은 `pvceth0`, `pvceth1` 형식입니다.

Frame-Relay only:

* create n | delete n - adds / deletes PVC interface with DLCI #n.
  Newly created interface will be named pvc0, pvc1 etc.

* create ether n | delete ether n - adds a device for Ethernet-bridged
  frames. The device will be named pvceth0, pvceth1 etc.



보드별 설정과 진단

131-170

`n2.o`는 `hw=io,irq,ram,ports[:...]`, `c101.o`는 `hw=irq,ram[:...]` 모듈 매개변수가 필요합니다. 커널에 내장한 경우에는 각각 `n2.hw=...`와 `c101.hw=...` 커널 명령행 매개변수를 사용합니다. 원문의 예제 주소, IRQ, RAM 영역과 포트 비트맵은 아래에 그대로 보존됩니다.

N2, C101, PLX200SYN 카드 문제는 `sethdlc hdlc0 private`로 포트의 패킷 descriptor ring을 커널 로그에 출력해 조사할 수 있습니다. 하드웨어 드라이버는 `#define DEBUG_RINGS`를 켜서 빌드해야 하며, 이 정보를 버그 보고서에 첨부하면 진단에 도움이 됩니다.

Board-specific issues
---------------------

n2.o and c101.o need parameters to work::

        insmod n2 hw=io,irq,ram,ports[:io,irq,...]

example::

        insmod n2 hw=0x300,10,0xD0000,01

or::

        insmod c101 hw=irq,ram[:irq,...]

example::

        insmod c101 hw=9,0xdc000

If built into the kernel, these drivers need kernel (command line) parameters::

        n2.hw=io,irq,ram,ports:...

or::

        c101.hw=irq,ram:...



If you have a problem with N2, C101 or PLX200SYN card, you can issue the
"private" command to see port's packet descriptor rings (in kernel logs)::

        sethdlc hdlc0 private

The hardware driver has to be build with #define DEBUG_RINGS.
Attaching this info to bug reports would be helpful. Anyway, let me know
if you have problems using this.

For patches and other info look at:
<http://www.kernel.org/pub/linux/utils/net/hdlc/>.