WO2023231912A1 - 链路故障处理方法、相关装置、存储介质及程序产品 - Google Patents

链路故障处理方法、相关装置、存储介质及程序产品 Download PDF

Info

Publication number
WO2023231912A1
WO2023231912A1 PCT/CN2023/096491 CN2023096491W WO2023231912A1 WO 2023231912 A1 WO2023231912 A1 WO 2023231912A1 CN 2023096491 W CN2023096491 W CN 2023096491W WO 2023231912 A1 WO2023231912 A1 WO 2023231912A1
Authority
WO
WIPO (PCT)
Prior art keywords
link
port
status
forwarding plane
plane component
Prior art date
Application number
PCT/CN2023/096491
Other languages
English (en)
French (fr)
Inventor
李灵
刘世兴
冀智刚
李�杰
温华锋
王海波
王松林
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023231912A1 publication Critical patent/WO2023231912A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • H04L45/247Multipath using M:N active or standby paths
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/645Splitting route computation layer and forwarding layer, e.g. routing according to path computational element [PCE] or based on OpenFlow functionality
    • H04L45/655Interaction between route computation entities and forwarding entities, e.g. for route determination or for flow table update

Definitions

  • the present application relates to the field of communication technology, and in particular to a link fault processing method, related devices, storage media and program products.
  • Network equipment includes physical layer (PHY) chips, forwarding plane components, and central processing unit (CPU).
  • the PHY chip has multiple ports, and the forwarding surface component stores the forwarding table and link status table required for forwarding data flows.
  • a port of the network device After receiving the data stream sent by the previous hop network device, a port of the network device transmits the received data stream to the forwarding plane component.
  • the forwarding plane component determines the egress port corresponding to the data flow by querying the forwarding table, and then queries the link status of the link where the egress port is located in the link status table.
  • the forwarding plane component determines the replacement link for the faulty link and adds the corresponding data flow in the forwarding table to the faulty link.
  • the egress port of is modified to the egress port corresponding to the replacement link.
  • the forwarding surface component sends the data flow according to the modified forwarding table. To put it simply, when a network device forwards data flows, it must determine whether to perform link switching based on the link state table.
  • the link status table is updated after a port failure occurs. That is, if a port fails, the PHY chip sends a hardware interrupt signal to the CPU, that is, reports the fault information.
  • the hardware interrupt signal is used to indicate the port failure.
  • the CPU issues an instruction to the forwarding plane component to instruct the link status table to be updated.
  • the forwarding plane component changes the status of the link where the port is located in the link status table to the fault status.
  • Embodiments of the present application provide a link failure processing method, related devices, storage media and program products, which can shorten the time from the occurrence of a link failure to the completion of link switching, thereby reducing the impact of the link failure on the business.
  • a link fault handling method is provided, which is applied to a network device.
  • the network device includes a forwarding plane component, a port status register and multiple ports.
  • the method includes:
  • the forwarding plane component of the network device maintains a reference status table by polling the port status register.
  • the reference status table is used to indicate whether the multiple links where the multiple ports are located are faulty; the forwarding plane component queries based on the data flow to be forwarded. Forwarding table and reference status table to determine whether the link used to transmit the data flow is a faulty link; if it is determined that the link used to transmit the data flow is a faulty link, the forwarding plane component determines the faulty link The replacement link of the link; the forwarding plane component updates the forwarding table based on the replacement link to switch the data flow to the replacement link.
  • the forwarding plane component updates the reference status table in a timely manner by actively polling the port status register, so that when forwarding data flows, it can promptly sense the local faulty link based on the reference status table and perform link switching in a timely manner.
  • the PHY chip does not rely on control plane path calculation and does not require additional communication from the data plane to the control plane, thus avoiding delays caused by CPU processing failures.
  • This solution takes less time from the occurrence of a link failure to the completion of the link switch, and the link failure processing converges faster, thereby reducing the impact of the link failure on the business.
  • the network device also includes a PHY chip.
  • the multiple ports are ports of the PHY chip.
  • the port status register is a register in the PHY chip. The value of the port status register is determined by the PHY chip when it detects that there is a faulty port among the multiple ports. Modify below.
  • the reference status table includes a link status table, and the link status table is used to record the link status of each link in the multiple links.
  • the forwarding plane component maintains the reference status table by polling the port status register, including: the forwarding plane component polls the port status register to determine whether there is a port with a status change among the multiple ports.
  • the status change includes a port from an available port. The status becomes unavailable; when it is determined that there is a port whose status has changed among the multiple ports, the forwarding plane component modifies the first link status in the link status table to the fault status, and the first link status is The status of the link where the port whose status changes occurs.
  • the link state table records the corresponding relationship between the link index and the link state of the multiple links; before the forwarding plane component modifies the first link state in the link state table to the fault state, it also includes: : The forwarding plane component queries the link index corresponding to the first port index from the index mapping table of ports and links to obtain the first link index.
  • the first port index is the index of the port where the status change occurs; the forwarding plane component Query the link status corresponding to the first link index from the link status table to obtain the first link status.
  • the forwarding plane component queries the forwarding table and the reference state table based on the data flow to be forwarded to determine whether the link used to transmit the data flow is a faulty link, including : The forwarding plane component queries the outbound port corresponding to the data flow from the forwarding table; the forwarding plane component queries the link status of the link where the outbound port is located from the link status table; the link status of the link where the outbound port is located is In the case of a fault state, the forwarding plane component determines that the link used to transmit the data flow is a faulty link.
  • the forwarding plane component queries the link status of the link where the outgoing port is located from the link status table through a fast reroute (FRR) component.
  • FRR fast reroute
  • the FRR component is used to implement the FRR mechanism.
  • the reference status table includes a port status table, which is used to record the port status of each port in the plurality of ports.
  • the forwarding plane component maintains the reference status table by polling the port status register, including: the forwarding plane component polls the port status register to determine whether there is a port with a status change among the multiple ports.
  • the status change includes a port from an available port. The status becomes unavailable; when it is determined that there is a port whose status has changed among the multiple ports, the forwarding plane component modifies the first port status in the port status table to the unavailable status, and the first port status is the occurrence status. Changed port status.
  • the port status table records the corresponding relationship between the port indexes and port status of the multiple ports; the forwarding plane component Before modifying the first port status in the port status table to the unavailable status, the method further includes: querying the port status corresponding to the first port index from the port status table to obtain the first port status and the first port index. The index of the port where the status change occurred.
  • the forwarding plane component queries the forwarding table and the reference state table based on the data flow to be forwarded to determine whether the link used to transmit the data flow is a faulty link, including: The forwarding plane component queries the outbound port corresponding to the data flow from the forwarding table; the forwarding plane component queries the port status of the outbound port from the port status table; when the port status of the outbound port is unavailable, the forwarding plane component The link used to transmit the data flow is determined to be a faulty link.
  • one implementation method for the forwarding plane component to determine the replacement link of the faulty link is: the forwarding plane component obtains the backup link corresponding to the faulty link from the primary and backup link correspondence through the fast rerouting mechanism. as a replacement link. In this way, there is no need to recalculate the path and the active/standby switchover can be quickly performed.
  • the forwarding plane component determines the replacement link from multiple equal-cost paths of the faulty link through a hash algorithm. That is, multiple equal-cost paths are predetermined to achieve fast rerouting through a hash algorithm without the need to recalculate the path based on the network topology. For example, there is no need to recalculate the path based on the network topology through the open shortest path first (OSPF) algorithm. Compute links. This can also shorten the convergence time of link failure processing as much as possible.
  • OSPF open shortest path first
  • the forwarding plane component polls the port status register through a sub-millisecond polling mechanism. This enables sub-millisecond path switching in case of link failure.
  • the forwarding surface component is a programmable logic device.
  • this solution can be implemented by correspondingly modifying the relevant logic of link failure handling on the existing forwarding plane components.
  • a link fault processing device in a second aspect, has the function of realizing the behavior of the link fault processing method in the above first aspect.
  • the link fault processing device includes one or more modules, and the one or more modules are used to implement the link fault processing method provided in the first aspect.
  • a link fault handling device which device is applied to the forwarding plane component of a network device.
  • the network device also includes multiple ports and port status registers.
  • the device includes:
  • the polling module is used to maintain a reference status table by polling the port status register.
  • the reference status table is used to indicate whether multiple links where the multiple ports are located are faulty;
  • the table lookup module is used to query the forwarding table and the reference status table according to the data flow to be forwarded to determine whether the link used to transmit the data flow is a faulty link;
  • a determining module configured to determine a replacement link for the failed link when it is determined that the link used to transmit the data flow is a failed link;
  • a link switching module is configured to update the forwarding table based on the replacement link to switch the data flow to the replacement link.
  • the reference status table includes a link status table, which is used to record the link status of each link in the multiple links;
  • Polling module including:
  • the first polling submodule is used to poll the port status register to determine whether there is a port in the multiple ports that has a status change.
  • the status change includes changing from an available state to an unavailable state;
  • the second update submodule is configured to update the link when it is determined that there is a port whose status has changed among the multiple ports.
  • the first link status in the status table is modified to the fault status, and the first link status is the status of the link where the port whose status changes occurs.
  • the link state table records the correspondence between the link indexes and link states of the multiple links
  • the polling module also includes:
  • the first query submodule is used to query the link index corresponding to the first port index from the index mapping table of ports and links to obtain the first link index.
  • the first port index is the index of the port where the status change occurs. ;
  • the second query submodule is used to query the link status corresponding to the first link index from the link status table to obtain the first link status.
  • the table lookup module includes:
  • the third query sub-module is used to query the outbound port corresponding to the data flow from the forwarding table
  • the fourth query submodule is used to query the link status of the link where the outgoing port is located from the link status table;
  • the first determination sub-module is used to determine that the link used to transmit the data flow is a faulty link when the link status of the link where the egress port is located is a faulty state.
  • the forwarding plane component queries the link status of the link where the port is located from the link status table through the fast rerouting mechanism.
  • the reference status table includes a port status table, which is used to record the port status of each port in the plurality of ports;
  • Polling modules include:
  • the second polling submodule is used to poll the port status register to determine whether there is a port in the multiple ports that has a status change.
  • the status change includes changing from an available state to an unavailable state;
  • the second update submodule is configured to modify the first port status in the port status table to an unavailable state when it is determined that there is a port with a status change among the multiple ports.
  • the first port status is a status change.
  • the port status table records the corresponding relationship between the port indexes and port status of the multiple ports
  • the polling module also includes:
  • the fifth query submodule is used to query the port status corresponding to the first port index from the port status table to obtain the first port status.
  • the first port index is the index of the port where the status change occurs.
  • the table lookup module includes:
  • the sixth query submodule is used to query the egress port corresponding to the data flow from the forwarding table
  • the seventh query submodule is used to query the port status of the outgoing port from the port status table
  • the second determination sub-module is configured to determine that the link used to transmit the data flow is a faulty link when the port status of the outgoing port is in an unavailable state.
  • the determination module includes:
  • the acquisition submodule is used to obtain the backup link corresponding to the faulty link as a replacement link from the correspondence between the main and backup links through the fast rerouting mechanism.
  • the determination module includes:
  • the third determination submodule is used to determine a replacement link from multiple equal-cost links of the faulty link through a hash algorithm.
  • the forwarding plane component polls the port status register through a sub-millisecond polling mechanism.
  • the network device also includes a PHY chip, the multiple ports are ports of the PHY chip, the port status register is a register in the PHY chip, and the value of the port status register is determined by the PHY chip when it detects that the multiple ports exist. Modify in case of faulty port.
  • the forwarding surface component is a programmable logic device.
  • a network device which includes a forwarding plane component, a port status register, and multiple ports.
  • the network device is used to implement the steps of the link fault handling method provided in the first aspect through the forwarding plane component.
  • a network device in a fourth aspect, includes a forwarding plane component and a memory.
  • the memory is used to store a program for executing the link fault handling method provided in the first aspect, and to store a program for implementing the above. Data involved in the link fault handling method provided in the first aspect.
  • the forwarding surface component is configured to execute a program stored in the memory.
  • the network device may further include a communication bus, which is used to establish a connection between the forwarding plane component and the memory.
  • a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium. When the instructions are run on a network device, the network device causes the network device to execute the link described in the first aspect. Troubleshooting methods.
  • a computer program product containing instructions is provided.
  • the network device causes the network device to execute the link fault handling method described in the first aspect.
  • This solution does not require the PHY chip to report fault information to the CPU of the control plane in the network device, nor does it need to wait for the CPU of the control plane to issue instructions.
  • the forwarding plane component of the network device updates the reference state table in a timely manner by actively polling the port status register, so that when forwarding data flows, it can promptly sense the local faulty link based on the reference state table and perform link switching in a timely manner.
  • the reference status table is used to indicate whether multiple links on which multiple ports of the network device are respectively located are faulty. That is, this solution does not rely on control plane path calculation and does not require additional communication from the data plane to the control plane, thus avoiding delays caused by CPU processing failures. This solution takes less time from the occurrence of a link failure to the completion of link switching. The convergence speed of link failure processing is faster and more stable. The impact of link failures on services is smaller, which greatly improves the reliability of the network.
  • Figure 1 is a schematic diagram of a multi-level switching architecture in a data center scenario provided by an embodiment of the present application
  • Figure 2 is a flow chart of a link fault handling method provided by an embodiment of the present application.
  • Figure 3 is a flow chart of another link fault handling method provided by an embodiment of the present application.
  • Figure 4 is a schematic diagram of yet another link fault handling method provided by an embodiment of the present application.
  • Figure 5 is the key points of the solution involved in the link fault handling method provided by the embodiment of this application.
  • Figure 6 is a schematic structural diagram of a link fault processing device provided by an embodiment of the present application.
  • Figure 7 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • Figure 8 is a schematic structural diagram of another network device provided by an embodiment of the present application.
  • FIG. 1 is a schematic diagram of a multi-level switching architecture in a data center scenario provided by an embodiment of the present application.
  • the multi-level switching architecture is such as the close architecture.
  • Figure 1 shows the three devices in the multi-level switching architecture, namely user equipment, top of rack (ToR) switches and spine switches.
  • the user equipment is such as the server at the sending end, the server at the receiving end, etc.
  • ToR switches are leaf switches, located on the access side and used to connect user equipment to the data center.
  • the spine switch is located at the aggregation layer and connected to the ToR switch.
  • the business traffic between the sending server and the receiving server needs to pass through the ToR switch and the spine switch.
  • the link fault handling method provided by the embodiment of this application can be applied to ToR switches and spine switches.
  • the above-mentioned network device can be a switch, a router, or any other device with a forwarding function.
  • Network equipment includes forwarding plane components, port status registers, multiple ports, and control plane CPUs.
  • the link fault handling method provided by the embodiment of the present application is applied to the forwarding plane component of the network device without going through the CPU of the control plane.
  • the forwarding surface component may also be called a forwarding device.
  • the network device also includes a PHY chip.
  • the multiple ports in the network device are ports of the PHY chip, and the port status register is a register in the PHY chip.
  • the port status register is used to store the port status of each port in the multiple ports.
  • the form of network equipment can be box type, frame type, etc.
  • the forwarding plane component of the box-type network device and the CPU of the control plane can be on the same single board (board).
  • the forwarding plane component is used to handle the link failure problem caused by the failure of each port of the network device.
  • Boxed network equipment may include a PHY chip.
  • the frame network equipment includes a main control board and at least one interface board.
  • Each interface board includes a PHY chip and a forwarding plane component. Multiple ports included in the network equipment are distributed on the at least one PHY chip.
  • Each PHY chip includes port status. Register, each PHY chip stores the status of each port it includes through its own port status register.
  • the main control board of a modular network device includes the CPU on the control plane. This solution can be applied to the forwarding plane components in each interface board to handle the link failure problem caused by the port failure on the corresponding interface board through the forwarding plane components.
  • Figure 2 is a flow chart of a link fault handling method provided by an embodiment of the present application. The method is applied to a network device.
  • the network device includes a forwarding plane component, a port status register, and multiple ports.
  • the box-type network device introduced above is taken as an example for introduction. Please refer to Figure 2.
  • the method includes the following steps.
  • Step 201 The forwarding plane component of the network device maintains a reference status table by polling the port status register.
  • the reference status table is used to indicate whether multiple links where multiple ports of the network device are located are faulty.
  • the reference state table is stored in the forwarding plane component, and the forwarding plane component determines whether to perform link switching by querying the reference state table when forwarding data flows.
  • the reference state table may include a link state table (LST) or a port state table (PST).
  • LST is used to record the link status of each link in the multiple links, and the link status is used to indicate whether the corresponding link is faulty.
  • PST is used to record the port status of each port among the multiple ports.
  • the port status is used to indicate whether the corresponding port is available, that is, whether it is faulty.
  • one port corresponds to one link, and different ports correspond to different links.
  • the port status of each port can also be used to indicate whether the link where the corresponding port is located is faulty.
  • the forwarding plane component maintains the reference state table by polling the port status register.
  • the forwarding plane component polls the port status register to determine whether there is a port whose status has changed among the multiple ports. When it is determined that there is a port whose status has changed among the multiple ports, the forwarding plane component modifies the first link status in the LST to the fault status, and the first link status is the status of the link where the port whose status changes occurs. .
  • the port status of each port is an available state or an unavailable state, and the state change includes changing from an available state to an unavailable state.
  • the forwarding plane component polls the port status register, and compares the register value polled this time with the register value polled last time to determine whether there is a port whose status has changed among the multiple ports.
  • the port status register includes a plurality of bits, the plurality of bits respectively correspond to multiple ports of the network device, and the value of each bit is used to indicate the port status of the corresponding port.
  • the value of each bit can be a first value or a second value, the first value represents an available state, and the second value represents an unavailable state.
  • the forwarding plane component determines that the port corresponding to the first bit is the The port whose status changed. If the value of the first bit polled this time is the same as the value of the first bit polled last time, the forwarding plane component determines that the port corresponding to the first bit is a port whose status has not changed.
  • the first value and the second value can be '1' and '0' respectively, and the first value and the second value can also be '0' and '1' respectively.
  • the LST records the correspondence between link indexes and link states of the multiple links, and the network device also stores an index mapping table of ports and links. Based on this, the forwarding plane component polls the port status register. When it is found that there is a port whose status has changed among the multiple ports, the forwarding plane component queries the index corresponding to the first port index from the index mapping table of ports and links. link index to get the first link index. The first port index is the index of the port where the status change occurs. The forwarding plane component queries the link status corresponding to the first link index from the LST to obtain the first link status. The link indexed by the first link index is the link where the port where the status change occurs is located.
  • the serial number of each bit in the port status register is the port index of the corresponding port.
  • the port index of the port corresponding to the i-th bit in the port status register is 'i'.
  • the forwarding plane component polls multiple bits of the port status register, determines the bit sequence corresponding to the port whose status changes among the multiple ports, and uses the sequence number as the first port index.
  • the port status register is a 32-bit register, that is, there are 32 bits in total.
  • the network device includes 16 ports, and the 16 bits in the port status register are used to store the port status of the multiple ports. These 16 bits The bit numbers are 1, 2, 3,...,16.
  • the forwarding plane component polls these 16 bits and determines that the bit number corresponding to the port where the status change occurs among the 16 ports is 3, that is, the port corresponding to the 3rd bit is the port where the status change occurs. port, the forwarding plane component uses 3 as the first port index.
  • the network device also stores the corresponding relationship between the serial number of each bit in the port status register and the port identifier of the corresponding port, and the corresponding relationship between the port identifiers of the multiple ports and the port index.
  • the forwarding plane component polls multiple bits of the port status register to determine the bit sequence corresponding to the port whose status changes among the multiple ports. From the sequence number of each bit in the port status register and the port identification of the corresponding port, In the corresponding relationship, the port identifier corresponding to the sequence number is determined to obtain the first port identifier.
  • the first port identifier is the port identifier of the port where the status change occurs.
  • the forwarding plane component queries the port index corresponding to the first port identifier from the corresponding relationship between the port identifiers and the port indexes of the multiple ports to obtain the first port index.
  • the serial numbers of the multiple bits in the port status register are 1, 2,...,18, and the port identifiers corresponding to these serial numbers are Pa01, Pa02, Pc03,..., Ph05, and the 18 port identifiers correspond to The corresponding port indexes are 0, 1, 2,...,17.
  • the forwarding plane component determines that the bit sequence number corresponding to the port where the status change occurs is 3, and then determines that the port identifier corresponding to sequence number 3 is Pc03 from the correspondence between the sequence number and the port identifier, that is, the first port identifier is Pc03.
  • the forwarding plane component determines from the corresponding relationship between the port identifier and the port index that the port index corresponding to the port identifier Pc03 is 2, that is, the first port index is 2.
  • the link status of each link recorded by the LST is 'up' or 'down', where 'up' represents the normal state, that is, the fault-free state, and 'down' represents the fault state.
  • the link status is '1' or '0', where '1' indicates normal status and '0' indicates fault status.
  • link status can be expressed in other ways.
  • the forwarding plane component polls the port status register to determine whether any of the multiple ports has a port whose status has changed, where the status change includes changing from an available state to an unavailable state.
  • the forwarding plane component modifies the first port status in the PST to an unavailable status, and the first port status is the status of the port whose status has changed.
  • the port status table records the corresponding relationship between the port indexes and port status of the multiple ports. Based on this, before modifying the first port status in the PST to the unavailable status, the forwarding plane component queries the port status corresponding to the first port index from the PST to obtain the first port status.
  • the first port index is the index of the port where the status change occurs.
  • the port status of each port recorded by the PST is ‘up’ or ‘down’, where ‘up’ indicates an available status and ‘down’ indicates an unavailable status.
  • the port status is '1' or '0', where '1' indicates the available status and '0' indicates the unavailable status.
  • port status can be expressed in other ways.
  • the forwarding plane component can poll the port status register through a sub-millisecond polling mechanism.
  • the forwarding plane component polls according to a sub-millisecond polling cycle.
  • Port status register The polling period is less than 1 millisecond.
  • the polling period is 100 microseconds or 200 microseconds, etc.
  • the embodiment of the present application uses a sub-millisecond polling mechanism to achieve sub-millisecond link fault processing speed.
  • the forwarding plane component maintains the reference status table by polling the port status register, that is, updating the reference status table in a timely manner through the wheel core port status register, thereby ensuring the real-time and accuracy of the reference status table. sex.
  • the network device also includes a PHY chip.
  • the multiple ports are ports of the PHY chip.
  • the port status register is a register in the PHY chip. The value of the port status register is determined by the PHY chip when it detects that there is a faulty port among the multiple ports. Modify below.
  • the first port in the PHY chip fails, the first port generates a hardware interrupt signal, so that the PHY chip modifies the value of the bit corresponding to the first port in the port status register based on the hardware interrupt signal.
  • the value of the bit corresponding to the first port is modified from '1' to '0'.
  • ‘1’ represents the fault-free state, that is, the available state
  • ‘0’ represents the fault state, that is, the unavailable state.
  • the hardware interrupt signal can carry the identification of the first port.
  • the PHY chip obtains the identification of the first port from the hardware terminal signal and modifies the corresponding bit in the port register according to the sequence number of the bit corresponding to the identification of the first port. value.
  • Step 202 The forwarding plane component queries the forwarding table and the reference status table according to the data flow to be forwarded to determine whether the link used to transmit the data flow is a faulty link.
  • the network device also stores a forwarding table. After obtaining the data flow to be forwarded, the forwarding plane component sequentially queries the forwarding table and the reference status table to determine whether the link used to transmit the data flow is a faulty link.
  • the forwarding plane component queries the forwarding table for the egress port corresponding to the data flow. Then, the forwarding plane component queries the link status of the link where the outgoing port is located from the LST. When the link status of the link where the outbound port is located is in a faulty state, the forwarding plane component determines that the link used to transmit the data flow is the faulty link.
  • the forwarding plane component queries the link status of the link where the outgoing port is located from the LST through the FRR component. Subsequent forwarding plane components can quickly perform active and backup link switching through the FRR component. That is, the network device is configured with an FRR component that supports the FRR mechanism, and the forwarding plane component queries the LST through the FRR component.
  • the LST records the corresponding relationship between the link index and the link status of the multiple links
  • the forwarding table records the corresponding relationship between the data flow information and the outgoing port index
  • the network device also stores the index mapping table of ports and links.
  • the forwarding plane component determines the data flow information to be forwarded, queries the entry corresponding to the data flow information in the forwarding table, and obtains the egress port index in the entry. Then, the forwarding plane component queries the link index corresponding to the outgoing port index from the index mapping table of ports and links to obtain the link index of the link where the outgoing port is located.
  • the forwarding plane component queries the link status corresponding to the link index of the link where the outbound port is located from the LST to obtain the link status of the link where the outbound port is located.
  • the forwarding plane component queries the outbound port corresponding to the data flow from the forwarding table, and the forwarding plane component queries the port status of the outbound port from the PST. When the port status of the outbound port is unavailable, the forwarding plane component determines that the link used to transmit the data flow is a faulty link.
  • the PST records the corresponding relationship between the port indexes of the multiple ports and the port status, and the corresponding relationship between the forwarding table data flow information and the outgoing port index. Based on this, the forwarding plane component determines the data flow information to be forwarded, queries the entry corresponding to the data flow information in the forwarding table, and obtains the egress port index in the entry. Then, the forwarding plane queries the port status corresponding to the egress port index from the PST to obtain the port status of the egress port.
  • the data flow information in the forwarding table may include quintuple information of the data flow, and may also include other information.
  • the forwarding table can also record next-hop routing information.
  • the next-hop routing information can include information about the next-hop network device and/or the ingress port of the next-hop network device.
  • Information, the forwarding table may also record other information, which is not limited in the embodiments of this application.
  • Step 203 When it is determined that the link used to transmit the data flow is a faulty link, the forwarding plane component determines a replacement link for the faulty link.
  • the forwarding plane component Automatically determine the replacement link for the faulty link, without reporting fault information to the CPU on the control plane, and without the need for the control plane to calculate paths and issue path replacement instructions.
  • the forwarding plane component obtains the backup link corresponding to the faulty link as the replacement link from the correspondence between the primary and backup links. It should be understood that the network device stores the corresponding relationship between the active and standby links.
  • the forwarding plane component obtains the backup link corresponding to the faulty link as a replacement link from the correspondence between the primary and backup links through the FRR component.
  • any primary link and the corresponding backup link recorded in the primary and backup link correspondences are equal-cost paths.
  • Equal-cost paths are determined according to the equal-cost multi-path (ECMP) policy.
  • the data flow flowing through network device A is sent to the same destination. Assume that the destination is network device B. According to the ECMP policy, three equal-cost paths from network device A to network device B are calculated. These 3 equal-cost paths are calculated. The equal-cost paths include link 1, link 2, and link 3 respectively. Then, in some embodiments, link 2 can be used as the backup link of link 1, link 2 can be used as the backup link of link 3, and link 1 can be used as the backup link of link 3.
  • the corresponding relationships between the main and backup links stored in network device A include ⁇ [Main: link 1, backup: link 2], [Main: link 2, backup: link 3], [Main: link 3, backup: link 3] :link1] ⁇ .
  • Each data flow flowing through network device A and destined for network device B can be load-balanced among these three equal-cost paths.
  • the network device performs a hash operation on the flow information of data flow a through a hash algorithm.
  • the hash value obtained is 10.
  • the remainder of 10 divided by 3 is calculated and the remainder is 1.
  • the network device passes data flow a through the chain. Send via route 1.
  • the network device also calculates data flow b according to the above method, and the resulting remainder is 2, then the network device sends data flow b through link 2. If port 1 of the network device fails, causing link 1 where port 1 is located to fail, the network device determines that link 1's replacement link is link 2.
  • the forwarding plane component determines the replacement link from multiple equal-cost paths of the faulty link through a hash algorithm.
  • the multiple equal-cost paths are determined according to the ECMP policy. It should be understood that multiple equal-cost paths are predetermined to achieve fast rerouting through a hash algorithm without the need to recalculate the path based on the network topology. For example, there is no need to recalculate links through the OSPF algorithm based on the network topology. This can also shorten the convergence time of link failure processing as much as possible.
  • the three equal-cost paths determined by the network device according to the ECMP policy include link 1, link 2, and link 3 respectively.
  • link 1 is a faulty link
  • the network device calculates the path through the hash algorithm. Find the remainder corresponding to the data stream originally to be sent through link 1, and add the remainder to the preset value to obtain the target value.
  • the network device calculates the remainder of the target value divided by 3, and uses the link corresponding to the remainder as the replacement link.
  • the default value is any integer not divisible by 3. Assume that link 1 fails, the remainder corresponding to the data flow originally sent through link 1 is 1, and the default value is 2, then the network device determines that the replacement link is link 3.
  • the network device can also determine the replacement link of the faulty link through other methods, which is not limited in the embodiments of this application.
  • Step 204 The forwarding plane component updates the forwarding table based on the replacement link to switch the data flow to the replacement link.
  • the forwarding plane component after the forwarding plane component determines the replacement link of the faulty link, it can switch the services on the faulty link to the replacement link by modifying the forwarding table, that is, the services originally intended to be transmitted through the faulty link Traffic is switched to the alternative link.
  • the forwarding table records the correspondence between the data flow information and the egress port index. Based on this, the forwarding surface component determines the data flow information of the service on the faulty link, including determining the information of the data flow to be forwarded in step 203, querying the entry corresponding to the data flow information in the forwarding table, and converting the entry in the entry
  • the egress port index is modified to the egress port corresponding to the replacement link. Port index, so that when the data flow is forwarded according to the forwarding table, the service on the faulty link is switched to the replacement link, that is, the data flow is forwarded from the egress port corresponding to the replacement link according to the modified forwarding table. Send it out.
  • the forwarding plane component When the forwarding table also records next-hop routing information, the forwarding plane component also modifies the next-hop routing information in the entry in the forwarding table to the next-hop routing information corresponding to the replacement link.
  • one port in the network device corresponds to one link, and different ports are located on different links.
  • the link in this article refers to the link between two ports of two adjacent network devices.
  • the faulty link is the link between the failed first port and a port in the next-hop network device that communicates with the first port
  • the replacement link is the non-faulty second port in the current network device and the next-hop port.
  • the egress port corresponding to the replacement link refers to the second port.
  • the next-hop routing information corresponding to the replacement link may include information about the next-hop network device, and/or information about a port in the next-hop network device that communicates with the second port.
  • the forwarding surface component of the network device is a programmable logic device.
  • this solution can be implemented by correspondingly modifying the relevant logic of link failure handling on the existing forwarding plane components.
  • the forwarding plane component performs operations on the port status table, link status table and forwarding table on the data plane. That is, the network device uses the forwarding plane component to perform operations on the local link on the data plane. Troubleshoot. Therefore, this solution is essentially a local link fault convergence solution based on the data plane.
  • Figure 3 is a flow chart of another link fault processing method provided by an embodiment of the present application.
  • the network device is configured with an ECMP policy and FRR mechanism.
  • the network device includes a forwarding plane component, and stores the corresponding relationship between the primary and backup links, LST, the index mapping table of ports and links (PL index mapping table) and the forwarding plane.
  • Publish forwarding information table, FIB.
  • Network devices also include port status registers.
  • Network equipment also includes multiple ports, and the identifiers (port identities, PIDs) of these ports are E1, E2, etc. respectively.
  • NHP1, NHP2 and NHP3 correspond to E1, E2 and E3 respectively.
  • the corresponding relationships between active and standby links include FRR1, FRR2, and FRR3.
  • FRR1 indicates the corresponding relationship in which the link where NHP1 is located is the primary link and the link where NHP2 is located is the backup link.
  • FRR2 indicates the corresponding relationship in which the link where NHP2 is located is the primary link and the link where NHP3 is located is the backup link.
  • FRR3 indicates the corresponding relationship in which the link where NHP3 is located is the primary link and the link where NHP1 is located is the backup link.
  • the link fault handling method shown in Figure 3 includes two processes.
  • the forwarding plane component of the network device maintains the LST by polling the port status register.
  • the forwarding plane component determines whether the link used to transmit the data flow is a faulty link based on the forwarding table and LST. In the case of a failed link, active/standby switchover is quickly performed through the FRR component that supports the FRR mechanism.
  • the first process includes the following steps:
  • Step 11 The forwarding plane component polls the port status register through a sub-millisecond polling mechanism.
  • Step 12 Taking the failure of E1 as an example, after polling the port status register to determine that the port status of port E1 has changed, the forwarding plane component determines the port index (P idx) of port E1, and the determined P idx is 1.
  • Step 13 The forwarding plane component queries the entry with P idx of 1 from the PL index mapping table, and obtains the link index (L idx) in the entry.
  • the obtained L idx is 2.
  • Step 14 The forwarding plane component queries the entry with L idx 2 from the LST, and changes the link status in the entry from the fault-free state (recorded as bit 1) to the fault state (recorded as bit 0).
  • the second process includes the following steps:
  • Step 21 The forwarding plane component queries the FIB according to the target data flow to be forwarded to obtain the P idx of the egress port corresponding to the target data flow.
  • Step 22 Assume that the queried P idx of the egress port is 1.
  • the forwarding plane component queries the entry with P idx 1 from the PL index mapping table and obtains the L idx in the entry.
  • Step 23 Assume that the queried L idx is 2.
  • the forwarding plane component queries the entry with L idx 2 from the LST through the FRR component and obtains the bit value indicating the link status in the entry.
  • Step 24 When the obtained bit value is 0, the forwarding plane component determines that the link with L idx 2 is a faulty link.
  • the faulty link is the link where NHP1 is located, that is, the link originally used to transmit the target data flow.
  • Step 25 The forwarding plane component uses the FRR component to obtain the backup link corresponding to the link where NHP1 is located as a replacement link from the corresponding relationship between the primary and backup links.
  • the backup link is the link where NHP2 is located, that is, the replacement link is the link where NHP2 is located.
  • Step 26 The forwarding plane component changes the egress port corresponding to the target data flow in the FIB to the egress port corresponding to NHP2, and modifies the next hop routing information to NHP2, so that when the data flow is forwarded according to the FIB, the target data flow Switch to the link where NHP2 is located.
  • the target data flow refers to the data flow that was originally intended to be sent through the link where NHP1 is located.
  • Figure 4 is a schematic diagram of yet another link fault handling method provided by an embodiment of the present application.
  • the network device stores PST, and the FRR mechanism does not need to be configured.
  • the link fault handling method shown in Figure 4 also includes two processes. In the first process, the forwarding plane component of the network device maintains the PST by polling the port status register. In the second process, the forwarding plane component determines whether the link used to transmit the data flow is a faulty link based on the forwarding table and PST when forwarding the data flow. After determining the link used to transmit a certain data flow In the case of a faulty link, a hash algorithm is used to determine the replacement link for the faulty link, and the services on the faulty link are switched to the replacement link.
  • the first process includes the following steps:
  • Step a1 The forwarding plane component polls the port status register through a sub-millisecond polling mechanism.
  • Step a2 Taking the failure of E1 as an example, after polling the port status register to determine that the port status of port E1 has changed, the forwarding plane component determines the P idx of port E1, and the determined P idx is 1.
  • Step a3 The forwarding plane component queries the entry with P idx 1 from the PST, and changes the port status in the entry from the available state (recorded as bit 1) to the unavailable state (recorded as bit 0).
  • the second process includes the following steps:
  • Step b1 The forwarding plane component queries the forwarding table according to the target data flow to be forwarded to obtain the P idx of the egress port corresponding to the target data flow.
  • Step b2 Assume that the queried P idx of the egress port is 1.
  • the forwarding plane component queries the entry with P idx 1 from the PST and obtains the port status in the entry.
  • Step b3 When the obtained port status is unavailable, the forwarding plane component determines that the link where the port with P idx is 1 is located as a faulty link.
  • the faulty link is the link where NHP1 is located.
  • the faulty link is the link determined by hash routing, that is, the link that the target data flow originally passed through.
  • the target data flow refers to the data flow that was originally intended to be sent through the link where NHP1 is located.
  • Step b4 The forwarding plane component determines that the replacement link for the link where NHP1 is located is the link where NHP3 is located from the three equal-cost paths determined based on the ECMP policy through a hash algorithm.
  • Step b5 The forwarding plane component changes the egress port corresponding to the target data flow in the FIB to the egress port corresponding to NHP3, and modifies the next hop routing information to NHP3, so that when the data flow is forwarded according to the FIB, the target data flow Switch to the link where NHP3 is located. That is, as shown in Figure 4, the replacement link is the link determined by hash rerouting.
  • FIG 5 is the key points of the solution involved in the link fault handling method provided by the embodiment of the present application.
  • the forwarding plane component includes a programmable module of the data plane.
  • this plan includes the following three key points:
  • the forwarding plane component monitors the traffic volume of multiple egress ports in real time.
  • the port status of the egress port is set to the alarm state, and the egress port is determined to be in the alarm state.
  • the traffic of the egress port that is set to alarm status must be immediately switched to the alternative link, that is, to other egress ports of the network device.
  • the forwarding plane component updates the reference status table in a timely manner by actively polling the port status register, so that when forwarding data flows, it can timely sense local faulty links based on the reference status table and perform link switching in a timely manner. That is, this solution does not rely on control plane path calculation and does not require additional communication from the data plane to the control plane, thus avoiding delays caused by CPU processing failures. This solution takes less time from sensing a link failure to completing link switching. The convergence speed of link failure processing is faster and more stable.
  • FIG 6 is a schematic structural diagram of a link fault processing device 600 provided by an embodiment of the present application.
  • the link fault processing device 600 can be implemented as part or all of a network device by software, hardware, or a combination of the two.
  • the device 600 is applied to the forwarding plane component of a network device.
  • the network device also includes multiple ports and port status registers.
  • the device 600 includes: a polling module 601, a table lookup module 602, a determination module 603 and a link switching module 604.
  • the polling module 601 is configured to maintain a reference status table by polling the port status register.
  • the reference status table is used to indicate whether multiple links where the multiple ports are located are faulty;
  • the table lookup module 602 is used to query the forwarding table and the reference status table according to the data flow to be forwarded to determine whether the link used to transmit the data flow is a faulty link;
  • Determining module 603 configured to determine a replacement link for the failed link when it is determined that the link used to transmit the data flow is a failed link;
  • the link switching module 604 is configured to update the forwarding table based on the replacement link to switch the data flow to the replacement link.
  • the reference status table includes a link status table, which is used to record the link status of each link in the multiple links;
  • Polling module 601 includes:
  • the first polling submodule is used to poll the port status register to determine whether there is a port in the multiple ports that has a status change.
  • the status change includes changing from an available state to an unavailable state;
  • the second update submodule is used to modify the first link status in the link status table to the fault status, and the first link status to the occurrence status when it is determined that there is a port with a status change among the multiple ports. The status of the link where the port is changed.
  • the link state table records the correspondence between the link indexes and link states of the multiple links
  • Polling module 601 also includes:
  • the first query submodule is used to query the link index corresponding to the first port index from the index mapping table of ports and links to obtain the first link index.
  • the first port index is the index of the port where the status change occurs. ;
  • the second query submodule is used to query the link status corresponding to the first link index from the link status table to obtain the first link status.
  • the table lookup module 602 includes:
  • the third query sub-module is used to query the outbound port corresponding to the data flow from the forwarding table
  • the fourth query submodule is used to query the link status of the link where the outgoing port is located from the link status table;
  • the first determination sub-module is used to determine that the link used to transmit the data flow is a faulty link when the link status of the link where the egress port is located is a faulty state.
  • the forwarding plane component queries the link status of the link where the port is located from the link status table through the fast rerouting mechanism.
  • the reference status table includes a port status table, which is used to record the port status of each port in the plurality of ports;
  • Polling module 601 includes:
  • the second polling submodule is used to poll the port status register to determine whether there is a port in the multiple ports that has a status change.
  • the status change includes changing from an available state to an unavailable state;
  • the second update submodule is configured to modify the first port status in the port status table to an unavailable state when it is determined that there is a port with a status change among the multiple ports.
  • the first port status is a status change.
  • the port status table records the corresponding relationship between the port indexes and port status of the multiple ports
  • Polling module 601 also includes:
  • the fifth query submodule is used to query the port status corresponding to the first port index from the port status table to obtain the first port status.
  • the first port index is the index of the port where the status change occurs.
  • the table lookup module 602 includes:
  • the sixth query submodule is used to query the egress port corresponding to the data flow from the forwarding table
  • the seventh query submodule is used to query the port status of the outgoing port from the port status table
  • the second determination sub-module is configured to determine that the link used to transmit the data flow is a faulty link when the port status of the outgoing port is in an unavailable state.
  • the determining module 603 includes:
  • the acquisition submodule is used to obtain the backup link corresponding to the faulty link as a replacement link from the correspondence between the main and backup links through the fast rerouting mechanism.
  • the determining module 603 includes:
  • the third determination submodule is used to determine a replacement link from multiple equal-cost links of the faulty link through a hash algorithm.
  • the forwarding plane component polls the port status register through a sub-millisecond polling mechanism.
  • the network device also includes a PHY chip, the multiple ports are ports of the PHY chip, the port status register is a register in the PHY chip, and the value of the port status register is determined by the PHY chip when it detects that a fault occurs in the multiple ports. Modify the port.
  • the forwarding surface component is a programmable logic device.
  • the forwarding plane component updates the reference status table in a timely manner by actively polling the port status register, so that when forwarding data flows, it can timely sense local faulty links based on the reference status table and perform link switching in a timely manner. That is, this solution does not rely on control plane path calculation and does not require additional communication from the data plane to the control plane, thus avoiding delays caused by CPU processing failures. This solution takes less time from sensing a link failure to completing link switching. The convergence speed of link failure processing is faster and more stable.
  • the link fault processing device provided in the above embodiment handles a link fault
  • the division of the above functional modules is only used as an example. In actual applications, the above functions can be allocated to different functions as needed. Module completion means dividing the internal structure of the device into different functional modules to complete all or part of the functions described above.
  • the link fault processing device and the link fault processing method embodiment provided in the above embodiments belong to the same concept. Please refer to the method embodiment for details of the specific implementation process, which will not be described again here.
  • FIG. 7 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • the network device may be any network device in the embodiments of FIG. 1 to FIG. 6 .
  • the network device 700 may be a switch, a router, or other network device with a forwarding function.
  • the network device 700 includes: a central processor 710, a forwarding plane component 711, a memory 712, and a PHY chip 713.
  • the PHY chip 713 includes a plurality of ports 7131 and a port status register 7132.
  • the central processor 710 is used to complete functions such as system management and equipment maintenance.
  • the forwarding plane component 711 is used to implement the link fault handling method provided in the embodiment of this application.
  • Memory 712 is used to store port and/or link status tables, forwarding tables, etc.
  • the PHY chip 713 is configured to modify the value of the port status register 7132 when a faulty port in the plurality of ports 7131 is detected.
  • the forwarding plane component 711 can maintain the entries in the memory 712 by polling the port status register, thereby implementing the above link fault handling method.
  • the multiple ports 7131 are used to receive and send data streams and other information.
  • the central processor 710 belongs to the control plane of the network device, and the forwarding plane component 711 and the memory 712 belong to the data plane of the network device.
  • the memory 712 is also used to store the program code for executing the solution of the present application.
  • the forwarding plane component 711 can execute the program code stored in the memory 712, prompting the network device 700 to execute the network in the embodiments shown in Figures 2 to 5.
  • the network device 700 can execute the network in the embodiments shown in Figures 2 to 5.
  • the program code may include one or more software modules.
  • the program code may include a polling module, a table lookup module, a determination module and a link switching module.
  • the polling module is used to poll the
  • the port status register is consulted to maintain a reference status table.
  • the reference status table is used to indicate whether multiple links where the multiple ports 7131 are respectively located are faulty.
  • the reference status table includes a port status table and/or a link status table.
  • the table lookup module is used to query the forwarding table and the reference status table according to the data flow to be forwarded to determine whether the link used to transmit the data flow is a faulty link.
  • the determining module is configured to determine a replacement link for the failed link when it is determined that the link used to transmit the data flow is a failed link.
  • the link switching module is configured to update the forwarding table based on the replacement link to switch the data flow to the replacement link.
  • FIG. 8 is a schematic structural diagram of another network device provided by an embodiment of the present application.
  • the network device may be any network device in the embodiments of FIG. 1 to FIG. 6 .
  • the network device 800 may be a switch, a router, or other network device that forwards packets.
  • the network device 800 includes: a main control board 810, an interface board 830 and an interface board 840.
  • a switching network board (not shown in the figure) may be included, which is used to exchange data between interface boards (interface boards are also called line cards or service boards).
  • the main control board 810 is used to perform functions such as system management, equipment maintenance, and protocol processing.
  • Interface boards 830 and 840 are used to provide various service interfaces (for example, POS interface, GE interface, ATM interface, etc.) and forward data flows.
  • the main control board 810, the interface board 830 and the interface board 840 are connected to the system backplane through a system bus to achieve intercommunication.
  • the interface board 830 includes one or more forwarding plane components 831, a memory 832, and a plurality of network interfaces 8321.
  • the forwarding plane components may include a PHY chip (not shown).
  • the plurality of network interfaces 8321 are specifically ports.
  • the plurality of network ports may be deployed on one or more PHY chips, each PHY chip also including a port status register (not shown).
  • Each PHY chip is configured to modify the value of its own port status register when detecting a port failure in at least one of its own ports.
  • the forwarding plane component 831 is used to implement the link fault handling method provided in the embodiment of this application and forward the data flow.
  • the memory 832 on the interface board 830 is used to store the port status table and/or the link status table, and the forwarding table.
  • the forwarding plane component 831 maintains relevant entries in the memory by polling the port status register, thereby implementing the above method of handling link faults. Among them, the forwarding surface component 831 forwards the data flow by searching the forwarding entries stored in the memory 832 .
  • the forwarding surface component 831 is also used to control and manage the interface board 830 and communicate with the central processor 811 on the main control board 810 .
  • the forwarding surface component 831 may be one or more integrated circuits used to implement the solution of the present application, such as an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof.
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the above-mentioned PLD is a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (GAL) or any of them combination.
  • CPLD complex programmable logic device
  • FPGA field-programmable gate array
  • GAL general array logic
  • One or more network interfaces included in the interface board 830 are used to receive data streams or other information sent by terminals or other devices in the network, and process these data streams or data information according to the instructions of the forwarding plane component 831 .
  • the specific implementation process will not be described one by one here.
  • the embodiment of the present application includes multiple interface boards and adopts a distributed forwarding mechanism.
  • the interface board 840 includes a forwarding plane component 41, a memory 42 and multiple network interfaces 843.
  • the operations on the interface board 840 are basically similar to the operations on the interface board 830, and will not be described again for the sake of simplicity.
  • the forwarding plane components 831 and/or 841 in Figure 8 may be programmable logic devices, or dedicated hardware or chips, such as network processing units. processor or application-specific integrated circuit (ASIC). This implementation method is commonly referred to as the forwarding plane using dedicated hardware or chip processing.
  • main control boards there may be one or more main control boards.
  • main control boards When there are multiple main control boards, they may include the main main control board and the backup main control board.
  • the multiple interface boards can communicate with each other through one or more switching network boards.
  • they can jointly achieve load sharing and redundant backup.
  • the centralized forwarding architecture the device does not need a switching network board, and the interface board is responsible for processing the business data of the entire system.
  • the device Under the distributed forwarding architecture, the device includes multiple interface boards, which can realize data exchange between multiple interface boards through the switching network board, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of network equipment with a distributed architecture are greater than those with a centralized architecture.
  • the specific architecture used depends on the specific networking deployment scenario and is not limited here.
  • the memory 832 may be a read-only memory (ROM), a random access memory (RAM), or an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), optical discs (compact disc read-only memory, CD-ROM), compressed disc, laser disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage media or other magnetic A storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
  • the memory 832 may exist independently and be connected to the forwarding plane component 831 through a communication bus. Memory 832 may also be integrated with forwarding plane component 831.
  • the network interface 8321 may be a device using any transceiver for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless LAN (wireless local area networks, WLAN), etc.
  • the network interface 833 includes a wired network interface and may also include a wireless network interface.
  • the wired network interface may be an Ethernet interface, for example.
  • the Ethernet interface can be an optical interface, an electrical interface, or a combination thereof.
  • the wireless network interface may be a WLAN interface, a cellular network communication interface or a combination thereof.
  • network device 800 may include multiple processors, and each of these processors may be a single-core processor or a multi-core processor.
  • a processor here may refer to one or more devices, circuits, and/or processing cores for processing data (such as computer program instructions).
  • the memory 832 is also used to store the program code for executing the solution of the present application.
  • the forwarding plane component 831 can execute the program code stored in the memory 832 to prompt the network device 800 to perform the forwarding in the embodiments shown in Figures 2 to 5.
  • the processing steps of the surface component please refer to the detailed introduction in the embodiment shown in Figures 2 to 5, and will not be described again here.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any computer-accessible storage medium. media, or data storage devices such as servers and data centers that contain one or more available media integrations.
  • the available media may be magnetic media (such as floppy disks, hard disks, magnetic tapes), optical media (such as digital versatile discs (DVD)) or semiconductor media (such as solid state disks (SSD)) wait.
  • the computer-readable storage media mentioned in the embodiments of this application may be non-volatile storage media, in other words, may be non-transitory storage media.
  • the information including but not limited to user equipment information, user personal information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • signals involved in the embodiments of this application are all processed.
  • the data flows of the services involved in the embodiments of this application are all obtained with full authorization.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请公开了一种链路故障处理方法、相关装置、存储介质及程序产品,属于通信技术领域。在本方法中,网络设备的转发面组件通过主动轮询端口状态寄存器来及时更新参考状态表,从而在转发数据流时,能够依据参考状态表及时感知本地的故障链路,及时进行链路切换。无需PHY芯片上报故障信息给网络设备中控制面的CPU,也无需等待控制面的CPU下发指令。即,本方案不依赖控制面算路,没有从数据面到控制面的额外通信,避免了由CPU处理故障所带来的延迟。使用本方案,降低了从发生链路故障到完成链路切换的耗时,提高了链路故障处理的收敛速度,减轻了链路故障对于业务所产生的影响,大幅提升了网络的可靠性。

Description

链路故障处理方法、相关装置、存储介质及程序产品
本申请要求于2022年06月02日提交的申请号为202210624676.2、发明名称为“链路故障处理方法、相关装置、存储介质及程序产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,特别涉及一种链路故障处理方法、相关装置、存储介质及程序产品。
背景技术
当前,网络设备之间用于传输数据流的路径称为链路。一旦网络中的链路发生故障,就需要尽快进行处理,以保证后续数据流能够正常发送。
网络设备包括物理层(physical,PHY)芯片、转发面组件和中央处理器(central processing unit,CPU)等。PHY芯片具有多个端口,转发面组件存储有转发数据流所需的转发表和链路状态表。网络设备的某个端口在接收上一跳网络设备发送的数据流之后,将接收到的数据流传输给转发面组件。转发面组件通过查询转发表来确定该数据流对应的出端口,再查询链路状态表中该出端口所在链路的链路状态。在查询到的链路状态为故障状态的情况下,即,该出端口所在的链路为故障链路,转发面组件确定该故障链路的替换链路,并将转发表中该数据流对应的出端口修改为该替换链路对应的出端口。转发面组件按照修改后的转发表将该数据流发送出去。简单来讲,网络设备在转发数据流时,要依据链路状态表来确定是否进行链路切换。而链路状态表是在端口发生故障后才更新的,也即是,若某个端口发生故障,PHY芯片向CPU发送硬件中断信号,即上报故障信息,该硬件中断信号用于指示该端口故障,CPU基于该硬件中断信号向转发面组件下发用于指示更新链路状态表的指令。转发面组件在接收到该指令后,将链路状态表中该端口所在链路的状态修改为故障状态。
然而,网络通信中的业务种类繁多,大部分业务对时延比较敏感,例如网络游戏、付费结算等业务。而上述方案中,在某个端口发生故障之后,需要PHY芯片向CPU上报故障信息,并等待CPU向转发面组件下发指令之后才能够修改链路状态表。上报故障信息以及等待指令下发的过程是比较耗时的,导致链路状态表不能够及时更新。而链路状态表更新不及时会导致链路切换不及时。可见,上述方案从链路发生故障到执行链路切换的时间较长,这会导致业务中断。
发明内容
本申请实施例提供了一种链路故障处理方法、相关装置、存储介质及程序产品,能够缩短从发生链路故障到完成链路切换的时间,从而减少链路故障对业务的影响。
第一方面,提供了一种链路故障处理方法,应用于网络设备,该网络设备包括转发面组件、端口状态寄存器和多个端口,该方法包括:
网络设备的转发面组件通过轮询端口状态寄存器来维护参考状态表,该参考状态表用于指示该多个端口分别所在的多条链路是否故障;转发面组件根据待转发的数据流,查询转发表和参考状态表,以确定用于传输该数据流的链路是否为故障链路;在确定用于传输该数据流的链路为故障链路的情况下,转发面组件确定该故障链路的替换链路;转发面组件基于该替换链路更新转发表,以将该数据流切换到替换链路。
在本方案中,转发面组件通过主动轮询端口状态寄存器来及时更新参考状态表,从而在转发数据流时,能够依据参考状态表及时感知本地的故障链路,及时进行链路切换。无需PHY芯片上报故障信息给控制面的CPU,也无需等待CPU下发链路切换指令。即,本方案不依赖控制面算路,没有从数据面到控制面的额外通信,避免了由CPU处理故障所带来的延迟。本方案从发生链路故障到完成链路切换的耗时较少,链路故障处理的收敛速度更快,从而减少链路故障对业务的影响。
网络设备还包括PHY芯片,该多个端口为PHY芯片的端口,端口状态寄存器为PHY芯片中的寄存器,端口状态寄存器的值由PHY芯片在检测到该多个端口中存在发生故障的端口的情况下进行修改。
其中,参考状态表包括链路状态表,链路状态表用于记录该多条链路中各条链路的链路状态。基于此,转发面组件通过轮询端口状态寄存器来维护参考状态表,包括:转发面组件轮询端口状态寄存器,以确定该多个端口中是否存在发生状态改变的端口,发生状态改变包括从可用状态变为不可用状态;在确定该多个端口中存在发生状态改变的端口的情况下,转发面组件将链路状态表中的第一链路状态修改为故障状态,第一链路状态为发生状态改变的端口所在链路的状态。
可选地,链路状态表记录有该多条链路的链路索引与链路状态的对应关系;转发面组件将链路状态表中的第一链路状态修改为故障状态之前,还包括:转发面组件从端口与链路的索引映射表中查询与第一端口索引对应的链路索引,以得到第一链路索引,第一端口索引为发生状态改变的端口的索引;转发面组件从链路状态表中查询与第一链路索引对应的链路状态,以得到第一链路状态。
在参考状态表包括链路状态表的实现方式中,转发面组件根据待转发的数据流,查询转发表和参考状态表,以确定用于传输该数据流的链路是否为故障链路,包括:转发面组件从转发表中查询该数据流对应的出端口;转发面组件从链路状态表中查询该出端口所在链路的链路状态;在该出端口所在链路的链路状态为故障状态的情况下,转发面组件确定用于传输该数据流的链路为故障链路。
可选地,转发面组件是通过快速重路由(fast reroute,FRR)组件从链路状态表中查询该出端口所在链路的链路状态的。FRR组件用于实现FRR机制。
或者,参考状态表包括端口状态表,端口状态表用于记录该多个端口中各个端口的端口状态。基于此,转发面组件通过轮询端口状态寄存器来维护参考状态表,包括:转发面组件轮询端口状态寄存器,以确定该多个端口中是否存在发生状态改变的端口,发生状态改变包括从可用状态变为不可用状态;在确定该多个端口中存在发生状态改变的端口的情况下,转发面组件将端口状态表中的第一端口状态修改为不可用状态,第一端口状态为发生状态改变的端口的状态。
可选地,端口状态表记录有该多个端口的端口索引与端口状态的对应关系;转发面组件 将端口状态表中的第一端口状态修改为不可用状态之前,还包括:转发面组件从端口状态表中查询与第一端口索引对应的端口状态,以得到第一端口状态,第一端口索引为发生状态改变的端口的索引。
在参考状态表包括端口状态表的实现方式中,转发面组件根据待转发的数据流,查询转发表和参考状态表,以确定用于传输该数据流的链路是否为故障链路,包括:转发面组件从转发表中查询该数据流对应的出端口;转发面组件从端口状态表中查询该出端口的端口状态;在该出端口的端口状态为不可用状态的情况下,转发面组件确定用于传输该数据流的链路为故障链路。
在本方案中,转发面组件确定该故障链路的替换链路的一种实现方式为:转发面组件通过快速重路由机制从主备链路对应关系中获取该故障链路对应的备链路作为替换链路。这样,无需重新算路,快速进行主备切换。
转发面组件确定该故障链路的替换链路的另一种实现方式为:转发面组件通过哈希算法,从该故障链路的多条等价路径中确定替换链路。即,预先确定多条等价路径,以通过哈希算法实现快速重路由,无需根据网络拓扑重新算路,例如,无需根据网络拓扑通过开放式最短路径优先(open shortest path first,OSPF)算法重新计算链路。这样也能够尽可能地缩短链路故障处理的收敛时间。
可选地,转发面组件是通过亚毫秒级轮询机制来轮询端口状态寄存器的。这样能够实现链路故障情况下的亚毫秒级换路。
可选地,该转发面组件为可编程逻辑器件。这样,通过对现有的转发面组件上的链路故障处理的相关逻辑进行相应修改即可实现本方案。
第二方面,提供了一种链路故障处理装置,所述链路故障处理装置具有实现上述第一方面中链路故障处理方法行为的功能。所述链路故障处理装置包括一个或多个模块,该一个或多个模块用于实现上述第一方面所提供的链路故障处理方法。
也即是,提供了一种链路故障处理装置,该装置应用于网络设备的转发面组件,该网络设备还包括多个端口和端口状态寄存器,该装置包括:
轮询模块,用于通过轮询端口状态寄存器来维护参考状态表,该参考状态表用于指示该多个端口分别所在的多条链路是否故障;
查表模块,用于根据待转发的数据流,查询转发表和参考状态表,以确定用于传输数据流的链路是否为故障链路;
确定模块,用于在确定用于传输该数据流的链路为故障链路的情况下,确定该故障链路的替换链路;
链路切换模块,用于基于该替换链路更新转发表,以将该数据流切换到该替换链路。
可选地,该参考状态表包括链路状态表,链路状态表用于记录该多条链路中各条链路的链路状态;
轮询模块,包括:
第一轮询子模块,用于轮询端口状态寄存器,以确定该多个端口中是否存在发生状态改变的端口,发生状态改变包括从可用状态变为不可用状态;
第二更新子模块,用于在确定该多个端口中存在发生状态改变的端口的情况下,将链路 状态表中的第一链路状态修改为故障状态,第一链路状态为发生状态改变的端口所在链路的状态。
可选地,链路状态表记录有该多条链路的链路索引与链路状态的对应关系;
轮询模块还包括:
第一查询子模块,用于从端口与链路的索引映射表中查询与第一端口索引对应的链路索引,以得到第一链路索引,第一端口索引为发生状态改变的端口的索引;
第二查询子模块,用于从链路状态表中查询与第一链路索引对应的链路状态,以得到第一链路状态。
可选地,查表模块包括:
第三查询子模块,用于从转发表中查询该数据流对应的出端口;
第四查询子模块,用于从链路状态表中查询该出端口所在链路的链路状态;
第一确定子模块,用于在该出端口所在链路的链路状态为故障状态的情况下,确定用于传输该数据流的链路为故障链路。
可选地,转发面组件是通过快速重路由机制从链路状态表中查询出端口所在链路的链路状态的。
可选地,该参考状态表包括端口状态表,端口状态表用于记录该多个端口中各个端口的端口状态;
轮询模块包括:
第二轮询子模块,用于轮询端口状态寄存器,以确定该多个端口中是否存在发生状态改变的端口,发生状态改变包括从可用状态变为不可用状态;
第二更新子模块,用于在确定该多个端口中存在发生状态改变的端口的情况下,将端口状态表中的第一端口状态修改为不可用状态,第一端口状态为发生状态改变的端口的状态。
可选地,端口状态表记录有该多个端口的端口索引与端口状态的对应关系;
轮询模块还包括:
第五查询子模块,用于从端口状态表中查询与第一端口索引对应的端口状态,以得到第一端口状态,第一端口索引为发生状态改变的端口的索引。
可选地,查表模块包括:
第六查询子模块,用于从转发表中查询数据流对应的出端口;
第七查询子模块,用于从端口状态表中查询该出端口的端口状态;
第二确定子模块,用于在该出端口的端口状态为不可用状态的情况下,确定用于传输该数据流的链路为故障链路。
可选地,确定模块包括:
获取子模块,用于通过快速重路由机制从主备链路对应关系中获取该故障链路对应的备链路作为替换链路。
可选地,确定模块包括:
第三确定子模块,用于通过哈希算法,从该故障链路的多条等价链路中确定替换链路。
可选地,转发面组件是通过亚毫秒级轮询机制来轮询端口状态寄存器的。
可选地,网络设备还包括PHY芯片,该多个端口为PHY芯片的端口,端口状态寄存器为PHY芯片中的寄存器,端口状态寄存器的值由PHY芯片在检测到该多个端口中存在发生 故障的端口的情况下进行修改。
可选地,转发面组件为可编程逻辑器件。
第三方面,提供了一种网络设备,该网络设备包括转发面组件、端口状态寄存器和多个端口。该网络设备用于通过转发面组件实现上述第一方面提供的链路故障处理方法的步骤。
第四方面,提供了一种网络设备,所述网络设备包括转发面组件和存储器,所述存储器用于存储执行上述第一方面所提供的链路故障处理方法的程序,以及存储用于实现上述第一方面所提供的链路故障处理方法所涉及的数据。所述转发面组件被配置为用于执行所述存储器中存储的程序。所述网络设备还可以包括通信总线,该通信总线用于该转发面组件与存储器之间建立连接。
第五方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在网络设备上运行时,使得网络设备执行上述第一方面所述的链路故障处理方法。
第六方面,提供了一种包含指令的计算机程序产品,当所述指令在网络设备上运行时,使得网络设备执行上述第一方面所述的链路故障处理方法。
上述第二方面、第三方面、第四方面、第五方面和第六方面所获得的技术效果与第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。
本申请提供的技术方案至少包括以下有益效果:
本方案无需PHY芯片上报故障信息给网络设备中控制面的CPU,也无需等待控制面的CPU下发指令。网络设备的转发面组件通过主动轮询端口状态寄存器来及时更新参考状态表,从而在转发数据流时,能够依据参考状态表及时感知本地的故障链路,及时进行链路切换。其中,参考状态表用于指示该网络设备的多个端口分别所在的多条链路是否故障。即,本方案不依赖控制面算路,没有从数据面到控制面的额外通信,避免了由CPU处理故障所带来的延迟。本方案从发生链路故障到完成链路切换的耗时较少,链路故障处理的收敛速度更快且更稳定,链路故障对于业务所产生的影响较小,大幅提升网络的可靠性。
附图说明
图1是本申请实施例提供的一种数据中心场景下的多级交换架构示意图;
图2是本申请实施例提供的一种链路故障处理方法的流程图;
图3是本申请实施例提供的另一种链路故障处理方法的流程图;
图4是本申请实施例提供的又一种链路故障处理方法的示意图;
图5是本申请实施例提供的链路故障处理方法所涉及的方案要点;
图6是本申请实施例提供的一种链路故障处理装置的结构示意图;
图7是本申请实施例提供的一种网络设备的结构示意图;
图8是本申请实施例提供的另一种网络设备的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
首先对本申请实施例涉及的网络架构和业务场景进行介绍。
本申请实施例提供的链路故障处理方法可应用于数据中心场景中的网络设备。图1是本申请实施例提供的一种数据中心场景下的多级交换架构示意图。该多级交换架构如close架构。图1展示出了多级交换架构中的三种设备,分别为用户设备、架顶式(top of rack,ToR)交换机和脊(spine)交换机。其中,用户设备如发送端的服务器、接收端的服务器等。ToR交换机即叶(leaf)交换机,位于接入侧,用于将用户设备接入数据中心。spine交换机位于汇聚层,连接ToR交换机。发送端的服务器与接收端的服务器之间的业务流量需要经过ToR交换机和spine交换机。本申请实施例提供的链路故障处理方法可应用于ToR交换机和spine交换机。
除了应用于数据中心场景中的网络设备之外,本方案也可应用于其他场景中的网络设备,本申请实施例对此不作限定。上述网络设备可以是交换机、路由器等任何一种具备转发功能的设备。网络设备包括转发面组件、端口状态寄存器、多个端口以及控制面的CPU。本申请实施例提供的链路故障处理方法应用于网络设备的转发面组件,而无需经过控制面的CPU。可选地,转发面组件也可称为转发装置。
其中,网络设备还包括PHY芯片,网络设备中的多个端口为PHY芯片的端口,端口状态寄存器为PHY芯片中的寄存器。端口状态寄存器用于存储该多个端口中各个端口的端口状态。在该多个端口中存在发生故障的端口时,PHY芯片立即感知到故障端口,更新端口状态寄存器中该故障端口所对应的比特位的值。
另外,网络设备的形态可以是盒式、框式等。其中,盒式网络设备的转发面组件和控制面的CPU可以在同一个单板(board)上,该转发面组件用于处理由于网络设备的各个端口故障所导致的链路故障问题。盒式网络设备可以包括一个PHY芯片。
框式网络设备包括主控板和至少一个接口板,各个接口板均包括PHY芯片和转发面组件,网络设备所包括的多个端口分布于该至少一个PHY芯片上,各个PHY芯片均包括端口状态寄存器,各个PHY芯片通过自身的端口状态寄存器来存储自身包括的各个端口的状态。框式网络设备的主控板包括控制面的CPU。本方案可以应用于各个接口板中的转发面组件,以通过转发面组件来处理由于相应接口板上的端口故障所导致的链路故障问题。
本申请实施例描述的网络架构以及业务场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着网络架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
接下来对本申请实施例提供的链路故障处理方法进行介绍。
图2是本申请实施例提供的一种链路故障处理方法的流程图,该方法应用于网络设备,该网络设备包括转发面组件、端口状态寄存器和多个端口。在图2中以上述介绍的盒式网络设备为例进行介绍。请参考图2,该方法包括如下步骤。
步骤201:网络设备的转发面组件通过轮询端口状态寄存器来维护参考状态表,参考状态表用于指示网络设备的多个端口分别所在的多条链路是否故障。
其中,参考状态表存储于转发面组件中,转发面组件在转发数据流时通过查询参考状态表来确定是否进行链路切换。参考状态表可以包括链路状态表(link state table,LST)或端口状态表(port state table,PST)。LST用于记录该多条链路中各条链路的链路状态,链路状态用于指示相应链路是否故障。PST用于记录该多个端口中各个端口的端口状态,端口状态用于指示相应端口是否可用,即是否故障。在本申请实施例中,一个端口对应一条链路,不同的端口对应不同的链路,各个端口的端口状态还能够用于指示相应端口所在链路是否故障。
首先以参考状态表包括LST为例,对转发面组件通过轮询端口状态寄存器来维护参考状态表的实现方式进行介绍。
在本申请实施例中,转发面组件轮询端口状态寄存器,以确定该多个端口中是否存在发生状态改变的端口。在确定该多个端口中存在发生状态改变的端口的情况下,转发面组件将LST中的第一链路状态修改为故障状态,第一链路状态为发生状态改变的端口所在链路的状态。其中,各个端口的端口状态为可用状态或不可用状态,发生状态改变包括从可用状态变为不可用状态。
其中,转发面组件轮询端口状态寄存器,将本次轮询到的寄存器值与上一次轮询到的寄存器值进行对比,以确定该多个端口中是否存在发生状态改变的端口。示例性地,端口状态寄存器包括多个比特位,该多个比特位分别对应网络设备的多个端口,各个比特位的值用于指示相应端口的端口状态。每个比特位的值可以为第一值或第二值,第一值表示可用状态,第二值表示不可用状态。若本次轮询到的第一比特位的值为第二值,上一次轮询到的第一比特位的值为第一值,则转发面组件确定第一比特位所对应的端口为发生状态改变的端口。若本次轮询到的第一比特位的值与上一次轮询到的第一比特位的值相同,则转发面组件确定第一比特位所对应的端口为未发生状态改变的端口。其中,第一值和第二值可以分别为‘1’和‘0’,第一值和第二值也可以分别为‘0’和‘1’。
可选地,LST记录有该多条链路的链路索引与链路状态的对应关系,网络设备还存储有端口与链路的索引映射表。基于此,转发面组件轮询端口状态寄存器,在查询到该多个端口中存在发生状态改变的端口的情况下,转发面组件从端口与链路的索引映射表中查询第一端口索引所对应的链路索引,以得到第一链路索引。第一端口索引为发生状态改变的端口的索引。转发面组件从LST中查询与第一链路索引对应的链路状态,以得到第一链路状态。其中,第一链路索引所索引的链路即为发生状态改变的端口所在的链路。
其中,转发面组件确定第一端口索引的实现方式有多种。
在一种实现方式中,端口状态寄存器中各个比特位的序号即为相应端口的端口索引。例如,端口状态寄存器中的第i个比特位所对应的端口的端口索引即为‘i’。基于此,转发面组件轮询端口状态寄存器的多个比特位,确定该多个端口中发生状态改变的端口所对应的比特位的序号,将该序号作为第一端口索引。
示例性地,端口状态寄存器为32位寄存器,即共有32个比特位,网络设备包括16个端口,端口状态寄存器中的16个比特位用于存储该多个端口的端口状态,这16个比特位的序号依次为1、2、3、…、16。转发面组件轮询这16个比特位,确定这16个端口中发生状态改变的端口所对应的比特位的序号为3,即第3个比特位所对应的端口为发生状态改变的端 口,转发面组件将3作为第一端口索引。
在另一种实现方式中,网络设备还存储有端口状态寄存器中各个比特位的序号与相应端口的端口标识的对应关系,以及该多个端口的端口标识与端口索引的对应关系。转发面组件轮询端口状态寄存器的多个比特位,确定该多个端口中发生状态改变的端口所对应的比特位的序号,从端口状态寄存器中各个比特位的序号与相应端口的端口标识的对应关系中,确定该序号所对应的端口标识,以得到第一端口标识,第一端口标识即为发生状态改变的端口的端口标识。转发面组件再从该多个端口的端口标识与端口索引的对应关系中查询与第一端口标识对应的端口索引,以得到第一端口索引。
示例性地,端口状态寄存器中多个比特位的序号依次为1、2、…、18,这多个序号对应的端口标识依次为Pa01、Pa02、Pc03、…、Ph05,这18个端口标识所对应的端口索引依次为0、1、2、…、17。转发面组件确定发生状态改变的端口所对应的比特位的序号为3,然后从序号与端口标识的对应关系中确定序号3所对应的端口标识为Pc03,即第一端口标识为Pc03。转发面组件再从端口标识与端口索引的对应关系中确定端口标识Pc03所对应的端口索引为2,即第一端口索引为2。
在本申请实施例中,LST所记录的各条链路的链路状态为‘up’或‘down’,其中,‘up’表示正常状态,即无故障状态,‘down’表示故障状态。或者,链路状态为‘1’或‘0’,其中,‘1’表示正常状态,‘0’表示故障状态。或者,链路状态也可以通过其他方式来表示。
接下来以参考状态表包括PST为例,对转发面组件通过轮询端口状态寄存器来维护参考状态表的实现方式进行介绍。
在本申请实施例中,转发面组件轮询端口状态寄存器,以确定该多个端口中是否存在发生状态改变的端口,其中,发生状态改变包括从可用状态变为不可用状态。在确定该多个端口中存在发生状态改变的端口的情况下,转发面组件将PST中的第一端口状态修改为不可用状态,第一端口状态为发生状态改变的端口的状态。
转发面轮询端口状态寄存器,以确定该多个端口中是否存在发生状态改变的端口的具体实现方式请参照前述相关内容,这里不再赘述。
可选地,端口状态表记录有该多个端口的端口索引与端口状态的对应关系。基于此,转发面组件将PST中的第一端口状态修改为不可用状态之前,从PST中查询与第一端口索引对应的端口状态,以得到第一端口状态。其中,第一端口索引为发生状态改变的端口的索引。其中,转发面组件确定第一端口索引的实现方式请参照前述相关内容,这里不再赘述。
在本申请实施例中,PST所记录的各个端口的端口状态为‘up’或‘down’,其中,‘up’表示可用状态,‘down’表示不可用状态。或者,端口状态为‘1’或‘0’,其中,‘1’表示可用状态,‘0’表示不可用状态。或者,端口状态也可以通过其他方式来表示。
可选地,为了提升链路故障处理的速度,转发面组件可以通过亚毫秒级轮询机制来轮询端口状态寄存器的,换句话说,转发面组件按照亚毫秒级的轮询周期来轮询端口状态寄存器。轮询周期小于1毫秒。例如,轮询周期为100微妙或200微妙等。本申请实施例通过亚毫秒级轮询机制来实现亚毫秒级的链路故障处理速度。
由前述可知,在本申请实施例中,转发面组件通过轮询端口状态寄存器来维护参考状态表,即通过轮芯端口状态寄存器来及时更新参考状态表,从而保证参考状态表的实时性和准确性。
网络设备还包括PHY芯片,该多个端口为PHY芯片的端口,端口状态寄存器为PHY芯片中的寄存器,端口状态寄存器的值由PHY芯片在检测到该多个端口中存在发生故障的端口的情况下进行修改。
示例性地,在PHY芯片中的第一端口发生故障后,第一端口向产生硬件中断信号,从而使得PHY芯片基于该硬件中断信号修改端口状态寄存器中第一端口所对应的比特位的值。例如,将第一端口所对应的比特位的值从‘1’修改为‘0’。其中,‘1’表示无故障状态,即可用状态,‘0’表示故障状态,即不可用状态。其中,该硬件中断信号可以携带第一端口的标识,PHY芯片从该硬件终端信号中获得第一端口的标识,按照第一端口的标识所对应的比特位的序号来修改端口寄存器中相应比特位的值。
步骤202:转发面组件根据待转发的数据流,查询转发表和参考状态表,以确定用于传输该数据流的链路是否为故障链路。
在本申请实施例中,网络设备还存储有转发表。转发面组件在获取到待转发的数据流之后,依次查询转发表和参考状态表,以确定用于传输该数据流的链路是否为故障链路。
在参考状态表为LST的实现方式中,转发面组件从转发表中查询该数据流对应的出端口。然后,转发面组件从LST中查询该出端口所在链路的链路状态。在该出端口所在链路的链路状态为故障状态的情况下,转发面组件确定用于传输该数据流的链路为故障链路。
可选地,转发面组件是通过FRR组件从LST中查询该出端口所在链路的链路状态的,后续转发面组件可以通过FRR组件来快速进行主备链路切换。也即是,网络设备配置有支持FRR机制的FRR组件,转发面组件通过FRR组件来查询LST。
其中,LST记录有该多条链路的链路索引与链路状态的对应关系,转发表记录有数据流信息与出端口索引的对应关系,网络设备还存储有端口与链路的索引映射表。基于此,转发面组件确定待转发的数据流信息,查询转发表中该数据流信息所对应的表项,获取该表项中的出端口索引。然后,转发面组件从端口与链路的索引映射表中查询与该出端口索引对应的链路索引,以得到该出端口所在链路的链路索引。转发面组件从LST中查询该出端口所在链路的链路索引所对应的链路状态,以得到该出端口所在链路的链路状态。
在参考状态表为PST的实现方式中,转发面组件从转发表中查询该数据流对应的出端口,转发面组件从PST中查询该出端口的端口状态。在该出端口的端口状态为不可用状态的情况下,转发面组件确定用于传输该数据流的链路为故障链路。
其中,PST记录有该多个端口的端口索引与端口状态的对应关系,转发表数据流信息与出端口索引的对应关系。基于此,转发面组件确定待转发的数据流信息,查询转发表中该数据流信息所对应的表项,获取该表项中的出端口索引。然后,转发面从PST中查询与该出端口索引对应的端口状态,以得到该出端口的端口状态。
在本申请实施例中,转发表中的数据流信息可以包括数据流的五元组信息,也可以包括其他的信息。转发表除了记录有数据流信息与出端口索引之外,还可以记录有下一跳路由信息,下一跳路由信息可以包括下一跳网络设备的信息和/或下一跳网络设备的入端口信息,转发表还可以记录有其他信息,本申请实施例对此不作限定。
步骤203:在确定用于传输该数据流的链路为故障链路的情况下,转发面组件确定该故障链路的替换链路。
在本申请实施例中,在确定用于传输该数据流的链路为故障链路的情况下,转发面组件 自动确定故障链路的替换链路,无需向控制面的CPU上报故障信息,无需控制面算路和下发换路指令。
在确定替换链路的第一种实现方式中,转发面组件从主备链路对应关系中获取故障链路对应的备链路作为替换链路。应当理解的是,网络设备存储有主备链路对应关系。
可选地,转发面组件通过FRR组件从主备链路对应关系中获取该故障链路对应的备链路作为替换链路。
可选地,该主备链路对应关系所记录的任一主链路与对应的备链路为等价路径。等价路径是按照等价多路径(equal-cost multi-path,ECMP)策略确定的。
示例性地,流经网络设备A的数据流要发往同一目的地,假设该目的地为网络设备B,按照ECMP策略计算出从网络设备A到网络设备B的3条等价路径,这3条等价路径分别包括链路1、链路2和链路3。那么,在一些实施例中,可以将链路2作为链路1的备链路,将链路2作为链路3的备链路,将链路1作为链路3的备链路。网络设备A所存储的主备链路对应关系包括{[主:链路1,备:链路2],[主:链路2,备:链路3],[主:链路3,备:链路1]}。流经网络设备A,且目的地为网络设备B的各个数据流可以负载分担到这3条等价路径上。例如,网络设备通过哈希算法对数据流a的流信息进行哈希运算,得到的哈希值为10,计算10除以3的余数,得到余数为1,那么网络设备将数据流a通过链路1进行发送。若网络设备对数据流b也按照上述方法进行计算,所得到的余数为2,那么网络设备将数据流b通过链路2进行发送。如果网络设备的端口1发生故障,导致端口1所在的链路1故障,则网络设备确定链路1的替换链路为链路2。
在确定替换链路的第二种实现方式中,转发面组件通过哈希算法,从该故障链路的多条等价路径中确定替换链路。其中,该多条等价路径是按照ECMP策略确定的。应当理解的是,预先确定多条等价路径,以通过哈希算法实现快速重路由,无需根据网络拓扑重新算路。例如,无需根据网络拓扑通过OSPF算法重新计算链路。这样也能够尽可能地缩短链路故障处理的收敛时间。
示例性地,网络设备按照ECMP策略所确定的3条等价路径分别包括链路1、链路2和链路3,在链路1为故障链路的情况下,网络设备通过哈希算法计算出原本要通过链路1发送的数据流对应的余数,将该余数加上预设值,得到目标值。网络设备计算目标值除以3的余数,将该余数所对应的链路作为替换链路。其中,预设值为不被3整除的任一整数。假设链路1故障,原本要通过链路1发送的数据流对应的余数为1,预设值为2,那么网络设备确定替换链路即为链路3。
除了以上两种实现方式之外,网络设备也可以通过其他方式来确定故障链路的替换链路,本申请实施例对此不作限定。
步骤204:转发面组件基于该替换链路更新转发表,以将该数据流切换到替换链路。
在本申请实施例中,转发面组件在确定故障链路的替换链路之后,可以通过修改转发表来将故障链路上的业务切换到替换链路,即将原本要通过该故障链路传输的数据流切换到该替换链路。
示例性地,转发表记录有数据流信息与出端口索引的对应关系。基于此,转发面组件确定故障链路上业务的数据流信息,包括确定步骤203中待转发的数据流的信息,查询转发表中该数据流信息所对应的表项,将该表项中的出端口索引修改为替换链路所对应的出端口的 端口索引,从而在按照转发表来转发数据流的情况下,将故障链路上的业务切换到替换链路,即按照修改后的转发表,将该数据流从替换链路所对应的出端口发送出去。
在转发表还记录有下一跳路由信息的情况下,转发面组件还将转发表中该表项中的下一跳路由信息修改为替换链路所对应的下一跳路由信息。
由前述可知,在本申请实施例中,网络设备中的一个端口对应一条链路,不同的端口所在的链路不同。本文中的链路是指相邻两个网络设备的两个端口之间的链路。例如,故障链路为发生故障的第一端口与下一跳网络设备中与第一端口进行通信的一个端口之间的链路,替换链路为本网络设备中未故障的第二端口与下一跳网络设备中与第二端口进行通信的一个端口之间的链路。替换链路对应的出端口是指第二端口。替换链路对应的下一跳路由信息可以包括下一跳网络设备的信息,和/或,下一跳网络设备中与第二端口进行通信的一个端口的信息。
可选地,网络设备的转发面组件为可编程逻辑器件。这样,通过对现有的转发面组件上的链路故障处理的相关逻辑进行相应修改即可实现本方案。
由前述可知,在本方案中,转发面组件是对数据面上的端口状态表、链路状态表以及转发表执行的操作,即,网络设备通过转发面组件在数据面上对本地的链路故障进行处理。因此,本方案实质上是一种基于数据面的本地链路故障收敛方案。
接下来请参照图3至图5对本申请实施例提供的链路故障处理方法再次进行示例性解释。
图3是本申请实施例提供的另一种链路故障处理方法的流程图。在图3中,网络设备配置有ECMP策略和FRR机制,网络设备包括转发面组件,且存储有主备链路对应关系、LST、端口与链路的索引映射表(PL索引映射表)和转发表(forwarding information table,FIB)。网络设备还包括端口状态寄存器。网络设备还包括多个端口,这些端口的标识(port identity,PID)分别为E1、E2等。
如图3所示,网络设备基于ECMP策略所确定的3条等价路径中的下一跳(next hop,NHP)路由信息分别为NHP1、NHP2和NHP3。NHP1、NHP2和NHP3分别对应E1、E2和E3。主备链路对应关系包括FRR1、FRR2和FRR3。FRR1表示NHP1所在链路为主链路、且NHP2所在链路为备链路的对应关系。FRR2表示NHP2所在链路为主链路、且NHP3所在链路为备链路的对应关系。FRR3表示NHP3所在链路为主链路、且NHP1所在链路为备链路的对应关系。
图3所示的链路故障处理方法包括两个过程,在第一个过程中,网络设备的转发面组件通过轮询端口状态寄存器来维护LST。在第二个过程中,转发面组件在转发数据流的过程中,基于转发表和LST来确定用于传输数据流的链路是否为故障链路,在确定用于传输某数据流的链路为故障链路的情况下,通过支持FRR机制的FRR组件快速执行主备切换。
其中,第一个过程包括如下步骤:
步骤11:转发面组件通过亚毫秒级轮询机制来轮询端口状态寄存器。
步骤12:以E1发生故障为例,在通过轮询端口状态寄存器,确定端口E1的端口状态发生改变的情况下,转发面组件确定端口E1的端口索引(port index,P idx),所确定的P idx为1。
步骤13:转发面组件从PL索引映射表中查询P idx为1的表项,获取该表项中的链路索引(link index,L idx),所获得的L idx为2。
步骤14:转发面组件从LST中查询L idx为2的表项,将该表项中的链路状态从无故障状态(记为比特1)修改为故障状态(记为比特0)。
第二个过程包括如下步骤:
步骤21:转发面组件根据待转发的目标数据流,查询FIB,以得到目标数据流对应的出端口的P idx。
步骤22:假设查询到的出端口的P idx为1,转发面组件从PL索引映射表中查询P idx为1的表项,获取该表项中的L idx。
步骤23:假设查询到的L idx为2,转发面组件通过FRR组件从LST中查询L idx为2的表项,获取该表项中指示链路状态的比特值。
步骤24:在获取到的比特值为0的情况下,转发面组件确定L idx为2的链路为故障链路。故障链路为NHP1所在的链路,即原本用于传输目标数据流的链路。
步骤25:转发面组件通过FRR组件从主备链路对应关系中获取NHP1所在链路对应的备链路作为替换链路。备链路为NHP2所在的链路,即替换链路为NHP2所在的链路。
步骤26:转发面组件将FIB中目标数据流对应的出端口修改为NHP2对应的出端口,将下一跳路由信息修改为NHP2,从而在按照FIB来转发数据流的情况下,将目标数据流切换到NHP2所在的链路。目标数据流是指原本要通过NHP1所在的链路进行发送的数据流。
图4是本申请实施例提供的又一种链路故障处理方法的示意图。相比于图3,在图4中,网络设备存储有PST,且可以不配置FRR机制。图4所示的链路故障处理方法也包括两个过程,在第一个过程中,网络设备的转发面组件通过轮询端口状态寄存器来维护PST。在第二个过程中,转发面组件在转发数据流的过程中,基于转发表和PST来确定用于传输数据流的链路是否为故障链路,在确定用于传输某数据流的链路为故障链路的情况下,通过哈希算法来确定故障链路的替换链路,并将故障链路上的业务切换到替换链路。
其中,第一个过程包括如下步骤:
步骤a1:转发面组件通过亚毫秒级轮询机制来轮询端口状态寄存器。
步骤a2:以E1发生故障为例,在通过轮询端口状态寄存器,确定端口E1的端口状态发生改变的情况下,转发面组件确定端口E1的P idx,所确定的P idx为1。
步骤a3:转发面组件从PST中查询P idx为1的表项,将该表项中的端口状态从可用状态(记为比特1)修改为不可用状态(记为比特0)。
第二个过程包括如下步骤:
步骤b1:转发面组件根据待转发的目标数据流,查询转发表,以得到目标数据流对应的出端口的P idx。
步骤b2:假设查询到的出端口的P idx为1,转发面组件从PST中查询P idx为1的表项,获取该表项中端口状态。
步骤b3:在获取的端口状态为不可用状态的情况下,转发面组件确定P idx为1的端口所在的链路为故障链路。故障链路即为NHP1所在的链路。如图4所示,故障链路是哈希选路所确定的链路,即目标数据流原本要经过的链路。目标数据流是指原本要通过NHP1所在的链路进行发送的数据流。
步骤b4:转发面组件通过哈希算法,从基于ECMP策略所确定的3条等价路径中,确定NHP1所在链路的替换链路为NHP3所在的链路。
步骤b5:转发面组件将FIB中目标数据流对应的出端口修改为NHP3对应的出端口,将下一跳路由信息修改为NHP3,从而在按照FIB来转发数据流的情况下,将目标数据流切换到NHP3所在的链路。即如图4所示,替换链路是哈希重新选路所确定的链路。
图5是本申请实施例提供的链路故障处理方法所涉及的方案要点。以转发面组件为可编程逻辑器件为例,转发面组件包括数据面的可编程模块。参见图6,本方案包括如下三个要点:
(1):轮询端口状态寄存器,以进行故障检测。即,数据面的可编程模块轮询端口状态寄存器,以确定发生故障的端口。其中,轮询周期可以为亚毫秒级周期。
(2):检测到故障时更新相关状态表。即,在通过轮询确定存在发生故障的端口的情况下,数据面的可编程模块立即更新参考状态表,包括端口状态表和/或链路状态表,也即将转发面组件所记录的端口状态和/或链路状态置为不可用状态。
(3):链路故障收敛,快速换路。即,在转发数据流的过程中,查询转发表和参考状态表确定用于传输该数据流的链路是否为故障链路。在确定该数据流的链路为故障链路的情况下,通过FRR机制或哈希算法快速确定故障链路的替换链路,更新FIB以将故障链路上的业务切换到替换链路。
本方案的整体思路还可以被应用于流量监测。例如,转发面组件实时监测多个出端口的流量大小,在监测到某一出端口的流量达到端口最大流量预警条件的情况下,将该出端口的端口状态设置为告警状态,并确定该出端口所在链路的替换链路。被设置为告警状态的出端口的流量要立即切换到替换链路,即切换到网络设备的其他出端口上。
综上所述,在本申请实施例中,无需PHY芯片上报故障信息给控制面的CPU,也无需等待控制面的CPU下发指令。转发面组件通过主动轮询端口状态寄存器来及时更新参考状态表,从而在转发数据流时,能够依据参考状态表及时感知本地的故障链路,及时进行链路切换。即,本方案不依赖控制面算路,没有从数据面到控制面的额外通信,避免了由CPU处理故障所带来的延迟。本方案从感知到链路故障到完成链路切换的耗时较少,链路故障处理的收敛速度更快且更稳定,链路故障对于业务所产生的影响较小,大幅提升网络的可靠性。在转发面组件对端口状态寄存器执行亚毫秒级轮询的实现方式中,从端口发生故障到完成链路切换的时间为亚毫秒级,使得本方案能够实现链路故障情况下的亚毫秒级换路。
图6是本申请实施例提供的一种链路故障处理装置600的结构示意图,该链路故障处理装置600可以由软件、硬件或者两者的结合实现成为网络设备的部分或者全部。在本申请实施例中,该装置600应用于网络设备的转发面组件,该网络设备还包括多个端口和端口状态寄存器。参见图6,该装置600包括:轮询模块601、查表模块602、确定模块603和链路切换模块604。
轮询模块601,用于通过轮询端口状态寄存器来维护参考状态表,该参考状态表用于指示该多个端口分别所在的多条链路是否故障;
查表模块602,用于根据待转发的数据流,查询转发表和参考状态表,以确定用于传输数据流的链路是否为故障链路;
确定模块603,用于在确定用于传输该数据流的链路为故障链路的情况下,确定该故障链路的替换链路;
链路切换模块604,用于基于替换链路更新转发表,以将该数据流切换到该替换链路。
可选地,该参考状态表包括链路状态表,链路状态表用于记录该多条链路中各条链路的链路状态;
轮询模块601,包括:
第一轮询子模块,用于轮询端口状态寄存器,以确定该多个端口中是否存在发生状态改变的端口,发生状态改变包括从可用状态变为不可用状态;
第二更新子模块,用于在确定该多个端口中存在发生状态改变的端口的情况下,将链路状态表中的第一链路状态修改为故障状态,第一链路状态为发生状态改变的端口所在链路的状态。
可选地,链路状态表记录有该多条链路的链路索引与链路状态的对应关系;
轮询模块601还包括:
第一查询子模块,用于从端口与链路的索引映射表中查询与第一端口索引对应的链路索引,以得到第一链路索引,第一端口索引为发生状态改变的端口的索引;
第二查询子模块,用于从链路状态表中查询与第一链路索引对应的链路状态,以得到第一链路状态。
可选地,查表模块602包括:
第三查询子模块,用于从转发表中查询该数据流对应的出端口;
第四查询子模块,用于从链路状态表中查询该出端口所在链路的链路状态;
第一确定子模块,用于在该出端口所在链路的链路状态为故障状态的情况下,确定用于传输该数据流的链路为故障链路。
可选地,转发面组件是通过快速重路由机制从链路状态表中查询出端口所在链路的链路状态的。
可选地,该参考状态表包括端口状态表,端口状态表用于记录该多个端口中各个端口的端口状态;
轮询模块601包括:
第二轮询子模块,用于轮询端口状态寄存器,以确定该多个端口中是否存在发生状态改变的端口,发生状态改变包括从可用状态变为不可用状态;
第二更新子模块,用于在确定该多个端口中存在发生状态改变的端口的情况下,将端口状态表中的第一端口状态修改为不可用状态,第一端口状态为发生状态改变的端口的状态。
可选地,端口状态表记录有该多个端口的端口索引与端口状态的对应关系;
轮询模块601还包括:
第五查询子模块,用于从端口状态表中查询与第一端口索引对应的端口状态,以得到第一端口状态,第一端口索引为发生状态改变的端口的索引。
可选地,查表模块602包括:
第六查询子模块,用于从转发表中查询数据流对应的出端口;
第七查询子模块,用于从端口状态表中查询该出端口的端口状态;
第二确定子模块,用于在该出端口的端口状态为不可用状态的情况下,确定用于传输该数据流的链路为故障链路。
可选地,确定模块603包括:
获取子模块,用于通过快速重路由机制从主备链路对应关系中获取该故障链路对应的备链路作为替换链路。
可选地,确定模块603包括:
第三确定子模块,用于通过哈希算法,从该故障链路的多条等价链路中确定替换链路。
可选地,转发面组件是通过亚毫秒级轮询机制来轮询端口状态寄存器的。
可选地,网络设备还包括PHY芯片,该多个端口为PHY芯片的端口,端口状态寄存器为PHY芯片中的寄存器,端口状态寄存器的值由PHY芯片在检测到该多个端口中存在发生故障的端口的情况下进行修改。
可选地,该转发面组件为可编程逻辑器件。
在本申请实施例中,无需PHY芯片上报故障信息给控制面的CPU,也无需等待控制面的CPU下发指令。转发面组件通过主动轮询端口状态寄存器来及时更新参考状态表,从而在转发数据流时,能够依据参考状态表及时感知本地的故障链路,及时进行链路切换。即,本方案不依赖控制面算路,没有从数据面到控制面的额外通信,避免了由CPU处理故障所带来的延迟。本方案从感知到链路故障到完成链路切换的耗时较少,链路故障处理的收敛速度更快且更稳定,链路故障对于业务所产生的影响较小,大幅提升网络的可靠性。在转发面组件对端口状态寄存器执行亚毫秒级轮询的实现方式中,从端口发生故障到完成链路切换的时间为亚毫秒级,使得本方案能够实现链路故障情况下的亚毫秒级换路。
需要说明的是:上述实施例提供的链路故障处理装置在处理链路故障时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的链路故障处理装置与链路故障处理方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
图7是本申请实施例提供的一种网络设备的结构示意图。该网络设备可以为图1至图6实施例中的任一网络设备。该网络设备700可以为交换机、路由器或者其他具备转发功能的网络设备。在该实施例中,该网络设备700包括:中央处理器710、转发面组件711、存储器712和PHY芯片713。PHY芯片713包括多个端口7131和端口状态寄存器7132。
中央处理器710用于完成系统管理、设备维护等功能。转发面组件711用于实现本申请实施例提供的链路故障处理方法。存储器712用于存储端口和/或链路状态表、转发表等。PHY芯片713用于在检测到该多个端口7131中的故障端口时修改端口状态寄存器7132的值。转发面组件711可以通过轮询端口状态寄存器来维护存储器712中的表项,从而实现上述链路故障处理方法。该多个端口7131用于接收和发送数据流和其他信息。其中,中央处理器710属于网络设备的控制面,转发面组件711和存储器712属于网络设备的数据面。
在一些实施例中,存储器712还用于存储执行本申请方案的程序代码,转发面组件711能够执行存储器712中存储的程序代码,促使网络设备700执行图2至图5所示实施例中网络设备的处理步骤,具体实现请参照图2至图5所示实施例中的详细介绍,这里不再赘述。
其中,该程序代码中可以包括一个或多个软件模块,例如,当图6所示实施例中的轮询模块601、查表模块602、确定模块603和链路切换模块604是通过软件实施的情况下,该程序代码包括可以包括轮询模块、查表模块、确定模块和链路切换模块。轮询模块用于通过轮 询端口状态寄存器来维护参考状态表,该参考状态表用于指示该多个端口7131分别所在的多条链路是否故障,该参考状态表包括端口状态表和/或链路状态表。查表模块用于根据待转发的数据流,查询转发表和参考状态表,以确定用于传输数据流的链路是否为故障链路。确定模块用于在确定用于传输该数据流的链路为故障链路的情况下,确定该故障链路的替换链路。链路切换模块用于基于该替换链路更新转发表,以将该数据流切换到该替换链路。具体实现方式,请参考上述图2至图5所示实施例中的详细描述,这里不再赘述。
图8是本申请实施例提供的另一种网络设备的结构示意图,该网络设备可以为图1至图6实施例中的任一网络设备。该网络设备800可以为交换机、路由器或者其他转发报文的网络设备。在该实施例中,该网络设备800包括:主控板810、接口板830和接口板840。多个接口板的情况下可以包括交换网板(图中未示出),该交换网板用于在各接口板(接口板也称为线卡或业务板)之间交换数据。
主控板810用于执行系统管理、设备维护、协议处理等功能。接口板830和840用于提供各种业务接口(例如,POS接口、GE接口、ATM接口等),并转发数据流。主控板810上主要有3类功能单元:系统管理控制单元、系统时钟单元和系统维护单元。主控板810、接口板830以及接口板840之间通过系统总线与系统背板相连实现互通。接口板830上包括一个或多个转发面组件831、存储器832以及多个网络接口8321,转发面组件可以包括PHY芯片(未示出)。该多个网络接口8321具体为端口。该多个网络端口可以部署在一个或多个PHY芯片上,每个PHY芯片还包括端口状态寄存器(未示出)。
每个PHY芯片用于在检测到自身的至少一个端口中的端口故障时修改自身的端口状态寄存器的值。
转发面组件831用于实现本申请实施例提供的链路故障处理方法,以及转发数据流。接口板830上的存储器832用于存储端口状态表和/或链路状态表,以及转发表。转发面组件831通过轮询端口状态寄存器来维护存储器中的相关表项,从而实现上述链路故障处理的方法。其中,转发面组件831通过查找存储器832中存储的转发表项进行数据流的转发。在另一些实施例中,转发面组件831还用于对接口板830进行控制管理并与主控板810上的中央处理器811通信。
转发面组件831可以为一个或多个用于实现本申请方案的集成电路,例如,专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。可选地,上述PLD为复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。
接口板830所包括的一个或多个网络接口(即端口8321),用于接收终端或者网络中其他设备发送的数据流或者其他信息,并根据转发面组件831的指示处理这些数据流或者数据信息。具体实现过程这里不再逐一赘述。
可以理解,如图8所示,本申请实施例中包括多个接口板,采用分布式的转发机制,这种机制下,接口板840包括转发面组件41,存储器42以及多个网络接口843,接口板840上的操作与所述接口板830的操作基本相似,为了简洁,不再赘述。此外,可以理解的是,图8中转发面组件831和/或841可以是可编程逻辑器件,也可以是专用硬件或芯片,如网络处 理器或者专用集成电路(application-specific integrated circuit,ASIC),这种实现方式即为通常所说的转发面采用专用硬件或芯片处理的方式。
此外,主控板可能有一块或多块,有多块的时候可以包括主用主控板和备用主控板。接口板可能有一块或多块,该设备的数据处理能力越强,提供的接口板越多。多块接口板的情况下,该多块接口板之间可以通过一块或多块交换网板通信,有多块的时候可以共同实现负荷分担冗余备份。在集中式转发架构下,该设备可以不需要交换网板,接口板承担整个系统的业务数据的处理功能。在分布式转发架构下,该设备包括多块接口板,可以通过交换网板实现多块接口板之间的数据交换,提供大容量的数据交换和处理能力。所以,分布式架构的网络设备的数据接入和处理能力要大于集中式架构的设备。具体采用哪种架构,取决于具体的组网部署场景,此处不做任何限定。
在一些实施例中,存储器832可以是只读存储器(read-only memory,ROM),也可以是随机存取存储器(random access memory,RAM),也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、光盘包括(只读光盘(compact disc read-only Memory,CD-ROM)、压缩光盘、激光盘、数字通用光盘、蓝光光盘等)、磁盘存储介质或者其它磁存储设备、或者是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质,但不限于此。存储器832可以是独立存在,并通过通信总线与转发面组件831相连接。存储器832也可以和转发面组件831集成在一起。
在一些实施例中,所述网络接口8321,可以是使用任何收发器一类的装置,用于与其它设备或通信网络通信,如以太网,无线接入网(radio access network,RAN),无线局域网(wireless local area networks,WLAN)等。网络接口833包括有线网络接口,还可以包括无线网络接口。其中,有线网络接口例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线网络接口可以为WLAN接口,蜂窝网络通信接口或其组合等。
在一些实施例中,网络设备800可以包括多个处理器,这些处理器中的每一个可以是一个单核处理器,也可以是一个多核处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(如计算机程序指令)的处理核。
在一些实施例中,存储器832还用于存储执行本申请方案的程序代码,转发面组件831可以执行存储器832中存储的程序代码,促使网络设备800执行图2至图5所示实施例中转发面组件的处理步骤,具体实现请参照图2至图5所示实施例中的详细介绍,这里不再赘述。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络或其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如:同轴电缆、光纤、数据用户线(digital subscriber line,DSL))或无线(例如:红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可 用介质,或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如:软盘、硬盘、磁带)、光介质(例如:数字通用光盘(digital versatile disc,DVD))或半导体介质(例如:固态硬盘(solid state disk,SSD))等。值得注意的是,本申请实施例提到的计算机可读存储介质可以为非易失性存储介质,换句话说,可以是非瞬时性存储介质。
应当理解的是,本文提及的“至少一个”是指一个或多个,“多个”是指两个或两个以上。在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。
本申请实施例所涉及的信息(包括但不限于用户设备信息、用户个人信息等)、数据(包括但不限于用于分析的数据、存储的数据、展示的数据等)以及信号,均为经用户授权或者经过各方充分授权的,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。例如,本申请实施例中涉及到的业务的数据流都是在充分授权的情况下获取的。
以上所述仅为本申请的示例性实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (17)

  1. 一种链路故障处理方法,其特征在于,应用于网络设备,所述网络设备包括转发面组件、端口状态寄存器和多个端口,所述端口状态寄存器用于存储所述多个端口中各个端口的端口状态;所述方法包括:
    所述转发面组件通过轮询所述端口状态寄存器来维护参考状态表,所述参考状态表用于指示所述多个端口分别所在的多条链路是否故障;
    所述转发面组件根据待转发的数据流,查询转发表和所述参考状态表,以确定用于传输所述数据流的链路是否为故障链路;
    在确定用于传输所述数据流的链路为故障链路的情况下,所述转发面组件确定所述故障链路的替换链路;
    所述转发面组件基于所述替换链路更新所述转发表,以将所述数据流切换到所述替换链路。
  2. 如权利要求1所述的方法,其特征在于,所述参考状态表包括链路状态表,所述链路状态表用于记录所述多条链路中各条链路的链路状态;
    所述转发面组件通过轮询所述端口状态寄存器来维护所述参考状态表,包括:
    所述转发面组件轮询所述端口状态寄存器,以确定所述多个端口中是否存在发生状态改变的端口,所述发生状态改变包括从可用状态变为不可用状态;
    在确定所述多个端口中存在发生状态改变的端口的情况下,所述转发面组件将所述链路状态表中的第一链路状态修改为故障状态,所述第一链路状态为所述发生状态改变的端口所在链路的状态。
  3. 如权利要求2所述的方法,其特征在于,所述链路状态表记录有所述多条链路的链路索引与链路状态的对应关系;
    所述转发面组件将所述链路状态表中的第一链路状态修改为故障状态之前,还包括:
    所述转发面组件从端口与链路的索引映射表中查询与第一端口索引对应的链路索引,以得到第一链路索引,所述第一端口索引为所述发生状态改变的端口的索引;
    所述转发面组件从所述链路状态表中查询与所述第一链路索引对应的链路状态,以得到所述第一链路状态。
  4. 如权利要求2或3所述的方法,其特征在于,所述转发面组件根据待转发的数据流,查询所述转发表和所述参考状态表,以确定用于传输所述数据流的链路是否为故障链路,包括:
    所述转发面组件从所述转发表中查询所述数据流对应的出端口;
    所述转发面组件从所述链路状态表中查询所述出端口所在链路的链路状态;
    在所述出端口所在链路的链路状态为故障状态的情况下,所述转发面组件确定用于传输所述数据流的链路为故障链路。
  5. 如权利要求4所述的方法,其特征在于,所述转发面组件是通过快速重路由机制从所述链路状态表中查询所述出端口所在链路的链路状态的。
  6. 如权利要求1所述的方法,其特征在于,所述参考状态表包括端口状态表,所述端口状态表用于记录所述多个端口中各个端口的端口状态;
    所述转发面组件通过轮询所述端口状态寄存器来维护所述参考状态表,包括:
    所述转发面组件轮询所述端口状态寄存器,以确定所述多个端口中是否存在发生状态改变的端口,所述发生状态改变包括从可用状态变为不可用状态;
    在确定所述多个端口中存在发生状态改变的端口的情况下,所述转发面组件将所述端口状态表中的第一端口状态修改为不可用状态,所述第一端口状态为所述发生状态改变的端口的状态。
  7. 如权利要求6所述的方法,其特征在于,所述端口状态表记录有所述多个端口的端口索引与端口状态的对应关系;
    所述转发面组件将所述端口状态表中的第一端口状态修改为不可用状态之前,还包括:
    所述转发面组件从所述端口状态表中查询与第一端口索引对应的端口状态,以得到所述第一端口状态,所述第一端口索引为发生状态改变的端口的索引。
  8. 如权利要求6或7所述的方法,其特征在于,所述转发面组件根据待转发的数据流,查询所述转发表和所述参考状态表,以确定用于传输所述数据流的链路是否为故障链路,包括:
    所述转发面组件从所述转发表中查询所述数据流对应的出端口;
    所述转发面组件从所述端口状态表中查询所述出端口的端口状态;
    在所述出端口的端口状态为不可用状态的情况下,所述转发面组件确定用于传输所述数据流的链路为故障链路。
  9. 如权利要求1-8任一所述的方法,其特征在于,所述转发面组件确定所述故障链路的替换链路,包括:
    所述转发面组件通过快速重路由机制从主备链路对应关系中获取所述故障链路对应的备链路作为所述替换链路。
  10. 如权利要求1-8任一所述的方法,其特征在于,所述转发面组件确定所述故障链路的替换链路,包括:
    所述转发面组件通过哈希算法,从所述故障链路的多条等价链路中确定所述替换链路。
  11. 如权利要求1-10任一所述的方法,其特征在于,所述转发面组件是通过亚毫秒级轮询机制来轮询所述端口状态寄存器的。
  12. 如权利要求1-11任一所述的方法,其特征在于,所述网络设备还包括物理层PHY芯片,所述多个端口为所述PHY芯片的端口,所述端口状态寄存器为所述PHY芯片中的寄存器,所述端口状态寄存器的值由所述PHY芯片在检测到所述多个端口中存在发生故障的端口的情况下进行修改。
  13. 如权利要求1-12任一所述的方法,其特征在于,所述转发面组件为可编程逻辑器件。
  14. 一种链路故障处理装置,其特征在于,应用于网络设备的转发面组件,所述装置用于实现权利要求1-13中任一所述方法的步骤。
  15. 一种网络设备,其特征在于,所述网络设备包括转发面组件、端口状态寄存器和多个端口;所述网络设备用于通过所述转发面组件实现权利要求1-13中任一所述方法的步骤。
  16. 一种计算机可读存储介质,其特征在于,所述存储介质内存储有计算机程序,所述计算机程序被网络设备执行时实现权利要求1-13中任一所述方法的步骤。
  17. 一种计算机程序产品,其特征在于,所述计算机程序产品内存储有计算机指令,所述计算机指令被网络设备执行时实现权利要求1-13中任一所述方法的步骤。
PCT/CN2023/096491 2022-06-02 2023-05-26 链路故障处理方法、相关装置、存储介质及程序产品 WO2023231912A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210624676.2 2022-06-02
CN202210624676.2A CN117221215A (zh) 2022-06-02 2022-06-02 链路故障处理方法、相关装置、存储介质及程序产品

Publications (1)

Publication Number Publication Date
WO2023231912A1 true WO2023231912A1 (zh) 2023-12-07

Family

ID=89026899

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/096491 WO2023231912A1 (zh) 2022-06-02 2023-05-26 链路故障处理方法、相关装置、存储介质及程序产品

Country Status (2)

Country Link
CN (1) CN117221215A (zh)
WO (1) WO2023231912A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9544185B1 (en) * 2013-11-05 2017-01-10 Cisco Technology, Inc. Hardware based fast convergence for network failures
CN112104478A (zh) * 2020-07-30 2020-12-18 新华三信息安全技术有限公司 一种链路切换方法、装置、设备及机器可读存储介质
CN112751752A (zh) * 2019-10-31 2021-05-04 中兴通讯股份有限公司 路由收敛的方法、装置、通信设备以及存储介质
CN113852547A (zh) * 2021-09-10 2021-12-28 锐捷网络股份有限公司 一种报文转发方法、装置、线卡及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9544185B1 (en) * 2013-11-05 2017-01-10 Cisco Technology, Inc. Hardware based fast convergence for network failures
CN112751752A (zh) * 2019-10-31 2021-05-04 中兴通讯股份有限公司 路由收敛的方法、装置、通信设备以及存储介质
CN112104478A (zh) * 2020-07-30 2020-12-18 新华三信息安全技术有限公司 一种链路切换方法、装置、设备及机器可读存储介质
CN113852547A (zh) * 2021-09-10 2021-12-28 锐捷网络股份有限公司 一种报文转发方法、装置、线卡及存储介质

Also Published As

Publication number Publication date
CN117221215A (zh) 2023-12-12

Similar Documents

Publication Publication Date Title
US6983294B2 (en) Redundancy systems and methods in communications systems
KR100831639B1 (ko) 정보 처리 장치, 통신 부하 분산 방법 및 통신 부하 분산프로그램을 기록한 기록 매체
JP6311612B2 (ja) 通信システム、制御装置、その制御方法及びプログラム
US20080215910A1 (en) High-Availability Networking with Intelligent Failover
JP5941404B2 (ja) 通信システム、経路切替方法及び通信装置
US9473360B2 (en) System and method for primary switch election in peer groups
EP2689561B1 (en) Directing traffic in an edge network element operable to perform layer 2 data forwarding and supporting any of various spanning tree protocols
US11818038B2 (en) Initiator-based data-plane validation for segment routed, multiprotocol label switched (MPLS) networks
WO2016101488A1 (zh) 一种三态内容可寻址存储器tcam查表方法及装置
US8477598B2 (en) Method and system for implementing network element-level redundancy
WO2020114017A1 (zh) 数据中心流量互通方法、装置、设备及存储介质
US10819628B1 (en) Virtual link trunking control of virtual router redundancy protocol master designation
CN113364678B (zh) 数据传输系统、方法、装置、电子设备和计算机可读介质
WO2023231912A1 (zh) 链路故障处理方法、相关装置、存储介质及程序产品
US7596085B2 (en) Access network system and method of moving internal network relay devices
CN114615179A (zh) 报文传输方法、设备及系统
US8547828B2 (en) Method and system for implementing network element-level redundancy
US8553531B2 (en) Method and system for implementing network element-level redundancy
CN102045259B (zh) 分组交换设备以及管理用户业务的方法
WO2017181778A1 (zh) 一种双主控设备主控之间链路扩展方法及装置
JP2006135723A (ja) 情報中継装置、情報中継方法、プログラム、情報通信システム
EP4277226A1 (en) Packet transmission method, transmission control method, apparatus, and system
CN115150320B (zh) 报文传输方法、装置及系统
US8477599B2 (en) Method and system for implementing network element-level redundancy
WO2016169139A1 (zh) 一种单纤故障的响应方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23815095

Country of ref document: EP

Kind code of ref document: A1