← Documents Documentation/networking/diagnostic/twisted_pair_layer1_diagnostics.rst GitHub 원문 ↗

Linux 6.18.37 · Networking

Diagnostic Concept for Investigating Twisted Pair Ethernet Variants at OSI Layer 1

SPE·MPE의 인터페이스, PHY, PoDL·PoE, 케이블, 자동 협상과 링크 불안정을 단계별로 진단합니다.

Source pathDocumentation/networking/diagnostic/twisted_pair_layer1_diagnostics.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

twisted_pair_layer1_diagnostics.rst:1-784

이 안내서는 관리 상태에서 시작해 PHY 정보, PSE 전력, TDR 케이블 시험, 상대편 자동 협상·master/slave 역할, 커널 로그와 error counter 순으로 원인을 좁힙니다. 링크는 있지만 데이터가 없으면 계층 2 이상으로 넘기고, 링크가 없거나 불안정할 때만 계층 1 절차를 계속하는 것이 핵심입니다. 케이블 시험은 상대편 전원과 PHY 특성에 따라 오탐이 생길 수 있어 물리 검사와 드라이버별 맥락을 함께 사용해야 합니다.

꼬임쌍 계층 1 진단 흐름
ip link 관리 상태ethtool PHY·링크PoDL·PoEcable-test상대편 협상로그·counter
링크 안정·데이터 없음계층 2 이상 진단

증상과 도구 결과에 따라 물리 링크 문제를 단계적으로 격리합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 Diagnostic Concept for Investigating Twisted Pair Ethernet Variants at OSI Layer 1
4 ==================================================================================
5
6 Introduction
7 ------------
8
9 This documentation is designed for two primary audiences:
10
11 1. **Users and System Administrators**: For those dealing with real-world
12 Ethernet issues, this guide provides a practical, step-by-step
13 troubleshooting flow to help identify and resolve common problems in Twisted
14 Pair Ethernet at OSI Layer 1. If you're facing unstable links, speed drops,
15 or mysterious network issues, jump right into the step-by-step guide and
16 follow it through to find your solution.
17
18 2. **Kernel Developers**: For developers working with network drivers and PHY
19 support, this documentation outlines the diagnostic process and highlights
20 areas where the Linux kernel’s diagnostic interfaces could be extended or
21 improved. By understanding the diagnostic flow, developers can better
22 prioritize future enhancements.
23
24 Step-by-Step Diagnostic Guide from Linux (General Ethernet)
25 -----------------------------------------------------------
26
27 This diagnostic guide covers common Ethernet troubleshooting scenarios,
28 focusing on **link stability and detection** across different Ethernet
29 environments, including **Single-Pair Ethernet (SPE)** and **Multi-Pair
30 Ethernet (MPE)**, as well as power delivery technologies like **PoDL** (Power
31 over Data Line) and **PoE** (Clause 33 PSE).
32
33 The guide is designed to help users diagnose physical layer (Layer 1) issues on
34 systems running **Linux kernel version 6.11 or newer**, utilizing **ethtool
35 version 6.10 or later** and **iproute2 version 6.4.0 or later**.
36
37 In this guide, we assume that users may have **limited or no access to the link
38 partner** and will focus on diagnosing issues locally.
39
40 Diagnostic Scenarios
41 ~~~~~~~~~~~~~~~~~~~~
42
43 - **Link is up and stable, but no data transfer**: If the link is stable but
44 there are issues with data transmission, refer to the **OSI Layer 2
45 Troubleshooting Guide**.
46
47 - **Link is unstable**: Link resets, speed drops, or other fluctuations
48 indicate potential issues at the hardware or physical layer.
49
50 - **No link detected**: The interface is up, but no link is established.
51
52 Verify Interface Status
53 ~~~~~~~~~~~~~~~~~~~~~~~
54
55 Begin by verifying the status of the Ethernet interface to check if it is
56 administratively up. Unlike `ethtool`, which provides information on the link
57 and PHY status, it does not show the **administrative state** of the interface.
58 To check this, you should use the `ip` command, which describes the interface
59 state within the angle brackets `"<>"` in its output.
60
61 For example, in the output `<NO-CARRIER,BROADCAST,MULTICAST,UP>`, the important
62 keywords are:
63
64 - **UP**: The interface is in the administrative "UP" state.
65 - **NO-CARRIER**: The interface is administratively up, but no physical link is
66 detected.
67
68 If the output shows `<BROADCAST,MULTICAST>`, this indicates the interface is in
69 the administrative "DOWN" state.
70
71 - **Command:** `ip link show dev <interface>`
72
73 - **Expected Output:**
74
75 .. code-block:: bash
76
77 4: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 ...
78 link/ether 88:14:2b:00:96:f2 brd ff:ff:ff:ff:ff:ff
79
80 - **Interpreting the Output:**
81
82 - **Administrative UP State**:
83
84 - If the output contains **"UP"**, the interface is administratively up,
85 and the system is trying to establish a physical link.
86
87 - If you also see **"NO-CARRIER"**, it means the physical link has not been
88 detected, indicating potential Layer 1 issues like a cable fault,
89 misconfiguration, or no connection at the link partner. In this case,
90 proceed to the **Inspect Link Status and PHY Configuration** section.
91
92 - **Administrative DOWN State**:
93
94 - If the output lacks **"UP"** and shows only states like
95 **"<BROADCAST,MULTICAST>"**, it means the interface is administratively
96 down. In this case, bring the interface up using the following command:
97
98 .. code-block:: bash
99
100 ip link set dev <interface> up
101
102 - **Next Steps**:
103
104 - If the interface is **administratively up** but shows **NO-CARRIER**,
105 proceed to the **Inspect Link Status and PHY Configuration** section to
106 troubleshoot potential physical layer issues.
107
108 - If the interface was **administratively down** and you have brought it up,
109 ensure to **repeat this verification step** to confirm the new state of the
110 interface before proceeding
111
112 - **If the interface is up and the link is detected**:
113
114 - If the output shows **"UP"** and there is **no `NO-CARRIER`**, the
115 interface is administratively up, and the physical link has been
116 successfully established. If everything is working as expected, the Layer
117 1 diagnostics are complete, and no further action is needed.
118
119 - If the interface is up and the link is detected but **no data is being
120 transferred**, the issue is likely beyond Layer 1, and you should proceed
121 with diagnosing the higher layers of the OSI model. This may involve
122 checking Layer 2 configurations (such as VLANs or MAC address issues),
123 Layer 3 settings (like IP addresses, routing, or ARP), or Layer 4 and
124 above (firewalls, services, etc.).
125
126 - If the **link is unstable** or **frequently resetting or dropping**, this
127 may indicate a physical layer issue such as a faulty cable, interference,
128 or power delivery problems. In this case, proceed with the next step in
129 this guide.
130
131 Inspect Link Status and PHY Configuration
132 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133
134 Use `ethtool -I` to check the link status, PHY configuration, supported link
135 modes, and additional statistics such as the **Link Down Events** counter. This
136 step is essential for diagnosing Layer 1 problems such as speed mismatches,
137 duplex issues, and link instability.
138
139 For both **Single-Pair Ethernet (SPE)** and **Multi-Pair Ethernet (MPE)**
140 devices, you will use this step to gather key details about the link. **SPE**
141 links generally support a single speed and mode without autonegotiation (with
142 the exception of **10BaseT1L**), while **MPE** devices typically support
143 multiple link modes and autonegotiation.
144
145 - **Command:** `ethtool -I <interface>`
146
147 - **Example Output for SPE Interface (Non-autonegotiation)**:
148
149 .. code-block:: bash
150
151 Settings for spe4:
152 Supported ports: [ TP ]
153 Supported link modes: 100baseT1/Full
154 Supported pause frame use: No
155 Supports auto-negotiation: No
156 Supported FEC modes: Not reported
157 Advertised link modes: Not applicable
158 Advertised pause frame use: No
159 Advertised auto-negotiation: No
160 Advertised FEC modes: Not reported
161 Speed: 100Mb/s
162 Duplex: Full
163 Auto-negotiation: off
164 master-slave cfg: forced slave
165 master-slave status: slave
166 Port: Twisted Pair
167 PHYAD: 6
168 Transceiver: external
169 MDI-X: Unknown
170 Supports Wake-on: d
171 Wake-on: d
172 Link detected: yes
173 SQI: 7/7
174 Link Down Events: 2
175
176 - **Example Output for MPE Interface (Autonegotiation)**:
177
178 .. code-block:: bash
179
180 Settings for eth1:
181 Supported ports: [ TP MII ]
182 Supported link modes: 10baseT/Half 10baseT/Full
183 100baseT/Half 100baseT/Full
184 Supported pause frame use: Symmetric Receive-only
185 Supports auto-negotiation: Yes
186 Supported FEC modes: Not reported
187 Advertised link modes: 10baseT/Half 10baseT/Full
188 100baseT/Half 100baseT/Full
189 Advertised pause frame use: Symmetric Receive-only
190 Advertised auto-negotiation: Yes
191 Advertised FEC modes: Not reported
192 Link partner advertised link modes: 10baseT/Half 10baseT/Full
193 100baseT/Half 100baseT/Full
194 Link partner advertised pause frame use: Symmetric Receive-only
195 Link partner advertised auto-negotiation: Yes
196 Link partner advertised FEC modes: Not reported
197 Speed: 100Mb/s
198 Duplex: Full
199 Auto-negotiation: on
200 Port: Twisted Pair
201 PHYAD: 10
202 Transceiver: internal
203 MDI-X: Unknown
204 Supports Wake-on: pg
205 Wake-on: p
206 Link detected: yes
207 Link Down Events: 1
208
209 - **Next Steps**:
210
211 - Record the output provided by `ethtool`, particularly noting the
212 **master-slave status**, **speed**, **duplex**, and other relevant fields.
213 This information will be useful for further analysis or troubleshooting.
214 Once the **ethtool** output has been collected and stored, move on to the
215 next diagnostic step.
216
217 Check Power Delivery (PoDL or PoE)
218 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
219
220 If it is known that **PoDL** or **PoE** is **not implemented** on the system,
221 or the **PSE** (Power Sourcing Equipment) is managed by proprietary user-space
222 software or external tools, you can skip this step. In such cases, verify power
223 delivery through alternative methods, such as checking hardware indicators
224 (LEDs), using multimeters, or consulting vendor-specific software for
225 monitoring power status.
226
227 If **PoDL** or **PoE** is implemented and managed directly by Linux, follow
228 these steps to ensure power is being delivered correctly:
229
230 - **Command:** `ethtool --show-pse <interface>`
231
232 - **Expected Output Examples**:
233
234 1. **PSE Not Supported**:
235
236 If no PSE is attached or the interface does not support PSE, the following
237 output is expected:
238
239 .. code-block:: bash
240
241 netlink error: No PSE is attached
242 netlink error: Operation not supported
243
244 2. **PoDL (Single-Pair Ethernet)**:
245
246 When PoDL is implemented, you might see the following attributes:
247
248 .. code-block:: bash
249
250 PSE attributes for eth1:
251 PoDL PSE Admin State: enabled
252 PoDL PSE Power Detection Status: delivering power
253
254 3. **PoE (Clause 33 PSE)**:
255
256 For standard PoE, the output may look like this:
257
258 .. code-block:: bash
259
260 PSE attributes for eth1:
261 Clause 33 PSE Admin State: enabled
262 Clause 33 PSE Power Detection Status: delivering power
263 Clause 33 PSE Available Power Limit: 18000
264
265 - **Adjust Power Limit (if needed)**:
266
267 - Sometimes, the available power limit may not be sufficient for the link
268 partner. You can increase the power limit as needed.
269
270 - **Command:** `ethtool --set-pse <interface> c33-pse-avail-pw-limit <limit>`
271
272 Example:
273
274 .. code-block:: bash
275
276 ethtool --set-pse eth1 c33-pse-avail-pw-limit 18000
277 ethtool --show-pse eth1
278
279 **Expected Output** after adjusting the power limit:
280
281 .. code-block:: bash
282
283 Clause 33 PSE Available Power Limit: 18000
284
285
286 - **Next Steps**:
287
288 - **PoE or PoDL Not Used**: If **PoE** or **PoDL** is not implemented or used
289 on the system, proceed to the next diagnostic step, as power delivery is
290 not relevant for this setup.
291
292 - **PoE or PoDL Controlled Externally**: If **PoE** or **PoDL** is used but
293 is not managed by the Linux kernel's **PSE-PD** framework (i.e., it is
294 controlled by proprietary user-space software or external tools), this part
295 is out of scope for this documentation. Please consult vendor-specific
296 documentation or external tools for monitoring and managing power delivery.
297
298 - **PSE Admin State Disabled**:
299
300 - If the `PSE Admin State:` is **disabled**, enable it by running one of
301 the following commands:
302
303 .. code-block:: bash
304
305 ethtool --set-pse <devname> podl-pse-admin-control enable
306
307 or, for Clause 33 PSE (PoE):
308
309 ethtool --set-pse <devname> c33-pse-admin-control enable
310
311 - After enabling the PSE Admin State, return to the start of the **Check
312 Power Delivery (PoDL or PoE)** step to recheck the power delivery status.
313
314 - **Power Not Delivered**: If the `Power Detection Status` shows something
315 other than "delivering power" (e.g., `over current`), troubleshoot the
316 **PSE**. Check for potential issues such as a short circuit in the cable,
317 insufficient power delivery, or a fault in the PSE itself.
318
319 - **Power Delivered but No Link**: If power is being delivered but no link is
320 established, proceed with further diagnostics by performing **Cable
321 Diagnostics** or reviewing the **Inspect Link Status and PHY
322 Configuration** steps to identify any underlying issues with the physical
323 link or settings.
324
325 Cable Diagnostics
326 ~~~~~~~~~~~~~~~~~
327
328 Use `ethtool` to test for physical layer issues such as cable faults. The test
329 results can vary depending on the cable's condition, the technology in use, and
330 the state of the link partner. The results from the cable test will help in
331 diagnosing issues like open circuits, shorts, impedance mismatches, and
332 noise-related problems.
333
334 - **Command:** `ethtool --cable-test <interface>`
335
336 The following are the typical outputs for **Single-Pair Ethernet (SPE)** and
337 **Multi-Pair Ethernet (MPE)**:
338
339 - **For Single-Pair Ethernet (SPE)**:
340 - **Expected Output (SPE)**:
341
342 .. code-block:: bash
343
344 Cable test completed for device eth1.
345 Pair A, fault length: 25.00m
346 Pair A code Open Circuit
347
348 This indicates an open circuit or cable fault at the reported distance, but
349 results can be influenced by the link partner's state. Refer to the
350 **"Troubleshooting Based on Cable Test Results"** section for further
351 interpretation of these results.
352
353 - **For Multi-Pair Ethernet (MPE)**:
354 - **Expected Output (MPE)**:
355
356 .. code-block:: bash
357
358 Cable test completed for device eth0.
359 Pair A code OK
360 Pair B code OK
361 Pair C code Open Circuit
362
363 Here, Pair C is reported as having an open circuit, while Pairs A and B are
364 functioning correctly. However, if autonegotiation is in use on Pairs A and
365 B, the cable test may be disrupted. Refer to the **"Troubleshooting Based on
366 Cable Test Results"** section for a detailed explanation of these issues and
367 how to resolve them.
368
369 For detailed descriptions of the different possible cable test results, please
370 refer to the **"Troubleshooting Based on Cable Test Results"** section.
371
372 Troubleshooting Based on Cable Test Results
373 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
374
375 After running the cable test, the results can help identify specific issues in
376 the physical connection. However, it is important to note that **cable testing
377 results heavily depend on the capabilities and characteristics of both the
378 local hardware and the link partner**. The accuracy and reliability of the
379 results can vary significantly between different hardware implementations.
380
381 In some cases, this can introduce **blind spots** in the current cable testing
382 implementation, where certain results may not accurately reflect the actual
383 physical state of the cable. For example:
384
385 - An **Open Circuit** result might not only indicate a damaged or disconnected
386 cable but also occur if the cable is properly attached to a powered-down link
387 partner.
388
389 - Some PHYs may report a **Short within Pair** if the link partner is in
390 **forced slave mode**, even though there is no actual short in the cable.
391
392 To help users interpret the results more effectively, it could be beneficial to
393 extend the **kernel UAPI** (User API) to provide additional context or
394 **possible variants** of issues based on the hardware’s characteristics. Since
395 these quirks are often hardware-specific, the **kernel driver** would be an
396 ideal source of such information. By providing flags or hints related to
397 potential false positives for each test result, users would have a better
398 understanding of what to verify and where to investigate further.
399
400 Until such improvements are made, users should be aware of these limitations
401 and manually verify cable issues as needed. Physical inspections may help
402 resolve uncertainties related to false positive results.
403
404 The results can be one of the following:
405
406 - **OK**:
407
408 - The cable is functioning correctly, and no issues were detected.
409
410 - **Next Steps**: If you are still experiencing issues, it might be related
411 to higher-layer problems, such as duplex mismatches or speed negotiation,
412 which are not physical-layer issues.
413
414 - **Special Case for `BaseT1` (1000/100/10BaseT1)**: In `BaseT1` systems, an
415 "OK" result typically also means that the link is up and likely in **slave
416 mode**, since cable tests usually only pass in this mode. For some
417 **10BaseT1L** PHYs, an "OK" result may occur even if the cable is too long
418 for the PHY's configured range (for example, when the range is configured
419 for short-distance mode).
420
421 - **Open Circuit**:
422
423 - An **Open Circuit** result typically indicates that the cable is damaged or
424 disconnected at the reported fault length. Consider these possibilities:
425
426 - If the link partner is in **admin down** state or powered off, you might
427 still get an "Open Circuit" result even if the cable is functional.
428
429 - **Next Steps**: Inspect the cable at the fault length for visible damage
430 or loose connections. Verify the link partner is powered on and in the
431 correct mode.
432
433 - **Short within Pair**:
434
435 - A **Short within Pair** indicates an unintended connection within the same
436 pair of wires, typically caused by physical damage to the cable.
437
438 - **Next Steps**: Replace or repair the cable and check for any physical
439 damage or improperly crimped connectors.
440
441 - **Short to Another Pair**:
442
443 - A **Short to Another Pair** means the wires from different pairs are
444 shorted, which could occur due to physical damage or incorrect wiring.
445
446 - **Next Steps**: Replace or repair the damaged cable. Inspect the cable for
447 incorrect terminations or pinched wiring.
448
449 - **Impedance Mismatch**:
450
451 - **Impedance Mismatch** indicates a reflection caused by an impedance
452 discontinuity in the cable. This can happen when a part of the cable has
453 abnormal impedance (e.g., when different cable types are spliced together
454 or when there is a defect in the cable).
455
456 - **Next Steps**: Check the cable quality and ensure consistent impedance
457 throughout its length. Replace any sections of the cable that do not meet
458 specifications.
459
460 - **Noise**:
461
462 - **Noise** means that the Time Domain Reflectometry (TDR) test could not
463 complete due to excessive noise on the cable, which can be caused by
464 interference from electromagnetic sources.
465
466 - **Next Steps**: Identify and eliminate sources of electromagnetic
467 interference (EMI) near the cable. Consider using shielded cables or
468 rerouting the cable away from noise sources.
469
470 - **Resolution Not Possible**:
471
472 - **Resolution Not Possible** means that the TDR test could not detect the
473 issue due to the resolution limitations of the test or because the fault is
474 beyond the distance that the test can measure.
475
476 - **Next Steps**: Inspect the cable manually if possible, or use alternative
477 diagnostic tools that can handle greater distances or higher resolution.
478
479 - **Unknown**:
480
481 - An **Unknown** result may occur when the test cannot classify the fault or
482 when a specific issue is outside the scope of the tool's detection
483 capabilities.
484
485 - **Next Steps**: Re-run the test, verify the link partner's state, and inspect
486 the cable manually if necessary.
487
488 Verify Link Partner PHY Configuration
489 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
490
491 If the cable test passes but the link is still not functioning correctly, it’s
492 essential to verify the configuration of the link partner’s PHY. Mismatches in
493 speed, duplex settings, or master-slave roles can cause connection issues.
494
495 Autonegotiation Mismatch
496 ^^^^^^^^^^^^^^^^^^^^^^^^
497
498 - If both link partners support autonegotiation, ensure that autonegotiation is
499 enabled on both sides and that all supported link modes are advertised. A
500 mismatch can lead to connectivity problems or sub optimal performance.
501
502 - **Quick Fix:** Reset autonegotiation to the default settings, which will
503 advertise all default link modes:
504
505 .. code-block:: bash
506
507 ethtool -s <interface> autoneg on
508
509 - **Command to check configuration:** `ethtool <interface>`
510
511 - **Expected Output:** Ensure that both sides advertise compatible link modes.
512 If autonegotiation is off, verify that both link partners are configured for
513 the same speed and duplex.
514
515 The following example shows a case where the local PHY advertises fewer link
516 modes than it supports. This will reduce the number of overlapping link modes
517 with the link partner. In the worst case, there will be no common link modes,
518 and the link will not be created:
519
520 .. code-block:: bash
521
522 Settings for eth0:
523 Supported link modes: 1000baseT/Full, 100baseT/Full
524 Advertised link modes: 1000baseT/Full
525 Speed: 1000Mb/s
526 Duplex: Full
527 Auto-negotiation: on
528
529 Combined Mode Mismatch (Autonegotiation on One Side, Forced on the Other)
530 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
531
532 - One possible issue occurs when one side is using **autonegotiation** (as in
533 most modern systems), and the other side is set to a **forced link mode**
534 (e.g., older hardware with single-speed hubs). In such cases, modern PHYs
535 will attempt to detect the forced mode on the other side. If the link is
536 established, you may notice:
537
538 - **No or empty "Link partner advertised link modes"**.
539
540 - **"Link partner advertised auto-negotiation:"** will be **"no"** or not
541 present.
542
543 - This type of detection does not always work reliably:
544
545 - Typically, the modern PHY will default to **Half Duplex**, even if the link
546 partner is actually configured for **Full Duplex**.
547
548 - Some PHYs may not work reliably if the link partner switches from one
549 forced mode to another. In this case, only a down/up cycle may help.
550
551 - **Next Steps**: Set both sides to the same fixed speed and duplex mode to
552 avoid potential detection issues.
553
554 .. code-block:: bash
555
556 ethtool -s <interface> speed 1000 duplex full autoneg off
557
558 Master/Slave Role Mismatch (BaseT1 and 1000BaseT PHYs)
559 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
560
561 - In **BaseT1** systems (e.g., 1000BaseT1, 100BaseT1), link establishment
562 requires that one device is configured as **master** and the other as
563 **slave**. A mismatch in this master-slave configuration can prevent the link
564 from being established. However, **1000BaseT** also supports configurable
565 master/slave roles and can face similar issues.
566
567 - **Role Preference in 1000BaseT**: The **1000BaseT** specification allows link
568 partners to negotiate master-slave roles or role preferences during
569 autonegotiation. Some PHYs have hardware limitations or bugs that prevent
570 them from functioning properly in certain roles. In such cases, drivers may
571 force these PHYs into a specific role (e.g., **forced master** or **forced
572 slave**) or try a weaker option by setting preferences. If both link partners
573 have the same issue and are forced into the same mode (e.g., both forced into
574 master mode), they will not be able to establish a link.
575
576 - **Next Steps**: Ensure that one side is configured as **master** and the
577 other as **slave** to avoid this issue, particularly when hardware
578 limitations are involved, or try the weaker **preferred** option instead of
579 **forced**. Check for any driver-related restrictions or forced modes.
580
581 - **Command to force master/slave mode**:
582
583 .. code-block:: bash
584
585 ethtool -s <interface> master-slave forced-master
586
587 or:
588
589 .. code-block:: bash
590
591 ethtool -s <interface> master-slave forced-master speed 1000 duplex full autoneg off
592
593
594 - **Check the current master/slave status**:
595
596 .. code-block:: bash
597
598 ethtool <interface>
599
600 Example Output:
601
602 .. code-block:: bash
603
604 master-slave cfg: forced-master
605 master-slave status: master
606
607 - **Hardware Bugs and Driver Forcing**: If a known hardware issue forces the
608 PHY into a specific mode, it’s essential to check the driver source code or
609 hardware documentation for details. Ensure that the roles are compatible
610 across both link partners, and if both PHYs are forced into the same mode,
611 adjust one side accordingly to resolve the mismatch.
612
613 Monitor Link Resets and Speed Drops
614 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
615
616 If the link is unstable, showing frequent resets or speed drops, this may
617 indicate issues with the cable, PHY configuration, or environmental factors.
618 While there is still no completely unified way in Linux to directly monitor
619 downshift events or link speed changes via user space tools, both the Linux
620 kernel logs and `ethtool` can provide valuable insights, especially if the
621 driver supports reporting such events.
622
623 - **Monitor Kernel Logs for Link Resets and Speed Drops**:
624
625 - The Linux kernel will print link status changes, including downshift
626 events, in the system logs. These messages typically include speed changes,
627 duplex mode, and downshifted link speed (if the driver supports it).
628
629 - **Command to monitor kernel logs in real-time:**
630
631 .. code-block:: bash
632
633 dmesg -w | grep "Link is Up\|Link is Down"
634
635 - Example Output (if a downshift occurs):
636
637 .. code-block:: bash
638
639 eth0: Link is Up - 100Mbps/Full (downshifted) - flow control rx/tx
640 eth0: Link is Down
641
642 This indicates that the link has been established but has downshifted from
643 a higher speed.
644
645 - **Note**: Not all drivers or PHYs support downshift reporting, so you may
646 not see this information for all devices.
647
648 - **Monitor Link Down Events Using `ethtool`**:
649
650 - Starting with the latest kernel and `ethtool` versions, you can track
651 **Link Down Events** using the `ethtool -I` command. This will provide
652 counters for link drops, helping to diagnose link instability issues if
653 supported by the driver.
654
655 - **Command to monitor link down events:**
656
657 .. code-block:: bash
658
659 ethtool -I <interface>
660
661 - Example Output (if supported):
662
663 .. code-block:: bash
664
665 PSE attributes for eth1:
666 Link Down Events: 5
667
668 This indicates that the link has dropped 5 times. Frequent link down events
669 may indicate cable or environmental issues that require further
670 investigation.
671
672 - **Check Link Status and Speed**:
673
674 - Even though downshift counts or events are not easily tracked, you can
675 still use `ethtool` to manually check the current link speed and status.
676
677 - **Command:** `ethtool <interface>`
678
679 - **Expected Output:**
680
681 .. code-block:: bash
682
683 Speed: 1000Mb/s
684 Duplex: Full
685 Auto-negotiation: on
686 Link detected: yes
687
688 Any inconsistencies in the expected speed or duplex setting could indicate
689 an issue.
690
691 - **Disable Energy-Efficient Ethernet (EEE) for Diagnostics**:
692
693 - **EEE** (Energy-Efficient Ethernet) can be a source of link instability due
694 to transitions in and out of low-power states. For diagnostic purposes, it
695 may be useful to **temporarily** disable EEE to determine if it is
696 contributing to link instability. This is **not a generic recommendation**
697 for disabling power management.
698
699 - **Next Steps**: Disable EEE and monitor if the link becomes stable. If
700 disabling EEE resolves the issue, report the bug so that the driver can be
701 fixed.
702
703 - **Command:**
704
705 .. code-block:: bash
706
707 ethtool --set-eee <interface> eee off
708
709 - **Important**: If disabling EEE resolves the instability, the issue should
710 be reported to the maintainers as a bug, and the driver should be corrected
711 to handle EEE properly without causing instability. Disabling EEE
712 permanently should not be seen as a solution.
713
714 - **Monitor Error Counters**:
715
716 - Use `ethtool -S <interface> --all-groups` to retrieve standardized interface
717 statistics if the driver supports the unified interface:
718
719 - **Command:** `ethtool -S <interface> --all-groups`
720
721 - **Example Output (if supported)**:
722
723 .. code-block:: bash
724
725 phydev-RxFrames: 100391
726 phydev-RxErrors: 0
727 phydev-TxFrames: 9
728 phydev-TxErrors: 0
729
730 - If the unified interface is not supported, use `ethtool -S <interface>` to
731 retrieve MAC and PHY counters. Note that non-standardized PHY counter names
732 vary by driver and must be interpreted accordingly:
733
734 - **Command:** `ethtool -S <interface>`
735
736 - **Example Output (if supported)**:
737
738 .. code-block:: bash
739
740 rx_crc_errors: 123
741 tx_errors: 45
742 rx_frame_errors: 78
743
744 - **Note**: If no meaningful error counters are available or if counters are
745 not supported, you may need to rely on physical inspections (e.g., cable
746 condition) or kernel log messages (e.g., link up/down events) to further
747 diagnose the issue.
748
749 - **Compare Counters**:
750
751 - Compare the egress and ingress frame counts reported by the PHY and MAC.
752
753 - A small difference may occur due to sampling rate differences between the
754 MAC and PHY drivers, or if the PHY and MAC are not always fully
755 synchronized in their UP or DOWN states.
756
757 - Significant discrepancies indicate potential issues in the data path
758 between the MAC and PHY.
759
760 When All Else Fails...
761 ~~~~~~~~~~~~~~~~~~~~~~
762
763 So you've checked the cables, monitored the logs, disabled EEE, and still...
764 nothing? Don’t worry, you’re not alone. Sometimes, Ethernet gremlins just don’t
765 want to cooperate.
766
767 But before you throw in the towel (or the Ethernet cable), take a deep breath.
768 It’s always possible that:
769
770 1. Your PHY has a unique, undocumented personality.
771
772 2. The problem is lying dormant, waiting for just the right moment to magically
773 resolve itself (hey, it happens!).
774
775 3. Or, it could be that the ultimate solution simply hasn’t been invented yet.
776
777 If none of the above bring you comfort, there’s one final step: contribute! If
778 you've uncovered new or unusual issues, or have creative diagnostic methods,
779 feel free to share your findings and extend this documentation. Together, we
780 can hunt down every elusive network issue - one twisted pair at a time.
781
782 Remember: sometimes the solution is just a reboot away, but if not, it’s time to
783 dig deeper - or report that bug!
784
785

3. 한국어 전문 번역

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

꼬임쌍 이더넷 계층 1 진단 개념

1-23

이 문서는 `GPL-2.0` 라이선스를 따릅니다.

OSI 계층 1에서 꼬임쌍 이더넷 변형을 조사하기 위한 진단 개념

소개

이 문서는 두 주요 독자를 대상으로 합니다.

사용자와 시스템 관리자는 불안정한 링크, 속도 저하, 원인을 알 수 없는 네트워크 문제를 만났을 때 단계별 문제 해결 흐름을 따라 흔한 꼬임쌍 이더넷 계층 1 문제를 찾고 해결할 수 있습니다.

네트워크 드라이버와 PHY 지원을 다루는 커널 개발자는 진단 절차와 Linux 커널 진단 인터페이스를 확장하거나 개선할 영역을 파악해 향후 개선 우선순위를 정할 수 있습니다.

.. SPDX-License-Identifier: GPL-2.0

Diagnostic Concept for Investigating Twisted Pair Ethernet Variants at OSI Layer 1
==================================================================================

Introduction
------------

This documentation is designed for two primary audiences:

1. **Users and System Administrators**: For those dealing with real-world
   Ethernet issues, this guide provides a practical, step-by-step
   troubleshooting flow to help identify and resolve common problems in Twisted
   Pair Ethernet at OSI Layer 1. If you're facing unstable links, speed drops,
   or mysterious network issues, jump right into the step-by-step guide and
   follow it through to find your solution.

2. **Kernel Developers**: For developers working with network drivers and PHY
   support, this documentation outlines the diagnostic process and highlights
   areas where the Linux kernel’s diagnostic interfaces could be extended or
   improved. By understanding the diagnostic flow, developers can better
   prioritize future enhancements.

Linux 진단 범위와 시나리오

24-51

Linux에서 수행하는 단계별 진단 안내서(일반 이더넷)

이 안내서는 SPE(Single-Pair Ethernet), MPE(Multi-Pair Ethernet), PoDL(Power over Data Line), PoE(Clause 33 PSE)를 포함한 여러 이더넷 환경에서 링크 안정성과 감지를 중심으로 일반적인 문제 해결 시나리오를 다룹니다.

대상 환경은 Linux 커널 6.11 이상, ethtool 6.10 이상, iproute2 6.4.0 이상입니다. 링크 상대편에 접근하기 어렵거나 전혀 접근할 수 없는 상황을 가정해 로컬 진단에 집중합니다.

진단 시나리오
증상판단과 다음 단계
링크가 올라오고 안정적이지만 데이터 전송 없음OSI 계층 2 문제 해결 안내서로 이동합니다.
링크 불안정링크 재설정, 속도 저하, 변동은 하드웨어 또는 물리 계층 문제일 수 있습니다.
링크 감지 안 됨인터페이스는 올라왔지만 물리 링크가 형성되지 않은 상태입니다.

관찰한 증상으로 진단 계층과 다음 절차를 고릅니다.

Step-by-Step Diagnostic Guide from Linux (General Ethernet)
-----------------------------------------------------------

This diagnostic guide covers common Ethernet troubleshooting scenarios,
focusing on **link stability and detection** across different Ethernet
environments, including **Single-Pair Ethernet (SPE)** and **Multi-Pair
Ethernet (MPE)**, as well as power delivery technologies like **PoDL** (Power
over Data Line) and **PoE** (Clause 33 PSE).

The guide is designed to help users diagnose physical layer (Layer 1) issues on
systems running **Linux kernel version 6.11 or newer**, utilizing **ethtool
version 6.10 or later** and **iproute2 version 6.4.0 or later**.

In this guide, we assume that users may have **limited or no access to the link
partner** and will focus on diagnosing issues locally.

Diagnostic Scenarios
~~~~~~~~~~~~~~~~~~~~

- **Link is up and stable, but no data transfer**: If the link is stable but
  there are issues with data transmission, refer to the **OSI Layer 2
  Troubleshooting Guide**.

- **Link is unstable**: Link resets, speed drops, or other fluctuations
  indicate potential issues at the hardware or physical layer.

- **No link detected**: The interface is up, but no link is established.

인터페이스 관리 상태 확인

52-130

인터페이스 상태 확인

먼저 이더넷 인터페이스가 관리상 up 상태인지 확인합니다. `ethtool`은 링크와 PHY 상태를 보여 주지만 인터페이스 관리 상태는 보여 주지 않으므로, 출력의 꺾쇠괄호 안에 상태를 표시하는 `ip` 명령을 사용합니다.

`<NO-CARRIER,BROADCAST,MULTICAST,UP>`에서 `UP`은 관리상 up, `NO-CARRIER`는 관리상 up이지만 물리 링크를 감지하지 못했다는 뜻입니다. `<BROADCAST,MULTICAST>`만 보이면 관리상 down입니다.

명령: `ip link show dev <interface>`

4: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 ...
   link/ether 88:14:2b:00:96:f2 brd ff:ff:ff:ff:ff:ff

출력에 `UP`이 있으면 시스템이 물리 링크 형성을 시도하고 있습니다. `NO-CARRIER`도 있으면 케이블 결함, 구성 오류, 링크 상대편 미연결 같은 계층 1 문제일 수 있으므로 링크 상태와 PHY 구성을 검사합니다.

`UP`이 없고 `<BROADCAST,MULTICAST>` 같은 상태만 있으면 다음 명령으로 인터페이스를 올립니다.

ip link set dev <interface> up

관리상 up인데 `NO-CARRIER`이면 물리 계층 문제 진단으로 이동합니다. down 상태를 올렸다면 다음 단계 전에 이 확인을 반복해 새 상태를 검증합니다.

`UP`이 있고 `NO-CARRIER`가 없으면 물리 링크가 성공적으로 형성된 것입니다. 정상 동작한다면 계층 1 진단을 마칩니다. 링크는 있지만 데이터가 흐르지 않으면 VLAN·MAC 같은 계층 2, IP·라우팅·ARP 같은 계층 3, 방화벽·서비스 같은 계층 4 이상을 진단합니다.

링크가 자주 재설정되거나 끊기면 케이블 결함, 간섭, 전력 공급 문제 같은 물리 계층 원인일 수 있으므로 다음 단계로 진행합니다.

Verify Interface Status
~~~~~~~~~~~~~~~~~~~~~~~

Begin by verifying the status of the Ethernet interface to check if it is
administratively up. Unlike `ethtool`, which provides information on the link
and PHY status, it does not show the **administrative state** of the interface.
To check this, you should use the `ip` command, which describes the interface
state within the angle brackets `"<>"` in its output.

For example, in the output `<NO-CARRIER,BROADCAST,MULTICAST,UP>`, the important
keywords are:

- **UP**: The interface is in the administrative "UP" state.
- **NO-CARRIER**: The interface is administratively up, but no physical link is
  detected.

If the output shows `<BROADCAST,MULTICAST>`, this indicates the interface is in
the administrative "DOWN" state.

- **Command:** `ip link show dev <interface>`

- **Expected Output:**

  .. code-block:: bash

     4: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 ...
        link/ether 88:14:2b:00:96:f2 brd ff:ff:ff:ff:ff:ff

- **Interpreting the Output:**

  - **Administrative UP State**:

    - If the output contains **"UP"**, the interface is administratively up,
      and the system is trying to establish a physical link.

    - If you also see **"NO-CARRIER"**, it means the physical link has not been
      detected, indicating potential Layer 1 issues like a cable fault,
      misconfiguration, or no connection at the link partner. In this case,
      proceed to the **Inspect Link Status and PHY Configuration** section.

  - **Administrative DOWN State**:

    - If the output lacks **"UP"** and shows only states like
      **"<BROADCAST,MULTICAST>"**, it means the interface is administratively
      down. In this case, bring the interface up using the following command:

      .. code-block:: bash

         ip link set dev <interface> up

- **Next Steps**:

  - If the interface is **administratively up** but shows **NO-CARRIER**,
    proceed to the **Inspect Link Status and PHY Configuration** section to
    troubleshoot potential physical layer issues.

  - If the interface was **administratively down** and you have brought it up,
    ensure to **repeat this verification step** to confirm the new state of the
    interface before proceeding

  - **If the interface is up and the link is detected**:

    - If the output shows **"UP"** and there is **no `NO-CARRIER`**, the
      interface is administratively up, and the physical link has been
      successfully established. If everything is working as expected, the Layer
      1 diagnostics are complete, and no further action is needed.

    - If the interface is up and the link is detected but **no data is being
      transferred**, the issue is likely beyond Layer 1, and you should proceed
      with diagnosing the higher layers of the OSI model. This may involve
      checking Layer 2 configurations (such as VLANs or MAC address issues),
      Layer 3 settings (like IP addresses, routing, or ARP), or Layer 4 and
      above (firewalls, services, etc.).

    - If the **link is unstable** or **frequently resetting or dropping**, this
      may indicate a physical layer issue such as a faulty cable, interference,
      or power delivery problems. In this case, proceed with the next step in
      this guide.

PoDL·PoE 전력 공급 확인

217-324

전력 공급 확인(PoDL 또는 PoE)

시스템이 PoDL·PoE를 구현하지 않았거나 PSE를 전용 사용자 공간 소프트웨어·외부 도구로 관리한다면 이 단계를 건너뜁니다. 대신 LED, 멀티미터, 공급업체 소프트웨어로 전력을 확인합니다.

Linux가 PoDL 또는 PoE를 직접 관리한다면 `ethtool --show-pse <interface>`로 공급 상태를 확인합니다.

PSE 출력 해석
상황주요 출력
PSE 미지원`No PSE is attached` 또는 `Operation not supported`
PoDL`PoDL PSE Admin State: enabled`, `Power Detection Status: delivering power`
PoE Clause 33관리 상태, 전력 공급 상태, `Clause 33 PSE Available Power Limit`

지원 방식과 관리 상태, 실제 전력 감지 상태를 구분합니다.

가용 전력 한도가 링크 상대편에 부족하면 다음 명령으로 높일 수 있습니다.

ethtool --set-pse <interface> c33-pse-avail-pw-limit <limit>
ethtool --set-pse eth1 c33-pse-avail-pw-limit 18000
ethtool --show-pse eth1

조정 뒤에는 `Clause 33 PSE Available Power Limit: 18000`처럼 새 한도가 표시되어야 합니다.

PoE·PoDL을 쓰지 않으면 다음 진단으로 이동합니다. Linux PSE-PD 프레임워크 밖에서 제어한다면 공급업체 문서와 외부 도구를 사용해야 하며 이 문서의 범위를 벗어납니다.

`PSE Admin State`가 disabled이면 PoDL은 `ethtool --set-pse <devname> podl-pse-admin-control enable`, Clause 33 PoE는 `ethtool --set-pse <devname> c33-pse-admin-control enable`로 활성화한 뒤 전력 확인 단계 처음부터 다시 검사합니다.

`Power Detection Status`가 `delivering power`가 아니고 `over current` 같은 값을 보이면 케이블 단락, 부족한 공급 전력, PSE 자체 결함을 조사합니다. 전력은 공급되지만 링크가 없다면 케이블 진단과 PHY 구성 검사를 진행합니다.

Check Power Delivery (PoDL or PoE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If it is known that **PoDL** or **PoE** is **not implemented** on the system,
or the **PSE** (Power Sourcing Equipment) is managed by proprietary user-space
software or external tools, you can skip this step. In such cases, verify power
delivery through alternative methods, such as checking hardware indicators
(LEDs), using multimeters, or consulting vendor-specific software for
monitoring power status.

If **PoDL** or **PoE** is implemented and managed directly by Linux, follow
these steps to ensure power is being delivered correctly:

- **Command:** `ethtool --show-pse <interface>`

- **Expected Output Examples**:

  1. **PSE Not Supported**:

     If no PSE is attached or the interface does not support PSE, the following
     output is expected:

     .. code-block:: bash

        netlink error: No PSE is attached
        netlink error: Operation not supported

  2. **PoDL (Single-Pair Ethernet)**:

     When PoDL is implemented, you might see the following attributes:

     .. code-block:: bash

        PSE attributes for eth1:
        PoDL PSE Admin State: enabled
        PoDL PSE Power Detection Status: delivering power

  3. **PoE (Clause 33 PSE)**:

     For standard PoE, the output may look like this:

     .. code-block:: bash

        PSE attributes for eth1:
        Clause 33 PSE Admin State: enabled
        Clause 33 PSE Power Detection Status: delivering power
        Clause 33 PSE Available Power Limit: 18000

- **Adjust Power Limit (if needed)**:

  - Sometimes, the available power limit may not be sufficient for the link
    partner. You can increase the power limit as needed.

  - **Command:** `ethtool --set-pse <interface> c33-pse-avail-pw-limit <limit>`

    Example:

    .. code-block:: bash

      ethtool --set-pse eth1 c33-pse-avail-pw-limit 18000
      ethtool --show-pse eth1

    **Expected Output** after adjusting the power limit:

    .. code-block:: bash

      Clause 33 PSE Available Power Limit: 18000


- **Next Steps**:

  - **PoE or PoDL Not Used**: If **PoE** or **PoDL** is not implemented or used
    on the system, proceed to the next diagnostic step, as power delivery is
    not relevant for this setup.

  - **PoE or PoDL Controlled Externally**: If **PoE** or **PoDL** is used but
    is not managed by the Linux kernel's **PSE-PD** framework (i.e., it is
    controlled by proprietary user-space software or external tools), this part
    is out of scope for this documentation. Please consult vendor-specific
    documentation or external tools for monitoring and managing power delivery.

  - **PSE Admin State Disabled**:

    - If the `PSE Admin State:` is **disabled**, enable it by running one of
      the following commands:

      .. code-block:: bash

         ethtool --set-pse <devname> podl-pse-admin-control enable

      or, for Clause 33 PSE (PoE):

         ethtool --set-pse <devname> c33-pse-admin-control enable

    - After enabling the PSE Admin State, return to the start of the **Check
      Power Delivery (PoDL or PoE)** step to recheck the power delivery status.

  - **Power Not Delivered**: If the `Power Detection Status` shows something
    other than "delivering power" (e.g., `over current`), troubleshoot the
    **PSE**. Check for potential issues such as a short circuit in the cable,
    insufficient power delivery, or a fault in the PSE itself.

  - **Power Delivered but No Link**: If power is being delivered but no link is
    established, proceed with further diagnostics by performing **Cable
    Diagnostics** or reviewing the **Inspect Link Status and PHY
    Configuration** steps to identify any underlying issues with the physical
    link or settings.

SPE·MPE 케이블 진단

325-371

케이블 진단

`ethtool --cable-test <interface>`로 open circuit, short, impedance mismatch, noise 같은 물리 계층 결함을 시험합니다. 결과는 케이블 상태, 사용 기술, 링크 상대편 상태에 따라 달라질 수 있습니다.

SPE 예제의 `Pair A, fault length: 25.00m`와 `Pair A code Open Circuit`는 보고 거리 근처의 단선이나 케이블 결함을 뜻할 수 있지만 상대편 상태의 영향도 받습니다.

MPE 예제에서 Pair A와 B는 `OK`, Pair C는 `Open Circuit`입니다. A와 B에서 자동 협상을 사용 중이면 케이블 시험이 방해받을 수도 있습니다.

Cable test completed for device eth1.
Pair A, fault length: 25.00m
Pair A code Open Circuit

Cable test completed for device eth0.
Pair A code OK
Pair B code OK
Pair C code Open Circuit

각 결과의 자세한 해석은 다음 문제 해결 절을 따릅니다.

Cable Diagnostics
~~~~~~~~~~~~~~~~~

Use `ethtool` to test for physical layer issues such as cable faults. The test
results can vary depending on the cable's condition, the technology in use, and
the state of the link partner. The results from the cable test will help in
diagnosing issues like open circuits, shorts, impedance mismatches, and
noise-related problems.

- **Command:** `ethtool --cable-test <interface>`

The following are the typical outputs for **Single-Pair Ethernet (SPE)** and
**Multi-Pair Ethernet (MPE)**:

- **For Single-Pair Ethernet (SPE)**:
  - **Expected Output (SPE)**:

  .. code-block:: bash

    Cable test completed for device eth1.
    Pair A, fault length: 25.00m
    Pair A code Open Circuit

  This indicates an open circuit or cable fault at the reported distance, but
  results can be influenced by the link partner's state. Refer to the
  **"Troubleshooting Based on Cable Test Results"** section for further
  interpretation of these results.

- **For Multi-Pair Ethernet (MPE)**:
  - **Expected Output (MPE)**:

  .. code-block:: bash

    Cable test completed for device eth0.
    Pair A code OK
    Pair B code OK
    Pair C code Open Circuit

  Here, Pair C is reported as having an open circuit, while Pairs A and B are
  functioning correctly. However, if autonegotiation is in use on Pairs A and
  B, the cable test may be disrupted. Refer to the **"Troubleshooting Based on
  Cable Test Results"** section for a detailed explanation of these issues and
  how to resolve them.

For detailed descriptions of the different possible cable test results, please
refer to the **"Troubleshooting Based on Cable Test Results"** section.

케이블 시험의 한계와 오탐

372-403

케이블 시험 결과에 따른 문제 해결

케이블 시험 정확도와 신뢰성은 로컬 하드웨어와 링크 상대편의 능력·특성에 크게 좌우되며 구현마다 상당히 다를 수 있습니다.

현재 구현에는 실제 물리 상태를 정확히 반영하지 못하는 사각지대가 있습니다. `Open Circuit`은 케이블 손상·분리뿐 아니라 정상 케이블의 상대편 전원이 꺼졌을 때도 나올 수 있습니다. 일부 PHY는 상대편이 forced slave이면 실제 단락이 없어도 `Short within Pair`를 보고할 수 있습니다.

커널 UAPI가 하드웨어 특성에 따른 추가 맥락이나 가능한 변형을 제공하도록 확장하면 해석이 쉬워집니다. 이런 특성은 하드웨어별로 다르므로 커널 드라이버가 각 결과의 잠재적 오탐 플래그나 힌트를 제공하기에 적합합니다.

개선 전까지는 한계를 인지하고 필요하면 케이블을 직접 검사해 오탐 여부를 확인해야 합니다.

Troubleshooting Based on Cable Test Results
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

After running the cable test, the results can help identify specific issues in
the physical connection. However, it is important to note that **cable testing
results heavily depend on the capabilities and characteristics of both the
local hardware and the link partner**. The accuracy and reliability of the
results can vary significantly between different hardware implementations.

In some cases, this can introduce **blind spots** in the current cable testing
implementation, where certain results may not accurately reflect the actual
physical state of the cable. For example:

- An **Open Circuit** result might not only indicate a damaged or disconnected
  cable but also occur if the cable is properly attached to a powered-down link
  partner.

- Some PHYs may report a **Short within Pair** if the link partner is in
  **forced slave mode**, even though there is no actual short in the cable.

To help users interpret the results more effectively, it could be beneficial to
extend the **kernel UAPI** (User API) to provide additional context or
**possible variants** of issues based on the hardware’s characteristics. Since
these quirks are often hardware-specific, the **kernel driver** would be an
ideal source of such information. By providing flags or hints related to
potential false positives for each test result, users would have a better
understanding of what to verify and where to investigate further.

Until such improvements are made, users should be aware of these limitations
and manually verify cable issues as needed. Physical inspections may help
resolve uncertainties related to false positive results.

케이블 시험 결과별 조치

404-487
케이블 시험 결과 해석
결과의미와 다음 조치
OK케이블에서 문제를 찾지 못했습니다. 문제가 계속되면 duplex나 속도 협상 같은 상위 계층 원인을 확인합니다. BaseT1에서는 보통 링크가 up이고 slave mode일 가능성도 뜻합니다. 일부 10BaseT1L PHY는 설정 범위보다 케이블이 길어도 OK일 수 있습니다.
Open Circuit보고 거리에서 케이블이 손상되거나 분리되었을 가능성이 큽니다. 상대편이 admin down이거나 꺼져 있어도 나올 수 있으므로 손상·느슨한 연결과 상대편 전원·모드를 함께 확인합니다.
Short within Pair같은 wire pair 내부의 의도하지 않은 연결입니다. 케이블과 잘못 압착된 connector를 검사하고 수리·교체합니다.
Short to Another Pair서로 다른 pair 사이 단락으로 물리 손상이나 배선 오류가 원인일 수 있습니다. termination과 눌린 배선을 검사하고 케이블을 수리·교체합니다.
Impedance Mismatch케이블 임피던스 불연속에 따른 반사입니다. 다른 종류 케이블 접합이나 결함 구간을 찾아 규격에 맞지 않는 부분을 교체합니다.
Noise과도한 전자기 간섭 때문에 TDR이 끝나지 못했습니다. EMI 원인을 제거하고 차폐 케이블 또는 노이즈원과 떨어진 경로를 고려합니다.
Resolution Not Possible시험 해상도 한계 또는 측정 거리 밖 결함입니다. 직접 검사하거나 더 긴 거리·높은 해상도를 지원하는 도구를 사용합니다.
Unknown시험이 결함을 분류하지 못했거나 탐지 범위 밖 문제입니다. 시험을 반복하고 상대편 상태와 케이블을 직접 확인합니다.

TDR 결과마다 가능한 원인과 다음 조치를 연결합니다.

The results can be one of the following:

- **OK**:

  - The cable is functioning correctly, and no issues were detected.

  - **Next Steps**: If you are still experiencing issues, it might be related
    to higher-layer problems, such as duplex mismatches or speed negotiation,
    which are not physical-layer issues.

  - **Special Case for `BaseT1` (1000/100/10BaseT1)**: In `BaseT1` systems, an
    "OK" result typically also means that the link is up and likely in **slave
    mode**, since cable tests usually only pass in this mode. For some
    **10BaseT1L** PHYs, an "OK" result may occur even if the cable is too long
    for the PHY's configured range (for example, when the range is configured
    for short-distance mode).

- **Open Circuit**:

  - An **Open Circuit** result typically indicates that the cable is damaged or
    disconnected at the reported fault length. Consider these possibilities:

    - If the link partner is in **admin down** state or powered off, you might
      still get an "Open Circuit" result even if the cable is functional.

    - **Next Steps**: Inspect the cable at the fault length for visible damage
      or loose connections. Verify the link partner is powered on and in the
      correct mode.

- **Short within Pair**:

  - A **Short within Pair** indicates an unintended connection within the same
    pair of wires, typically caused by physical damage to the cable.

    - **Next Steps**: Replace or repair the cable and check for any physical
      damage or improperly crimped connectors.

- **Short to Another Pair**:

  - A **Short to Another Pair** means the wires from different pairs are
    shorted, which could occur due to physical damage or incorrect wiring.

    - **Next Steps**: Replace or repair the damaged cable. Inspect the cable for
      incorrect terminations or pinched wiring.

- **Impedance Mismatch**:

  - **Impedance Mismatch** indicates a reflection caused by an impedance
    discontinuity in the cable. This can happen when a part of the cable has
    abnormal impedance (e.g., when different cable types are spliced together
    or when there is a defect in the cable).

    - **Next Steps**: Check the cable quality and ensure consistent impedance
      throughout its length. Replace any sections of the cable that do not meet
      specifications.

- **Noise**:

  - **Noise** means that the Time Domain Reflectometry (TDR) test could not
    complete due to excessive noise on the cable, which can be caused by
    interference from electromagnetic sources.

    - **Next Steps**: Identify and eliminate sources of electromagnetic
      interference (EMI) near the cable. Consider using shielded cables or
      rerouting the cable away from noise sources.

- **Resolution Not Possible**:

  - **Resolution Not Possible** means that the TDR test could not detect the
    issue due to the resolution limitations of the test or because the fault is
    beyond the distance that the test can measure.

    - **Next Steps**: Inspect the cable manually if possible, or use alternative
      diagnostic tools that can handle greater distances or higher resolution.

- **Unknown**:

  - An **Unknown** result may occur when the test cannot classify the fault or
    when a specific issue is outside the scope of the tool's detection
    capabilities.

    - **Next Steps**: Re-run the test, verify the link partner's state, and inspect
      the cable manually if necessary.

링크 상대편과 자동 협상 확인

488-557

링크 상대편 PHY 구성 확인

케이블 시험은 통과했지만 링크가 정상 동작하지 않으면 상대편 PHY 구성을 확인합니다. 속도, duplex, master-slave 역할 불일치는 연결 문제를 일으킬 수 있습니다.

자동 협상 불일치

양쪽이 자동 협상을 지원한다면 양쪽에서 켜고 지원하는 모든 링크 모드를 광고해야 합니다. 불일치는 연결 실패나 성능 저하를 일으킵니다. 다음 명령은 기본 설정으로 되돌려 모든 기본 링크 모드를 광고합니다.

ethtool -s <interface> autoneg on

`ethtool <interface>`로 양쪽이 호환 모드를 광고하는지 확인합니다. 자동 협상이 꺼졌다면 속도와 duplex가 같은지 확인합니다. 지원 모드보다 광고 모드가 적으면 상대편과 겹치는 모드가 줄고, 공통 모드가 없으면 링크가 형성되지 않습니다.

한쪽은 자동 협상이고 다른 쪽은 구형 장비처럼 강제 링크 모드인 결합 불일치에서는 현대 PHY가 강제 모드를 감지하려 시도합니다. 링크가 생겨도 상대편 광고 모드가 비어 있고 상대편 자동 협상은 `no`이거나 표시되지 않을 수 있습니다.

이 감지는 항상 신뢰할 수 있지 않습니다. 현대 PHY가 상대편의 full duplex 설정과 달리 half duplex를 기본 선택할 수 있고, 상대편이 강제 모드를 바꾸면 down/up cycle 전까지 제대로 동작하지 않는 PHY도 있습니다.

감지 문제를 피하려면 양쪽을 같은 고정 속도와 duplex로 설정합니다.

ethtool -s <interface> speed 1000 duplex full autoneg off
Verify Link Partner PHY Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If the cable test passes but the link is still not functioning correctly, it’s
essential to verify the configuration of the link partner’s PHY. Mismatches in
speed, duplex settings, or master-slave roles can cause connection issues.

Autonegotiation Mismatch
^^^^^^^^^^^^^^^^^^^^^^^^

- If both link partners support autonegotiation, ensure that autonegotiation is
  enabled on both sides and that all supported link modes are advertised. A
  mismatch can lead to connectivity problems or sub optimal performance.

- **Quick Fix:** Reset autonegotiation to the default settings, which will
  advertise all default link modes:

  .. code-block:: bash

     ethtool -s <interface> autoneg on

- **Command to check configuration:** `ethtool <interface>`

- **Expected Output:** Ensure that both sides advertise compatible link modes.
  If autonegotiation is off, verify that both link partners are configured for
  the same speed and duplex.

  The following example shows a case where the local PHY advertises fewer link
  modes than it supports. This will reduce the number of overlapping link modes
  with the link partner. In the worst case, there will be no common link modes,
  and the link will not be created:

  .. code-block:: bash

     Settings for eth0:
        Supported link modes:  1000baseT/Full, 100baseT/Full
        Advertised link modes: 1000baseT/Full
        Speed: 1000Mb/s
        Duplex: Full
        Auto-negotiation: on

Combined Mode Mismatch (Autonegotiation on One Side, Forced on the Other)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- One possible issue occurs when one side is using **autonegotiation** (as in
  most modern systems), and the other side is set to a **forced link mode**
  (e.g., older hardware with single-speed hubs). In such cases, modern PHYs
  will attempt to detect the forced mode on the other side. If the link is
  established, you may notice:

  - **No or empty "Link partner advertised link modes"**.

  - **"Link partner advertised auto-negotiation:"** will be **"no"** or not
    present.

- This type of detection does not always work reliably:

  - Typically, the modern PHY will default to **Half Duplex**, even if the link
    partner is actually configured for **Full Duplex**.

  - Some PHYs may not work reliably if the link partner switches from one
    forced mode to another. In this case, only a down/up cycle may help.

- **Next Steps**: Set both sides to the same fixed speed and duplex mode to
  avoid potential detection issues.

  .. code-block:: bash

     ethtool -s <interface> speed 1000 duplex full autoneg off

Master·slave 역할 불일치

558-612

Master/Slave 역할 불일치(BaseT1과 1000BaseT PHY)

1000BaseT1·100BaseT1 같은 BaseT1은 한 장치를 master, 다른 장치를 slave로 구성해야 링크가 형성됩니다. 1000BaseT도 역할을 구성할 수 있어 같은 문제가 생길 수 있습니다.

1000BaseT는 자동 협상 중 역할이나 역할 선호도를 협상합니다. 특정 역할에서 동작하지 못하는 하드웨어 한계나 버그가 있으면 드라이버가 forced master·forced slave를 설정하거나 preferred 같은 약한 선호를 줄 수 있습니다. 양쪽이 같은 문제로 같은 강제 역할을 가지면 링크를 만들 수 없습니다.

하드웨어 제한이 있다면 한쪽은 master, 다른 쪽은 slave로 맞추거나 forced 대신 preferred를 사용하고, 드라이버 제한과 강제 모드를 확인합니다.

ethtool -s <interface> master-slave forced-master
ethtool -s <interface> master-slave forced-master speed 1000 duplex full autoneg off
ethtool <interface>

현재 상태는 `master-slave cfg: forced-master`, `master-slave status: master`처럼 표시됩니다.

알려진 하드웨어 문제로 특정 모드가 강제된다면 드라이버 소스와 하드웨어 문서를 확인해 양쪽 역할이 호환되는지 검증하고, 둘 다 같은 모드라면 한쪽을 조정합니다.

Master/Slave Role Mismatch (BaseT1 and 1000BaseT PHYs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- In **BaseT1** systems (e.g., 1000BaseT1, 100BaseT1), link establishment
  requires that one device is configured as **master** and the other as
  **slave**. A mismatch in this master-slave configuration can prevent the link
  from being established. However, **1000BaseT** also supports configurable
  master/slave roles and can face similar issues.

- **Role Preference in 1000BaseT**: The **1000BaseT** specification allows link
  partners to negotiate master-slave roles or role preferences during
  autonegotiation. Some PHYs have hardware limitations or bugs that prevent
  them from functioning properly in certain roles. In such cases, drivers may
  force these PHYs into a specific role (e.g., **forced master** or **forced
  slave**) or try a weaker option by setting preferences. If both link partners
  have the same issue and are forced into the same mode (e.g., both forced into
  master mode), they will not be able to establish a link.

- **Next Steps**: Ensure that one side is configured as **master** and the
  other as **slave** to avoid this issue, particularly when hardware
  limitations are involved, or try the weaker **preferred** option instead of
  **forced**. Check for any driver-related restrictions or forced modes.

- **Command to force master/slave mode**:

  .. code-block:: bash

     ethtool -s <interface> master-slave forced-master

  or:

  .. code-block:: bash

     ethtool -s <interface> master-slave forced-master speed 1000 duplex full autoneg off


- **Check the current master/slave status**:

  .. code-block:: bash

     ethtool <interface>

  Example Output:

  .. code-block:: bash

     master-slave cfg: forced-master
     master-slave status: master

- **Hardware Bugs and Driver Forcing**: If a known hardware issue forces the
  PHY into a specific mode, it’s essential to check the driver source code or
  hardware documentation for details. Ensure that the roles are compatible
  across both link partners, and if both PHYs are forced into the same mode,
  adjust one side accordingly to resolve the mismatch.

링크 재설정과 속도 저하 감시

613-690

링크 재설정과 속도 저하 감시

잦은 재설정과 속도 저하는 케이블, PHY 구성, 환경 요인의 문제일 수 있습니다. 사용자 공간에서 downshift나 속도 변화를 직접 감시하는 완전히 통일된 방법은 아직 없지만, 드라이버 지원 여부에 따라 커널 로그와 `ethtool`이 정보를 제공합니다.

커널 로그는 downshift를 포함한 링크 상태 변화와 속도·duplex를 기록할 수 있습니다.

dmesg -w | grep "Link is Up\|Link is Down"
eth0: Link is Up - 100Mbps/Full (downshifted) - flow control rx/tx
eth0: Link is Down

이 출력은 링크가 형성되었지만 더 높은 속도에서 downshift되었음을 뜻합니다. 모든 드라이버와 PHY가 이를 보고하지는 않습니다.

최신 커널과 ethtool에서는 `ethtool -I <interface>`의 `Link Down Events` counter로 링크 끊김 횟수를 추적할 수 있습니다. 값이 5라면 링크가 5회 끊긴 것이며 케이블이나 환경 문제를 더 조사해야 합니다.

downshift 횟수를 직접 얻지 못해도 `ethtool <interface>`로 현재 speed, duplex, 자동 협상, 링크 감지 상태를 확인할 수 있습니다. 기대값과 불일치하면 문제가 있을 수 있습니다.

Monitor Link Resets and Speed Drops
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If the link is unstable, showing frequent resets or speed drops, this may
indicate issues with the cable, PHY configuration, or environmental factors.
While there is still no completely unified way in Linux to directly monitor
downshift events or link speed changes via user space tools, both the Linux
kernel logs and `ethtool` can provide valuable insights, especially if the
driver supports reporting such events.

- **Monitor Kernel Logs for Link Resets and Speed Drops**:

  - The Linux kernel will print link status changes, including downshift
    events, in the system logs. These messages typically include speed changes,
    duplex mode, and downshifted link speed (if the driver supports it).

  - **Command to monitor kernel logs in real-time:**

    .. code-block:: bash

      dmesg -w | grep "Link is Up\|Link is Down"

  - Example Output (if a downshift occurs):

    .. code-block:: bash

      eth0: Link is Up - 100Mbps/Full (downshifted) - flow control rx/tx
      eth0: Link is Down

    This indicates that the link has been established but has downshifted from
    a higher speed.

  - **Note**: Not all drivers or PHYs support downshift reporting, so you may
    not see this information for all devices.

- **Monitor Link Down Events Using `ethtool`**:

  - Starting with the latest kernel and `ethtool` versions, you can track
    **Link Down Events** using the `ethtool -I` command. This will provide
    counters for link drops, helping to diagnose link instability issues if
    supported by the driver.

  - **Command to monitor link down events:**

    .. code-block:: bash

      ethtool -I <interface>

  - Example Output (if supported):

    .. code-block:: bash

      PSE attributes for eth1:
      Link Down Events: 5

    This indicates that the link has dropped 5 times. Frequent link down events
    may indicate cable or environmental issues that require further
    investigation.

- **Check Link Status and Speed**:

  - Even though downshift counts or events are not easily tracked, you can
    still use `ethtool` to manually check the current link speed and status.

  - **Command:** `ethtool <interface>`

  - **Expected Output:**

    .. code-block:: bash

      Speed: 1000Mb/s
      Duplex: Full
      Auto-negotiation: on
      Link detected: yes

    Any inconsistencies in the expected speed or duplex setting could indicate
    an issue.

EEE 격리와 오류 counter 비교

691-759

진단을 위해 Energy-Efficient Ethernet(EEE) 비활성화

EEE는 저전력 상태 진입·이탈 때문에 링크 불안정의 원인이 될 수 있습니다. 진단 목적으로만 일시적으로 EEE를 꺼서 원인인지 확인할 수 있으며, 전력 관리를 일반적으로 끄라는 권고가 아닙니다.

ethtool --set-eee <interface> eee off

EEE를 끄자 안정화된다면 유지보수 담당자에게 버그로 보고해 드라이버가 EEE를 올바르게 처리하도록 수정해야 합니다. 영구 비활성화는 해결책으로 간주하면 안 됩니다.

오류 counter 감시

통합 인터페이스를 지원하면 `ethtool -S <interface> --all-groups`로 표준화된 `phydev-RxFrames`, `phydev-RxErrors`, `phydev-TxFrames`, `phydev-TxErrors`를 얻습니다.

지원하지 않으면 `ethtool -S <interface>`로 MAC·PHY counter를 얻습니다. `rx_crc_errors`, `tx_errors`, `rx_frame_errors` 같은 비표준 PHY 이름은 드라이버마다 달라 해석이 필요합니다.

의미 있는 counter가 없으면 케이블 상태를 직접 확인하거나 링크 up/down 커널 로그를 사용합니다.

PHY와 MAC이 보고한 송신·수신 frame 수를 비교합니다. 샘플링 속도 차이나 PHY·MAC의 UP/DOWN 동기 차이 때문에 작은 차이는 생길 수 있지만, 큰 차이는 MAC과 PHY 사이 데이터 경로 문제를 나타냅니다.

- **Disable Energy-Efficient Ethernet (EEE) for Diagnostics**:

  - **EEE** (Energy-Efficient Ethernet) can be a source of link instability due
    to transitions in and out of low-power states. For diagnostic purposes, it
    may be useful to **temporarily** disable EEE to determine if it is
    contributing to link instability. This is **not a generic recommendation**
    for disabling power management.

  - **Next Steps**: Disable EEE and monitor if the link becomes stable. If
    disabling EEE resolves the issue, report the bug so that the driver can be
    fixed.

  - **Command:**

    .. code-block:: bash

      ethtool --set-eee <interface> eee off

  - **Important**: If disabling EEE resolves the instability, the issue should
    be reported to the maintainers as a bug, and the driver should be corrected
    to handle EEE properly without causing instability. Disabling EEE
    permanently should not be seen as a solution.

- **Monitor Error Counters**:

  - Use `ethtool -S <interface> --all-groups` to retrieve standardized interface
    statistics if the driver supports the unified interface:

  - **Command:** `ethtool -S <interface> --all-groups`

  - **Example Output (if supported)**:

    .. code-block:: bash

      phydev-RxFrames: 100391
      phydev-RxErrors: 0
      phydev-TxFrames: 9
      phydev-TxErrors: 0

  - If the unified interface is not supported, use `ethtool -S <interface>` to
    retrieve MAC and PHY counters. Note that non-standardized PHY counter names
    vary by driver and must be interpreted accordingly:

  - **Command:** `ethtool -S <interface>`

  - **Example Output (if supported)**:

    .. code-block:: bash

      rx_crc_errors: 123
      tx_errors: 45
      rx_frame_errors: 78

  - **Note**: If no meaningful error counters are available or if counters are
    not supported, you may need to rely on physical inspections (e.g., cable
    condition) or kernel log messages (e.g., link up/down events) to further
    diagnose the issue.

  - **Compare Counters**:

    - Compare the egress and ingress frame counts reported by the PHY and MAC.

    - A small difference may occur due to sampling rate differences between the
      MAC and PHY drivers, or if the PHY and MAC are not always fully
      synchronized in their UP or DOWN states.

    - Significant discrepancies indicate potential issues in the data path
      between the MAC and PHY.

모든 단계로도 해결되지 않을 때

760-784

모든 방법이 실패할 때

케이블을 확인하고 로그를 감시하고 EEE를 껐는데도 해결되지 않을 수 있습니다. PHY에 문서화되지 않은 고유 동작이 있거나, 문제가 간헐적으로 잠복했다가 사라지거나, 아직 해결 방법이 개발되지 않았을 가능성이 있습니다.

새롭거나 특이한 문제와 창의적인 진단 방법을 발견했다면 결과를 공유하고 이 문서를 확장하는 것이 마지막 단계입니다. 재부팅으로 해결될 때도 있지만 그렇지 않으면 더 깊이 조사하거나 버그를 보고해야 합니다.

When All Else Fails...
~~~~~~~~~~~~~~~~~~~~~~

So you've checked the cables, monitored the logs, disabled EEE, and still...
nothing? Don’t worry, you’re not alone. Sometimes, Ethernet gremlins just don’t
want to cooperate.

But before you throw in the towel (or the Ethernet cable), take a deep breath.
It’s always possible that:

1. Your PHY has a unique, undocumented personality.

2. The problem is lying dormant, waiting for just the right moment to magically
   resolve itself (hey, it happens!).

3. Or, it could be that the ultimate solution simply hasn’t been invented yet.

If none of the above bring you comfort, there’s one final step: contribute! If
you've uncovered new or unusual issues, or have creative diagnostic methods,
feel free to share your findings and extend this documentation. Together, we
can hunt down every elusive network issue - one twisted pair at a time.

Remember: sometimes the solution is just a reboot away, but if not, it’s time to
dig deeper - or report that bug!