# US 2025/0097145 A1 · Link fault handling method, related apparatus, storage medium, and program product

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0097145 A1
- Document ID: US20250097145A1
- Status: Published application
- Kind: A1
- Application number: 18/963,883
- Filed: 2024-11-29
- Published: 2025-03-20
- Earliest claimed: 2022-06-02
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Ling LI; Shixing LIU; Zhigang JI; Jie LI; Huafeng WEN; Haibo WANG; Songlin WANG
- Web page: https://patentgrep.com/patent/US20250097145A1

## CPC

- H04L 45/02: Topology update or discovery
- H04L 45/28: using route fault recovery
- H04L 45/22: {Alternate routing}
- H04L 45/247: using M:N active or standby paths
- H04L 45/655: Interaction between route computation entities and forwarding entities, e.g. for route determination or for flow table update
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

This application discloses a link fault handling method, a related apparatus, a storage medium, and a program product, and belongs to the field of communication technologies. In this method, a forwarding plane component of a network device updates a reference state table in time by actively polling a port status register, so that when forwarding a data flow, the forwarding plane component can sense a local faulty link in time based on the reference state table, and perform link switching in time, and a PHY chip does not need to report fault information to a control plane CPU in the network device, or wait for the control plane CPU to deliver an instruction. That is, this solution does not depend on control plane path computation, and does not require additional communication from a data plane to a control plane, to avoid a delay caused by fault handling of the CPU.

## Claims

### Claim 1

A link fault handling method, wherein the method is applied to a network device; the network device comprises a forwarding plane circuit, a port status register, and a plurality of ports, and the port status register is configured to store a port state of each of the plurality of ports; and the method comprises:
maintaining, by the forwarding plane circuit, a reference state table by polling the port status register, wherein the reference state table indicates whether a plurality of links on which the plurality of ports are respectively located are faulty;
querying, by the forwarding plane circuit, a forwarding table and the reference state table based on a to-be-forwarded data flow, to determine whether a link used for transmitting the data flow is a faulty link;
when determining that the link used for transmitting the data flow is the faulty link, determining, by the forwarding plane circuit, an alternative link of the faulty link; and
updating, by the forwarding plane circuit, the forwarding table based on the alternative link, to switch the data flow to the alternative link.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the reference state table comprises a link state table, and the link state table is used for recording a link state of each of the plurality of links; and
the maintaining, by the forwarding plane circuit, a reference state table by polling the port status register comprises:
polling, by the forwarding plane circuit, the port status register, to determine whether a port that has a state change exists in the plurality of ports, wherein the state change comprises a change from an available state to an unavailable state; and
when determining that the port that has the state change exists in the plurality of ports, changing, by the forwarding plane circuit, a first link state in the link state table to a faulty state, wherein the first link state is a state of a link on which the port that has the state change is located.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the link state table records a correspondence between link indexes and link states of the plurality of links; and
before the changing, by the forwarding plane circuit, a first link state in the link state table to a faulty state, the method further comprises:
querying, by the forwarding plane circuit, a port and link index mapping table for a link index corresponding to a first port index, to obtain a first link index, wherein the first port index is an index of the port that has the state change; and
querying, by the forwarding plane circuit, the link state table for a link state corresponding to the first link index, to obtain the first link state.

### Claim 4 (depends on 2)

The method according to claim 2, wherein the querying, by the forwarding plane circuit, a forwarding table and the reference state table based on a to-be-forwarded data flow, to determine whether a link used for transmitting the data flow is a faulty link comprises:
querying, by the forwarding plane circuit, the forwarding table for an egress port corresponding to the data flow;
querying, by the forwarding plane circuit, the link state table for a link state of a link on which the egress port is located; and
when the link state of the link on which the egress port is located is a faulty state, determining, by the forwarding plane circuit, that the link used for transmitting the data flow is the faulty link.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the forwarding plane circuit queries, through a fast reroute mechanism, the link state table for the link state of the link on which the egress port is located.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the reference state table comprises a port state table, and the port state table is used for recording the port state of each of the plurality of ports; and
the maintaining, by the forwarding plane circuit, a reference state table by polling the port status register comprises:
polling, by the forwarding plane circuit, the port status register, to determine whether a port that has a state change exists in the plurality of ports, wherein the state change comprises a change from an available state to an unavailable state; and
when determining that the port that has the state change exists in the plurality of ports, changing, by the forwarding plane circuit, a first port state in the port state table to an unavailable state, wherein the first port state is a state of the port that has the state change.

### Claim 7 (depends on 6)

The method according to claim 6, wherein the port state table records a correspondence between port indexes and port states of the plurality of ports; and
before the changing, by the forwarding plane circuit, a first port state in the port state table to an unavailable state, the method further comprises:
querying, by the forwarding plane circuit, the port state table for a port state corresponding to a first port index, to obtain the first port state, wherein the first port index is an index of the port that has the state change.

### Claim 8 (depends on 6)

The method according to claim 6, wherein the querying, by the forwarding plane circuit, a forwarding table and the reference state table based on a to-be-forwarded data flow, to determine whether a link used for transmitting the data flow is a faulty link comprises:
querying, by the forwarding plane circuit, the forwarding table for an egress port corresponding to the data flow;
querying, by the forwarding plane circuit, the port state table for a port state of the egress port; and
when the port state of the egress port is an unavailable state, determining, by the forwarding plane circuit, that the link used for transmitting the data flow is the faulty link.

### Claim 9 (depends on 1)

The method according to claim 1, wherein the determining, by the forwarding plane circuit, an alternative link of the faulty link comprises:
obtaining, by the forwarding plane circuit, a standby link corresponding to the faulty link from a correspondence between active and standby links through the fast reroute mechanism to serve as the alternative link.

### Claim 10 (depends on 1)

The method according to claim 1, wherein the determining, by the forwarding plane circuit, an alternative link of the faulty link comprises:
determining, by the forwarding plane circuit, the alternative link from a plurality of equal-cost links of the faulty link by using a hash algorithm.

### Claim 11 (depends on 1)

The method according to claim 1, wherein the forwarding plane circuit polls the port status register through a sub-millisecond-level polling mechanism.

### Claim 12 (depends on 1)

The method according to claim 1, wherein the network device further comprises a physical PHY chip, the plurality of ports are ports of the PHY chip, the port status register is a register in the PHY chip, and a value of the port status register is changed by the PHY chip when the PHY chip detects that a faulty port exists in the plurality of ports.

### Claim 13 (depends on 1)

The method according to claim 1, wherein the forwarding plane circuit is a programmable logic device.

### Claim 14

A link fault handling apparatus, wherein the apparatus comprises a forwarding plane circuit, a port status register, and a plurality of ports, and the port status register is configured to store a port state of each of the plurality of ports; and the forwarding plane circuit is configured to:
maintain, a reference state table by polling the port status register, wherein the reference state table indicates whether a plurality of links on which the plurality of ports are respectively located are faulty;
query, a forwarding table and the reference state table based on a to-be-forwarded data flow, to determine whether a link used for transmitting the data flow is a faulty link;
when determining that the link used for transmitting the data flow is the faulty link, determine, an alternative link of the faulty link; and
update, the forwarding table based on the alternative link, to switch the data flow to the alternative link.

### Claim 15 (depends on 14)

The apparatus according to claim 14, wherein the reference state table comprises a link state table, and the link state table is used for recording a link state of each of the plurality of links; and
the maintain, a reference state table by polling the port status register comprises:
poll, the port status register, to determine whether a port that has a state change exists in the plurality of ports, wherein the state change comprises a change from an available state to an unavailable state; and
when determining that the port that has the state change exists in the plurality of ports, change, a first link state in the link state table to a faulty state, wherein the first link state is a state of a link on which the port that has the state change is located.

### Claim 16 (depends on 15)

The apparatus according to claim 15, wherein the link state table records a correspondence between link indexes and link states of the plurality of links; and
before the change, a first link state in the link state table to a faulty state, the forwarding plane circuit is further configured to:
query, a port and link index mapping table for a link index corresponding to a first port index, to obtain a first link index, wherein the first port index is an index of the port that has the state change; and
query, the link state table for a link state corresponding to the first link index, to obtain the first link state.

### Claim 17 (depends on 15)

The apparatus according to claim 15, wherein the query, a forwarding table and the reference state table based on a to-be-forwarded data flow, to determine whether a link used for transmitting the data flow is a faulty link comprises:
query, the forwarding table for an egress port corresponding to the data flow;
query, the link state table for a link state of a link on which the egress port is located; and
when the link state of the link on which the egress port is located is a faulty state, determine, that the link used for transmitting the data flow is the faulty link.

### Claim 18 (depends on 17)

The apparatus according to claim 17, wherein the forwarding plane circuit queries, through a fast reroute mechanism, the link state table for the link state of the link on which the egress port is located.

### Claim 19 (depends on 14)

The apparatus according to claim 14, wherein the reference state table comprises a port state table, and the port state table is used for recording the port state of each of the plurality of ports; and
the maintain, a reference state table by polling the port status register comprises:
poll, the port status register, to determine whether a port that has a state change exists in the plurality of ports, wherein the state change comprises a change from an available state to an unavailable state; and
when determining that the port that has the state change exists in the plurality of ports, change, a first port state in the port state table to an unavailable state, wherein the first port state is a state of the port that has the state change.

### Claim 20 (depends on 19)

The apparatus according to claim 19, wherein the port state table records a correspondence between port indexes and port states of the plurality of ports; and
before the change, a first port state in the port state table to an unavailable state, the method further comprises:
query, the port state table for a port state corresponding to a first port index, to obtain the first port state, wherein the first port index is an index of the port that has the state change.
