WO2020168996A1 - 链路聚合端口切换方法、网络设备和计算机存储介质 - Google Patents

链路聚合端口切换方法、网络设备和计算机存储介质 Download PDF

Info

Publication number
WO2020168996A1
WO2020168996A1 PCT/CN2020/075504 CN2020075504W WO2020168996A1 WO 2020168996 A1 WO2020168996 A1 WO 2020168996A1 CN 2020075504 W CN2020075504 W CN 2020075504W WO 2020168996 A1 WO2020168996 A1 WO 2020168996A1
Authority
WO
WIPO (PCT)
Prior art keywords
port
state
link
aggregation
forwarding
Prior art date
Application number
PCT/CN2020/075504
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 中兴通讯股份有限公司
Priority to EP20759906.9A priority Critical patent/EP3930267A4/en
Publication of WO2020168996A1 publication Critical patent/WO2020168996A1/zh

Links

Images

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/24Multipath
    • H04L45/245Link aggregation, e.g. trunking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/12Arrangements for remote connection or disconnection of substations or of equipment thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40169Flexible bus arrangements
    • H04L12/40176Flexible bus arrangements involving redundancy
    • H04L12/40182Flexible bus arrangements involving redundancy by using a plurality of communication lines
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Definitions

  • the embodiments of the present disclosure relate to but are not limited to the field of Ethernet switching equipment.
  • the connections between switches are generally aggregate ports to achieve load sharing of outbound and inbound traffic among each member port.
  • the states of aggregate group members are up and Down state, when the port is switched from the up state to the down state (it can be called LACP (Link Aggregation Control Protocol, Link Aggregation Control Protocol) switching state), the port needs to be quickly deleted from the aggregation group, and other up states in the aggregation group are used.
  • LACP Link Aggregation Control Protocol, Link Aggregation Control Protocol
  • the member port in the state participates in the subsequent traffic load sharing; when the port is switched from the down state to the up state (which can be called the LACP failback state), the port needs to be quickly added to the aggregation group so that the aggregate port can quickly participate in the subsequent Traffic load sharing.
  • the embodiment of the present disclosure provides a link aggregation port switching method, the method includes: when the first port of the link aggregation changes from the down state to the up state, adding the first port to the aggregation link in the ingress direction , And set the ingress forwarding state of the first port to the forwarding allowed state; when it is determined that the opposite end of the first port sets the ingress forwarding state to the forwarding allowed state, the first port is added to the aggregation in the egress direction. link.
  • the embodiment of the present disclosure also provides a network device, the network device is provided with a first port for link aggregation, a processor, and a memory for storing a computer program that can run on the processor; wherein the processor uses When the computer program is run, the steps of any link aggregation port switching method described herein are executed.
  • the embodiments of the present disclosure also provide a computer storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any link aggregation port switching method described herein are implemented.
  • FIG. 1 is a schematic diagram of load sharing when the aggregation link does not fail in an embodiment of the disclosure
  • FIG. 2 is a schematic diagram of load sharing when an aggregate link fails in an embodiment of the disclosure
  • FIG. 3 is a flowchart of a link aggregation port switching method according to an embodiment of the disclosure
  • FIG. 4 is a schematic diagram of the composition structure of a link aggregation port switching device according to an embodiment of the disclosure
  • Fig. 5 is a schematic structural diagram of a network device according to an embodiment of the disclosure.
  • the embodiments of the present disclosure may be applied to data interaction scenarios between network devices.
  • the network devices may be switches or other types of Ethernet switching devices.
  • Figure 1 is a schematic diagram of load sharing when the aggregate link does not fail in an embodiment of the disclosure.
  • the first network device and the second network device can exchange data through the aggregate link, and the first network device Both the second network device and the second network device can access the external network.
  • the aggregation group members of the first network device include ports 1, 2 and 3;
  • the aggregation group members of the second network device include ports 1, 2 and 3;
  • each port of the aggregation group of the first network device can be connected to the corresponding port of the aggregation group member of the second network device. In this way, in the aggregation group members, ports 1, 2, and 3 are all connected. Can participate in traffic load sharing.
  • FIG. 2 is a schematic diagram of load sharing when an aggregate link fails in an embodiment of the disclosure.
  • a third network device and a fourth network device can exchange data through the aggregate link, and the third network device and The fourth network device can access the external network.
  • the aggregation group members of the third network device include ports 1, 2 and 3;
  • the aggregation group members of the fourth network device include ports 1, 2 and 3;
  • ports 1 and 2 of the aggregation group of the third network device can communicate with ports 1 and 2 of the aggregation group member of the fourth network device. In this way, in the aggregation group members, only ports 1 and 2 can participate in traffic load sharing, and port 3 cannot participate in traffic load sharing.
  • the member entries of the underlying aggregation group are not updated at the same time, which will cause the member at one end to join the aggregation group and the other end to join the data aggregation group. That is, the time when the members at both ends join the aggregation group cannot be the same. Larger, the longer the packet loss time, because one end of the member joins the aggregation group, the traffic will be immediately load-shared to the port, and the traffic reaches the other end, and the other end is still in the deactivated state because it has not joined the aggregation group, that is, the port is in the block state. (Blocking state), so the traffic cannot pass through so that a large amount of packet loss occurs.
  • the packet loss time is the same as the inconsistent time when both ends join the aggregation group.
  • the time will exceed 1s; however, when the port changes from the down state to the up state, the theory In the above, it is not necessary to immediately add the port to the aggregation group member, so that the problem of packet loss can be avoided when the two network devices transmit data.
  • the first embodiment of the present disclosure proposes a link aggregation port switching method, which can be applied to network equipment.
  • FIG. 3 is a flowchart of a method for switching a link aggregation port according to an embodiment of the disclosure. As shown in FIG. 3, the process may include steps 301 and 302.
  • step 301 when the first port of the link aggregation changes from the down state to the up state, the first port is added to the aggregation link in the ingress direction, and the ingress forwarding state of the first port is set to allow forwarding Status (forward status).
  • the port set on the network device can become the port of link aggregation based on the LACP protocol.
  • the first port of the link aggregation is any port of the aggregation group member; the opposite end of the above-mentioned first port is the corresponding port of the opposite network device
  • the first port is port k of the first network device
  • the opposite end of the first port is port k of the second network device
  • the first port is port k of the second network device.
  • k is 1, 2 or 3; for the architecture shown in Figure 2, when the first port is port k of the third network device, the When the opposite end is port k of the fourth network device and the first port is port k of the fourth network device, the opposite end of the first port is port k of the third network device.
  • a monitoring task for the port status of the link aggregation can be established, and the status of the first port of the link aggregation can be monitored according to the foregoing monitoring task.
  • the aggregation link is an aggregation link of the LACP protocol. After the above-mentioned first port is added to the aggregation link in the ingress direction, the packet entering the first port (the packet received by the first port) is not Will be forwarded in the same aggregation group, which can eliminate loops between aggregation links.
  • the state of the first port can be set according to the LACP protocol, that is, in the egress direction, it is determined whether the state of the first port is the forward state or the block state according to the LACP protocol.
  • step 302 when it is determined that the opposite end of the first port sets the ingress forwarding state to the forwarding permitted state, the first port is added to the aggregate link in the egress direction.
  • the opposite end of the first port sets the ingress forwarding state to the forward state
  • adding the first port to the aggregate link in the egress direction can ensure that the traffic sent through the first port reaches the pair of the first port.
  • the opposite end of the first port can forward immediately, which can avoid packet loss; in other words, it can ensure that the data packets between network devices can be quickly shared again when the link of the aggregation group member is restored. All the member ports of the aggregation group can be switched back without packet loss at the same time.
  • Case 1 When the LACP protocol is used to set the port status, the transmission and reception are not separated, that is, the status of each port of the link aggregation is not independently set in the ingress direction and the egress direction.
  • the private protocol message may be sent to the opposite end of the first port through the first port immediately, and then, after waiting for the first preset time, the pair of the first port is determined The end sets the entry forwarding state to the forward state.
  • the first preset duration is greater than or equal to the sum of the pre-estimated message transmission duration and the pre-estimated first state change duration
  • the message transmission duration represents the private protocol message
  • the first state change time indicates the length of time that the opposite end of the first port sets the ingress forwarding state to the allowed forwarding state after receiving the private protocol message; for example, A preset duration can be set to 100ms.
  • the CPU of the opposite network device can set the ingress status of the opposite end of the first port to the forward state; here, the egress status of the opposite end of the first port can be set according to the LACP protocol .
  • the delay is delayed for the first preset time, and then the switchback operation based on the LACP protocol is executed.
  • the first port is added to Participate in forwarding in the aggregated link; it can be understood that by delaying the processing for the first preset time, the peer network device has set the ingress forwarding state to the forward state, so that the first port can be switched from the down state to the forward state. In the up state, there is no packet loss in link data transmission, that is, it can be switched back without packet loss.
  • case 1 can be applied to all LACP docking, that is, case 1 can not only be applicable to direct port docking based on LACP protocol between network devices, but also applicable to the docking based on LACP protocol between network devices through transparent transmission of other devices .
  • the member ports in the aggregated link can be set immediately, and the first port is added to the aggregated link in the egress direction to participate in forwarding; in this way, when the message is forwarded from the first port to After the opposite end, since the entrance of the opposite end is always in the forward state, no packet loss occurs in the link data transmission when the first port is switched from the down state to the up state, that is, it can be switched back without packet loss.
  • case 2 can be applied to the direct port docking between network devices based on the LACP protocol (other layer 2 devices are not transparently transmitted), and it can also be applied to the scenario where network devices are connected to other devices based on the LACP protocol by transparently transmitting other devices, because, Even if other devices are transparently transmitted between network devices, no loop will be formed.
  • Case 3 When the LACP protocol is used to set the port status, the transmission and reception are not separated, that is, the status of each port of the link aggregation is not independently set in the ingress direction and the egress direction.
  • step 301 you can wait for the second preset time to determine that the opposite end of the first port sets the ingress forwarding state to the forward state.
  • the second preset duration is greater than or equal to the second state change duration estimated in advance, and the second state change duration is the time interval between the first moment and the second moment.
  • One moment is the moment when the first port changes from the down state to the up state, and the second moment is the moment when the opposite end of the first port sets the ingress forwarding state to the forward state; for example, the second preset duration may be set to 5s.
  • the peer network device by delaying the second preset period of time, and then performing the switchback operation based on the LACP protocol, in the egress direction, the first port is added to the aggregate link to participate in forwarding; understandable Yes, by delaying the processing for the second preset duration, the peer network device has set the ingress forwarding state to the forward state, so that no packet loss occurs in the link data transmission when the first port is switched from the down state to the up state , In other words, you can switch back without packet loss.
  • case 3 can be applied to all LACP docking, that is, case 3 can not only be applicable to direct port docking between network devices based on the LACP protocol, but also applicable to network devices that realize the docking based on the LACP protocol through transparent transmission of other devices .
  • the deletion of members in the LACP switching aggregation group can also be implemented in the following ways.
  • the monitoring period of the port status of the link aggregation is 200 ms.
  • the monitoring frequency of the port status of the link aggregation can be increased, so that the The monitoring period of the port status is shortened to 10ms. It can be understood that by increasing the monitoring frequency of the port status of the link aggregation, all the links in the aggregation link can be quickly deleted when the first port is switched from the up state to the down state. The first port.
  • the first port can be quickly deleted from the aggregation link when the first port is switched from the up state to the down state.
  • the monitoring period of the port status of the link aggregation is 200 ms, and the priority of the monitoring task of the port status of the link aggregation is lower; and in the embodiment of the present disclosure, the monitoring of the port status can be improved.
  • the monitoring frequency of the port status of the link aggregation increases the priority of the monitoring task of the port status of the link aggregation. In this way, all the links in the aggregation link can be quickly deleted when the first port is switched from the up state to the down state. The first port.
  • the CPU of the network device can monitor the port status of the aggregated link through a high-frequency independent high-priority task (for example, once every 10ms); if the first port changes from the up state to the down state, the monitoring task immediately informs the chip to execute the chain The channel aggregation port is deleted locally to achieve fast switching; at the same time, the monitoring task can notify the LACP protocol to delete the link aggregation member port locally, so as to ensure that the port status of the underlying chip is consistent with the port status in the LACP protocol after fast switching; The monitoring task informs the chip to execute the process of deleting the link aggregation port locally, independent of the LACP protocol for the software process of deleting the link aggregation member port locally.
  • a high-frequency independent high-priority task for example, once every 10ms
  • step 301 to step 302 can be implemented by the processor of the network device.
  • the processor can be an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), or a digital signal processor.
  • Processing device Digital Signal Processing Device, DSPD
  • Programmable Logic Device Programmable Logic Device, PLD
  • Field Programmable Gate Array Field Programmable Gate Array, FPGA
  • CPU controller
  • microcontroller microprocessor At least one of.
  • the electronic device for realizing the above-mentioned processor function may also be other, which is not specifically limited in the embodiment of the present disclosure.
  • the application scenario of the second embodiment of the present disclosure is: the ports set by network device A and network device B are ports that form link aggregation based on the LACP protocol; on network device A and network device B, the ports of link aggregation include port 1. Port 2 and port 3, port 1, port 2 and port 3 form an aggregated link load forwarding, and port 1 changes from the up state to the down state.
  • the CPUs of network device A and network device B monitor the port status of the aggregation link through independent high-priority tasks with high frequency (for example, once every 10ms); when it finds that port 1 changes from the up state to the down state, it immediately informs the chip to be in the aggregation group Delete port 1 from the member to achieve fast switching.
  • the switching time is about 10ms; and the CPUs of network device A and network device B notify the LACP protocol to delete the member ports of the aggregation group locally, so that the port status in the underlying chip is consistent with the port status in the LACP protocol.
  • the application scenario of the third embodiment of the present disclosure is: the ports set by network device A and network device B are ports that form link aggregation based on the LACP protocol, and on network device A and network device B, the ports of link aggregation include port 1. Port 2 and port 3, port 1, port 2, and port 3 form an aggregated link load forwarding, port 1 and port 2 are always in the up state, and port 3 changes from the down state to the up state.
  • the network device A and the network device B may not be directly connected based on the LACP protocol, and the network device A and the network device B may have a layer 2 network device based on the LACP protocol transparent transmission.
  • the CPU of network device A or network device B monitors the port status of the aggregated link through an independent high-priority task and high-frequency monitoring (for example, once every 10ms).
  • high-frequency monitoring for example, once every 10ms.
  • the application scenario of the fourth embodiment of the present disclosure is: the ports set by network device A and network device B are ports that form link aggregation based on the LACP protocol, and on network device A and network device B, the ports of link aggregation include port 1. Port 2 and port 3, port 1, port 2, and port 3 form an aggregated link load forwarding, port 1 and port 2 are always in the up state, and port 3 changes from the down state to the up state.
  • the network device A and the network device B are directly connected based on the LACP protocol, and there is no layer 2 network device based on the LACP protocol transparent transmission between the network device A and the network device B.
  • the CPU of network device A or network device B monitors the port status of the aggregated link through an independent high-priority task and high-frequency monitoring (for example, once every 10ms). When it is found that port 3 changes from the down state to the up state, if the LACP protocol is used to set When the port status is separated, the ingress forwarding status of all ports in the LACP aggregation group member port is always the forward state.
  • port 3 can be added to the aggregate link in the ingress direction, and in the egress direction, it can follow LACP
  • the protocol sets the state of port 3; immediately sets the member ports in the aggregated link, and adds port 3 to the aggregated link in the egress direction to participate in forwarding; in this way, when the message is forwarded from the first port to the opposite end, the ingress of the opposite end It is always in the forward state, therefore, it can be switched back without packet loss.
  • the application scenario of the fifth embodiment of the present disclosure is: the ports set by network device A and network device B are ports that form link aggregation based on the LACP protocol, and on network device A and network device B, the ports of link aggregation include port 1. Port 2 and port 3, port 1, port 2, and port 3 form an aggregated link load forwarding, port 1 and port 2 are always in the up state, and port 3 changes from the down state to the up state.
  • the network device A and the network device B may not be directly connected based on the LACP protocol, and the network device A and the network device B may have a layer 2 network device based on the LACP protocol transparent transmission.
  • the CPU of network device A or network device B monitors the port status of the aggregated link through an independent high-priority task and high-frequency monitoring (for example, once every 10ms).
  • high-frequency monitoring for example, once every 10ms.
  • delay 5s (during the 5s delay period, the opposite end has set the status of the corresponding port 3 to the forward state), at this time, perform the switchback operation based on the LACP protocol, in the egress direction, Add port 3 to the aggregated link to participate in forwarding; it is understandable that through the 5s delay processing, the peer network device has set the ingress forwarding state to the forward state, so that it can be switched back without packet loss.
  • the application scenario of the sixth embodiment of the present disclosure is: the ports set by network device A and network device B are ports that form link aggregation based on the LACP protocol, and on network device A and network device B, the ports of link aggregation include port 1. Port 2 and port 3, port 1, port 2, and port 3 form an aggregate link load forwarding. The aggregate group formed by port 1, port 2 and port 3 is recorded as aggregate group 100; port 1 and port 2 are always in the up state, 3 Change from down state to up state. When using the LACP protocol to set the port status, the transmission and reception are separated by default.
  • the transmission and reception are separated.
  • the port 3 of the network device A and the network device B is in the down state, the port 3 is removed from the outgoing aggregation group, and the state of the outgoing direction is the block state; In the direction, port 3 is added to the aggregation group 100 by default.
  • the status of port 3 in the ingress direction is forward; since port 3 is added to the aggregation link in the ingress direction, the packets entering port 3 will not be in the same In the aggregation group 100, the loop between the aggregation links can be eliminated.
  • the CPUs of network device A and network device B monitor the port status of the aggregation link through independent high-priority tasks and high-frequency monitoring (for example, once every 10ms).
  • the aggregation group 100 can be set immediately In the ingress direction, add port 3 to the aggregation group.
  • the seventh embodiment of the present disclosure proposes a link aggregation port switching device, which can be applied to the foregoing network equipment.
  • FIG. 4 is a schematic diagram of the composition structure of a link aggregation port switching device according to an embodiment of the disclosure. As shown in FIG. 4, the device may include: a first processing module 401 and a second processing module 402; wherein,
  • the first processing module 401 is configured to add the first port to the aggregation link in the ingress direction when the first port of the link aggregation changes from the down state to the up state, and forward the ingress of the first port Set the status to allow forwarding status;
  • the second processing module 402 is configured to determine that when the opposite end of the first port sets the ingress forwarding state to the forwarding permitted state, add the first port to the aggregation link in the egress direction.
  • the ingress forwarding state of each port of the link aggregation is always maintained in the forwarding permitted state.
  • the second processing module 402 is further configured to When the status of each port of the link aggregation is not set independently in the ingress direction and the egress direction, the private protocol message is sent to the opposite end of the first port through the first port, and after waiting for the first preset period of time , Determining that the opposite end of the first port sets the ingress forwarding state to the forwarding allowed state.
  • the first preset duration is greater than or equal to the sum of the pre-estimated message transmission duration and the pre-estimated first state change duration, and the message transmission duration indicates that the private protocol message is transmitted from all sources.
  • the transmission duration from the first port to the opposite end of the first port, and the first state change duration indicates that the opposite end of the first port sets the ingress forwarding state to allow forwarding after receiving the private protocol packet The duration of the state.
  • the second processing module 402 is further configured to When the state of each port of the link aggregation is not set independently in the ingress direction and the egress direction, after waiting for the second preset period of time, it is determined that the opposite end of the first port sets the ingress forwarding state to the forwarding permitted state.
  • the second preset duration is greater than or equal to a second state change duration estimated in advance
  • the second state change duration is the time interval between the first moment and the second moment
  • the first moment is The moment when the first port changes from the down state to the up state
  • the second moment is the moment when the opposite end of the first port sets the ingress forwarding state to the forwarding allowed state.
  • the second processing module 402 is further configured to increase the frequency of monitoring the port status of the link aggregation; when the first port that monitors the link aggregation changes from the up state to the down state At this time, the first port is deleted from the aggregated link.
  • the second processing module 402 is also used to increase the priority of the monitoring task of the port status of the link aggregation; when the first port that monitors the link aggregation changes from the up state When it is in the down state, delete the first port in the aggregated link.
  • the second processing module 402 is further configured to increase the frequency of monitoring the port status of the link aggregation, and increase the priority of the monitoring task of the port status of the link aggregation; When it is monitored that the first port of the link aggregation changes from the up state to the down state, the first port is deleted from the aggregated link.
  • first processing module 401 and second processing module 402 can be implemented by a CPU, a microprocessor (Micro Processor Unit, MPU), DSP, or FPGA.
  • MPU Micro Processor Unit
  • DSP Digital Signal processor
  • FPGA Field Programmable Gate array
  • the functional modules in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be realized in the form of hardware or software function module.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this embodiment is essentially or It is said that the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can A personal computer, server, or network device, etc.) or a processor (processor) executes all or part of the steps of the method described in this embodiment.
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
  • the computer program instructions corresponding to a link aggregation port switching method in this embodiment can be stored on storage media such as optical disks, hard disks, U disks, etc., when the storage medium is switched to a link aggregation port
  • storage media such as optical disks, hard disks, U disks, etc.
  • FIG. 5 shows a network device 50 provided by an embodiment of the present disclosure.
  • the device may include: a first port of link aggregation (not shown in the figure), a memory 51 and a processor 52; wherein the memory 51 is configured to store computer programs and data; the processor 52 is configured to execute the computer programs stored in the memory, so as to implement any of the links in the foregoing embodiments The steps of the aggregation port switching method.
  • the aforementioned memory 51 may be a volatile memory (volatile memory), such as RAM; or a non-volatile memory (non-volatile memory), such as ROM, flash memory, or hard disk (Hard Disk). Drive, HDD) or Solid-State Drive (SSD); or a combination of the foregoing types of memories, and provide instructions and data to the processor 52.
  • volatile memory volatile memory
  • non-volatile memory non-volatile memory
  • ROM read-only memory
  • flash memory read-only memory
  • HDD hard disk
  • SSD Solid-State Drive
  • the aforementioned processor 52 may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.
  • the electronic device for realizing the above-mentioned processor function may also be other, which is not specifically limited in the embodiment of the present disclosure.
  • the link aggregation port can realize the fast switching and lossless switchback of the link aggregation control protocol (Link Aggregation Control Protocol, LACP) link, , Can avoid packet loss when the port is switched from down state to up state.
  • Link Aggregation Control Protocol LACP
  • the embodiments of the present disclosure can be provided as methods, systems, or computer program products. Therefore, the present disclosure may adopt the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program codes.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Landscapes

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

Abstract

本公开实施例提供了一种链路聚合端口切换方法、网络设备和计算机存储介质,所述方法包括:链路聚合的第一端口由down状态变为up状态时,在入口方向将所述第一端口加入到聚合链路,且将所述第一端口的入口转发状态设置为允许转发状态;确定所述第一端口的对端将入口转发状态设置为允许转发状态时,在出口方向将所述第一端口加入到聚合链路。

Description

链路聚合端口切换方法、网络设备和计算机存储介质 技术领域
本公开实施例涉及但不限于以太网交换设备领域。
背景技术
随着计算机及网络技术的高速发展和各种网络应用的不断涌现,基础数据通信网络的稳定性越来越重要。为了增加带宽,实现链路传输弹性和冗余等功能,交换机之间的连线一般是聚合端口,以实现出、入流量在各个成员端口中的负载分担,聚合组成员的状态有up状态和down状态,端口由up状态切换到down状态(可以称为LACP(Link Aggregation Control Protocol,链路汇聚控制协议)切换状态)时,需要快速将本端口从聚合组中删除,采用聚合组里面其它up状态的成员端口参与后续的流量负载分担;端口由down状态切换到up状态(可以称为LACP回切状态)时,需要快速将本端口加入聚合组中,使该聚合端口可以很快参与后续的流量负载分担。
然而,在相关技术中,当端口由down状态切换到up状态时,由于链路两端设备的端口加入聚合组的时间存在时间差,可能导致数据传输时出现丢包,例如,一端成员加入聚合组后流量就会立即负载分担到该端口,流量到达另一端,另一端由于未加入聚合组还处于阻塞状态(block状态),所以流量无法通过以至于出现大量的丢包。
发明内容
本公开实施例提供了一种链路聚合端口切换方法,所述方法包括:链路聚合的第一端口由down状态变为up状态时,在入口方向将所述第一端口加入到聚合链路,且将所述第一端口的入口转发状态设置为允许转发状态;确定所述第一端口的对端将入口转发状态设置为允许转发状态时,在出口方向将所述第一端口加入到聚合链路。
本公开实施例还提供了一种网络设备,所述网络设备设置有链路聚合的第一端口、处理器和用于存储能够在处理器上运行的计算机 程序的存储器;其中,所述处理器用于运行所述计算机程序时,执行本文所述任意一种链路聚合端口切换方法的步骤。
本公开实施例还提供了一种计算机存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现本文所述任意一种链路聚合端口切换方法的步骤。
附图说明
图1为本公开实施例中聚合链路未出现故障时的负载分担示意图;
图2为本公开实施例中聚合链路出现故障时的负载分担示意图图3为本公开实施例的链路聚合端口切换方法的流程图;
图4为本公开实施例的链路聚合端口切换装置的组成结构示意图;
图5为本公开实施例的网络设备的结构示意图。
具体实施方式
以下结合附图及实施例,对本公开进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本公开,并不用于限定本公开。
本公开实施例可以应用于网络设备之间的数据交互场景,这里,网络设备可以是交换机或其他类型的以太网交换设备。
图1为本公开实施例中聚合链路未出现故障时的负载分担示意图,如图1所示,第一网络设备和第二网络设备之间可以通过聚合链路进行数据交互,第一网络设备和第二网络设备均可以接入外部网络,参照图1,第一网络设备的聚合组成员包括端口1、2和3;第二网络设备的聚合组成员包括端口1、2和3;在聚合链路未出现故障时,第一网络设备的聚合组的每个端口与第二网络设备的聚合组成员的对应端口可以实现通信连接,这样,在聚合组成员中,端口1、2和3均可以参与流量负载分担。
图2为本公开实施例中聚合链路出现故障时的负载分担示意图, 如图2所示,第三网络设备和第四网络设备之间可以通过聚合链路进行数据交互,第三网络设备和第四网络设备均可以接入外部网络,参照图2,第三网络设备的聚合组成员包括端口1、2和3;第四网络设备的聚合组成员包括端口1、2和3;在端口3之间的链路出现故障时,第三网络设备的聚合组的端口1和2可以与第四网络设备的聚合组成员的端口1和2实现通信连接,这样,在聚合组成员中,只有端口1和2可以参与流量负载分担,端口3不可以参与流量负载分担。
相关技术中,网络设备在实现链路聚合功能存在以下两个比较严重的问题:
1)从聚合端口变为down状态到两端设备业务都切换,需要花费不少时间将处于down状态的端口从聚合组里面删除,在删除前报文还在向处于down状态的端口转发,从而导致丢包;其主要原因是,网络设备可以通过监控任务(例如监控任务为linkscan任务)监控端口状态,为了避免中央处理器(Central Processing Unit,CPU)繁忙,监控任务的执行周期在200ms以上,同时当感知到端口变为down状态后,还需要上送网络设备的CPU处理,而CPU此时可能正在处理其它高优先级任务,因而,不能立刻执行在聚合组中删除down状态的端口的操作。
2)无法保证链路故障恢复过程中不出现大量的丢包,聚合端口在回切的过程中会导致丢包的原因是:两个网络设备基于动态LACP进行数据交互,当端口变为up状态后,每条链路可以进行LACP协议交互,互不影响,待两端(两个网络设备)协商成功后,平台可以将激活的聚合组成员信息下发到驱动模块。这里,平台无法保证向两个网络设备同时下发聚合组成员信息,其次,两个网络设备从平台到驱动模块下发聚合成员信息的流程也会有时延误差,就导致了两个网络设备的底层聚合组成员表项不是同时更新,会导致一端成员先加入聚合组另外一端成员后加入据聚合组,即两端成员加入聚合组的时间不能保持一致,两端成员加入聚合组时间差值越大,丢包的时间就越多,因为一端成员加入聚合组后流量就会立即负载分担到该端口,流量到达另一端,另一端由于未加入聚合组还处于去激活状态,即端口处于 block状态(阻塞状态),所以流量无法通过以至于出现大量的丢包,丢包时间和两端加入聚合组不一致的时间相同,时间会超过1s;然而,当端口从down状态变为up状态时,理论上,可以不立即执行端口加入到聚合组成员中,这样可以使两个网络设备传输数据时避免出现丢包的问题。
基于上述记载的内容,提出以下各实施例。
第一实施例
本公开第一实施例提出了一种链路聚合端口切换方法,可以应用于网络设备中。
图3为本公开实施例的链路聚合端口切换方法的流程图,如图3所示,该流程可以包括步骤301和302。
在步骤301,链路聚合的第一端口由down状态变为up状态时,在入口方向将所述第一端口加入到聚合链路,且将所述第一端口的入口转发状态设置为允许转发状态(forward状态)。
这里,网络设备上设置的端口可以基于LACP协议成为链路聚合的端口,链路聚合的第一端口为聚合组成员的任意一端口;上述第一端口的对端为对端网络设备的对应端口,例如,对于图1所示的架构,第一端口为第一网络设备的端口k时,第一端口的对端为第二网络设备的端口k,第一端口为第二网络设备的端口k时,第一端口的对端为第一网络设备的端口k,k取1、2或3;对于图2所示的架构,第一端口为第三网络设备的端口k时,第一端口的对端为第四网络设备的端口k,第一端口为第四网络设备的端口k时,第一端口的对端为第三网络设备的端口k。
实际应用中,可以建立对所述链路聚合的端口状态的监控任务,根据上述监控任务可以对链路聚合的第一端口的状态进行监控。
本公开实施例中,聚合链路为LACP协议的聚合链路,在入口方向将上述第一端口加入到聚合链路后,进入第一端口的报文(第一端口接收的报文)就不会在相同的聚合组里转发,从而可以消除聚合链路之间的环路。
实际应用中,在出口方向,可以按照LACP协议设置第一端口的状态,即,在出口方向按照LACP协议来确定第一端口的状态为forward状态还是block状态。
在步骤302,确定所述第一端口的对端将入口转发状态设置为允许转发状态时,在出口方向将所述第一端口加入到聚合链路。
可以理解的是,当第一端口的对端将入口转发状态设置为forward状态时,在出口方向将第一端口加入到聚合链路,可以确保经第一端口发出的流量到达第一端口的对端时,第一端口的对端可以立即进行转发,能够避免出现丢包;也就是说,能够保证网络设备之间的数据报文在聚合组成员链路恢复时,流量能重新迅速的分担到所有的聚合组成员端口上,同时可以做到回切不丢包。
本公开实施例中,对于如何确定第一端口的对端将入口转发状态设置为允许转发状态,可以通过以下几种情况进行说明。
情况1:在利用LACP协议设置端口状态的时候没有做到收发分离,即,在入口方向和出口方向并非相互独立地设置链路聚合的每个端口的状态。
对于情况1,可以在步骤301后,立即通过第一端口将私有协议报文发送至所述第一端口的对端,然后,在等待第一预设时长后,确定所述第一端口的对端将入口转发状态设置为forward状态。
对于第一预设时长的设置方式,在一个示例中,第一预设时长大于或等于预先估计的报文传输时长与预先估计的第一状态改变时长之和,报文传输时长表示私有协议报文从第一端口到第一端口的对端的传输时长,第一状态改变时长表示第一端口的对端在接收到私有协议报文后将入口转发状态设置为允许转发状态的时长;例如,第一预设时长可以设置为100ms。
实际应用中,对端网络设备的CPU在收到私有协议报文后,可以将第一端口的对端的入口状态设置为forward状态;这里,第一端口的对端的出口状态可以根据LACP协议进行设置。
可以看出,在本公开实施例中,在通过第一端口发送私有协议报文后,延时第一预设时长,再执行基于LACP协议的回切操作,在 出口方向,将第一端口加入到聚合链路中参与转发;可以理解的是,通过延时第一预设时长的处理,对端网络设备已经将入口转发状态设置为forward状态,从而,可以在第一端口由down状态切换到up状态时链路数据传输不出现丢包,也就是说,可以做到回切不丢包。
这里,情况1可以适用于所有的LACP对接,即,情况1不仅可以适用于网络设备之间基于LACP协议直接端口对接,还可以适用于网络设备之间通过透传其他设备实现基于LACP协议的对接。
情况2:在利用LACP协议设置端口状态的时候做到收发分离,即,在入口方向和出口方向相互独立地设置链路聚合的每个端口的状态。
对于情况2,由于在利用LACP协议设置端口状态的时候做到收发分离,则将链路聚合的每个端口(LACP成员的每个端口)的入口转发状态始终为forward状态。
可以看出,对于情况2,可以在步骤301后,立即设置聚合链路里面的成员端口,在出口方向将第一端口加入到聚合链路参与转发;如此,当报文从第一端口转发到对端后,由于对端入口一直处于forward状态,因而,可以在第一端口由down状态切换到up状态时链路数据传输不出现丢包,也就是说,可以做到回切不丢包。
这里,情况2可以适用于网络设备之间基于LACP协议直接端口对接(不透传其他2层设备),也可以适用于网络设备之间通过透传其他设备实现基于LACP协议的对接场景,因为,即使网络设备之间通过透传其他设备,也不会形成环路。
情况3:在利用LACP协议设置端口状态的时候没有做到收发分离,即,在入口方向和出口方向并非相互独立地设置链路聚合的每个端口的状态。
对于情况3,可以在步骤301后,等待第二预设时长,便可以确定第一端口的对端将入口转发状态设置为forward状态。
对于第二预设时长的设置方式,在一个示例中,第二预设时长大于或等于预先估计的第二状态改变时长,第二状态改变时长为第一时刻与第二时刻的时间间隔,第一时刻为第一端口由down状态变为 up状态的时刻,第二时刻为第一端口的对端将入口转发状态设置为forward状态的时刻;例如,第二预设时长可以设置为5s。
可以看出,在本公开实施例中,通过延时第二预设时长,再执行基于LACP协议的回切操作,在出口方向,将第一端口加入到聚合链路中参与转发;可以理解的是,通过延时第二预设时长的处理,对端网络设备已经将入口转发状态设置为forward状态,从而,可以在第一端口由down状态切换到up状态时链路数据传输不出现丢包,也就是说,可以做到回切不丢包。
这里,情况3可以适用于所有的LACP对接,即,情况3不仅可以适用于网络设备之间基于LACP协议直接端口对接,还可以适用于网络设备之间通过透传其他设备实现基于LACP协议的对接。
进一步地,本公开实施例中,还可以通过以下几种方式实现LACP切换聚合组中成员的删除。
1)提高对所述链路聚合的端口状态的监控频率;在监控到所述链路聚合的第一端口由up状态变为down状态时,在聚合链路中删除所述第一端口。
相关技术中,对所述链路聚合的端口状态的监控周期为200ms,而在本公开实施例中,可以提高对所述链路聚合的端口状态的监控频率,使对所述链路聚合的端口状态的监控周期缩短至10ms,可以理解的是,通过提高对所述链路聚合的端口状态的监控频率,可以在第一端口由up状态切换为down状态时在聚合链路中迅速删除所述第一端口。
2)提高对所述链路聚合的端口状态的监控任务的优先级;在监控到所述链路聚合的第一端口由up状态变为down状态时,在聚合链路中删除所述第一端口。
可以理解的是,通过提高对所述链路聚合的端口状态的监控任务的优先级,可以在第一端口由up状态切换为down状态时在聚合链路中迅速删除所述第一端口。
3)提高对所述链路聚合的端口状态的监控频率,并提高对所述链路聚合的端口状态的监控任务的优先级;在监控到所述链路聚合的 第一端口由up状态变为down状态时,在聚合链路中删除所述第一端口。
相关技术中,对所述链路聚合的端口状态的监控周期为200ms,对所述链路聚合的端口状态的监控任务的优先级较低;而在本公开实施例中,可以提高对所述链路聚合的端口状态的监控频率,提高对所述链路聚合的端口状态的监控任务的优先级,如此,可以在第一端口由up状态切换为down状态时在聚合链路中迅速删除所述第一端口。
实际应用中,网络设备的CPU可以通过独立的高优先级任务高频监控(比如10ms一次)聚合链路的端口状态;如果第一端口从up状态变成down状态,监控任务立刻通知芯片执行链路聚合端口从本地删除,从而做到快速切换;同时监控任务可以通知LACP协议进行链路聚合成员端口本地的删除,从而做到快速切换后保证底层芯片的端口状态和LACP协议中端口状态一致;监控任务通知芯片执行链路聚合端口从本地删除的处理过程独立于LACP协议进行链路聚合成员端口本地的删除的软件处理过程。
实际应用中,步骤301至步骤302可以由网络设备的处理器实现,上述处理器可以为特定用途集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processor,DSP)、数字信号处理装置(Digital Signal Processing Device,DSPD)、可编程逻辑装置(Programmable Logic Device,PLD)、现场可编程门阵列(Field Programmable Gate Array,FPGA)、CPU、控制器、微控制器、微处理器中的至少一种。用于实现上述处理器功能的电子器件还可以为其它,本公开实施例不作具体限定。
第二实施例
为了能够更加体现本公开的目的,在本公开第一实施例的基础上,进行进一步的举例说明。
本公开第二实施例的应用场景为:网络设备A和网络设备B设置的端口为基于LACP协议形成链路聚合的端口,网络设备A和网络设备B上,链路聚合的端口包括端口1、端口2和端口3,端口1、 端口2和端口3形成聚合链路负载转发,端口1从up状态变为down状态。
网络设备A和网络设备B的CPU通过独立的高优先级任务高频监控(比如10ms一次)聚合链路的端口状态;在发现端口1从up状态变为down状态时,立刻通知芯片在聚合组成员中删除端口1,从而做到快速切换。切换时间10ms左右;并且,网络设备A和网络设备B的CPU通知LACP协议进行聚合组成员端口本地的删除,从而使底层芯片中端口状态和LACP协议中端口状态保持一致。
第三实施例
为了能够更加体现本公开的目的,在本公开第一实施例的基础上,进行进一步的举例说明。
本公开第三实施例的应用场景为:网络设备A和网络设备B设置的端口为基于LACP协议形成链路聚合的端口,网络设备A和网络设备B上,链路聚合的端口包括端口1、端口2和端口3,端口1、端口2和端口3形成聚合链路负载转发,端口1和端口2一直处于up状态,端口3从down状态变为up状态。网络设备A和网络设备B之间不一定基于LACP协议直接对接,网络设备A和网络设备B之间可以有基于LACP协议透传的2层网络设备。
网络设备A或网络设备B的CPU通过独立的高优先级任务高频监控(比如10ms一次)聚合链路的端口状态,在发现端口3从down状态变为up状态时,如果在利用LACP协议设置端口状态的时候没有做到收发分离,那么立刻将本端端口3的入口转发状态设置为forward状态,同时,在入口方向将端口3加入到聚合链路,在出口方向,可以按照LACP协议设置端口3的状态,并通过端口3将私有协议报文发送至端口3的对端。
在通过端口3将私有协议报文发送至端口3的对端后,延时100ms,确定对端将对应端口的状态设置为forward状态(在延时100ms时间段中,对端收到了私有协议报文,并通过报文内容将对应端口3的状态设置为forward状态),此时,再执行基于LACP协议 的回切操作,在出口方向,将端口3加入到聚合链路中参与转发;可以理解的是,通过延时100ms的处理,对端网络设备已经将入口转发状态设置为forward状态,从而,可以做到回切不丢包。
第四实施例
为了能够更加体现本公开的目的,在本公开第一实施例的基础上,进行进一步的举例说明。
本公开第四实施例的应用场景为:网络设备A和网络设备B设置的端口为基于LACP协议形成链路聚合的端口,网络设备A和网络设备B上,链路聚合的端口包括端口1、端口2和端口3,端口1、端口2和端口3形成聚合链路负载转发,端口1和端口2一直处于up状态,端口3从down状态变为up状态。网络设备A和网络设备B之间基于LACP协议直接对接,网络设备A和网络设备B之间没有基于LACP协议透传的2层网络设备。
网络设备A或网络设备B的CPU通过独立的高优先级任务高频监控(比如10ms一次)聚合链路的端口状态,在发现端口3从down状态变为up状态时,如果在利用LACP协议设置端口状态的时候做到收发分离,那么LACP聚合组成员端口里面所有端口的入口转发状态一直为forward状态,此时,可以在入口方向将端口3加入到聚合链路,在出口方向,可以按照LACP协议设置端口3的状态;立即设置聚合链路里面的成员端口,在出口方向将端口3加入到聚合链路参与转发;如此,当报文从第一端口转发到对端后,由于对端入口一直处于forward状态,因而,可以做到回切不丢包。
第五实施例
为了能够更加体现本公开的目的,在本公开第一实施例的基础上,进行进一步的举例说明。
本公开第五实施例的应用场景为:网络设备A和网络设备B设置的端口为基于LACP协议形成链路聚合的端口,网络设备A和网络设备B上,链路聚合的端口包括端口1、端口2和端口3,端口1、 端口2和端口3形成聚合链路负载转发,端口1和端口2一直处于up状态,端口3从down状态变为up状态。网络设备A和网络设备B之间不一定基于LACP协议直接对接,网络设备A和网络设备B之间可以有基于LACP协议透传的2层网络设备。
网络设备A或网络设备B的CPU通过独立的高优先级任务高频监控(比如10ms一次)聚合链路的端口状态,在发现端口3从down状态变为up状态时,如果在利用LACP协议设置端口状态的时候没有做到收发分离,那么立刻将本端端口3的入口转发状态设置为forward状态,同时,在入口方向将端口3加入到聚合链路,在出口方向,可以按照LACP协议设置端口3的状态;然后,延时5s(在延时5s时间段中,对端已经将对应端口3的状态设置为forward状态),此时,再执行基于LACP协议的回切操作,在出口方向,将端口3加入到聚合链路中参与转发;可以理解的是,通过延时5s的处理,对端网络设备已经将入口转发状态设置为forward状态,从而,可以做到回切不丢包。
第六实施例
为了能够更加体现本公开的目的,在本公开第一实施例的基础上,进行进一步的举例说明。
本公开第六实施例的应用场景为:网络设备A和网络设备B设置的端口为基于LACP协议形成链路聚合的端口,网络设备A和网络设备B上,链路聚合的端口包括端口1、端口2和端口3,端口1、端口2和端口3形成聚合链路负载转发,端口1、端口2和端口3形成的聚合组记为聚合组100;端口1和端口2一直处于up状态,端口3从down状态变为up状态。在利用LACP协议设置端口状态的时候默认做到收发分离。
由于在利用LACP协议设置端口状态的时候默认做到收发分离,当网络设备A和网络设备B的端口3处于down状态时,在出向聚合组移除端口3,同时出口方向状态为block状态;入口方向默认将端口3加入到聚合组100中,同时,入口方向端口3的状态都为forward 状态;由于在入口方向将端口3加入到聚合链路后,进入端口3的报文就不会在相同的聚合组100里转发,从而可以消除聚合链路之间的环路。
网络设备A和网络设备B的CPU通过独立的高优先级任务高频监控(比如10ms一次)聚合链路的端口状态,在发现端口3从down状态变为up状态时,可以立即设置聚合组100的成员端口,在入口方向将端口3加入到聚合组中,在出口方向,可以按照LACP协议设置端口3的状态;立即设置聚合组里面的成员端口,在出口方向将端口3加入到聚合链路参与转发;如此,当报文从本端端口3转发到对端端口3后,由于对端端口3入口方向一直处于forward状态,因而,可以做到回切不丢包。
第七实施例
在本公开前述实施例提出的链路聚合端口切换方法的基础上,本公开第七实施例提出了一种链路聚合端口切换装置,可以应用上述网络设备中。
图4为本公开实施例的链路聚合端口切换装置的组成结构示意图,如图4所示,该装置可以包括:第一处理模块401和第二处理模块402;其中,
第一处理模块401,配置为在链路聚合的第一端口由down状态变为up状态时,在入口方向将所述第一端口加入到聚合链路,且将所述第一端口的入口转发状态设置为允许转发状态;
第二处理模块402,配置为确定所述第一端口的对端将入口转发状态设置为允许转发状态时,在出口方向将所述第一端口加入到聚合链路。
在一实施方式中,在入口方向和出口方向相互独立地设置链路聚合的每个端口的状态时,链路聚合的每个端口的入口转发状态始终保持为允许转发状态。
在一实施方式中,在入口方向将所述第一端口加入到聚合链路,且将所述第一端口的入口转发状态设置为允许转发状态后,所述第二 处理模块402,还配置为在入口方向和出口方向并非相互独立地设置链路聚合的每个端口的状态时,通过第一端口将私有协议报文发送至所述第一端口的对端,在等待第一预设时长后,确定所述第一端口的对端将入口转发状态设置为允许转发状态。
在一实施方式中,所述第一预设时长大于或等于预先估计的报文传输时长与预先估计的第一状态改变时长之和,所述报文传输时长表示所述私有协议报文从所述第一端口到所述第一端口的对端的传输时长,所述第一状态改变时长表示所述第一端口的对端在接收到所述私有协议报文后将入口转发状态设置为允许转发状态的时长。
在一实施方式中,在入口方向将所述第一端口加入到聚合链路,且将所述第一端口的入口转发状态设置为允许转发状态后,所述第二处理模块402,还配置为在入口方向和出口方向并非相互独立地设置链路聚合的每个端口的状态时,在等待第二预设时长后,确定所述第一端口的对端将入口转发状态设置为允许转发状态。
在一实施方式中,所述第二预设时长大于或等于预先估计的第二状态改变时长,所述第二状态改变时长为第一时刻与第二时刻的时间间隔,所述第一时刻为所述第一端口由down状态变为up状态的时刻,所述第二时刻为所述第一端口的对端将入口转发状态设置为允许转发状态的时刻。
在一实施方式中,所述第二处理模块402,还配置为提高对所述链路聚合的端口状态的监控频率;在监控到所述链路聚合的第一端口由up状态变为down状态时,在聚合链路中删除所述第一端口。
在一实施方式中,所述第二处理模块402,还用于提高对所述链路聚合的端口状态的监控任务的优先级;在监控到所述链路聚合的第一端口由up状态变为down状态时,在聚合链路中删除所述第一端口。
在一实施方式中,所述第二处理模块402,还用于提高对所述链路聚合的端口状态的监控频率,并提高对所述链路聚合的端口状态的监控任务的优先级;在监控到所述链路聚合的第一端口由up状态变为down状态时,在聚合链路中删除所述第一端口。
实际应用中,上述第一处理模块401和第二处理模块402均可 由CPU、微处理器(Micro Processor Unit,MPU)、DSP、或FPGA等实现。
另外,在本实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
具体来讲,本实施例中的一种链路聚合端口切换方法对应的计算机程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种链路聚合端口切换方法对应的计算机程序指令被一电子设备读取或被执行时,实现前述实施例的任意一种链路聚合端口切换方法的步骤。
基于前述实施例相同的技术构思,参见图5,其示出了本公开实施例提供的一种网络设备50,该设备可以包括:链路聚合的第一端口(图中未示出)、存储器51和处理器52;其中,所述存储器51,配置为存储计算机程序和数据;所述处理器52,配置为执行所述存储器中存储的计算机程序,以实现前述实施例的任意一种链路聚合端口切换方法的步骤。
在实际应用中,上述存储器51可以是易失性存储器(volatile memory),例如RAM;或者非易失性存储器(non-volatile memory),例如ROM,快闪存储器(flash memory),硬盘(Hard Disk Drive, HDD)或固态硬盘(Solid-State Drive,SSD);或者上述种类的存储器的组合,并向处理器52提供指令和数据。
上述处理器52可以为ASIC、DSP、DSPD、PLD、FPGA、CPU、控制器、微控制器、微处理器中的至少一种。用于实现上述处理器功能的电子器件还可以为其它,本公开实施例不作具体限定。
根据本公开实施例提供的链路聚合端口切换方法、网络设备和计算机存储介质,可以实现链路聚合端口在链路汇聚控制协议(Link Aggregation Control Protocol,LACP)链路快速切换和无损回切,,可以避免端口由down状态切换到up状态时出现丢包。
本领域内的技术人员应明白,本公开的实施例可提供为方法、系统、或计算机程序产品。因此,本公开可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本公开可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本公开是参照根据本公开实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产 生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本公开的示例性实施例而已,并非用于限定本公开的保护范围。

Claims (11)

  1. 一种链路聚合端口切换方法,包括:
    响应于链路聚合的第一端口由down状态变为up状态,在入口方向将所述第一端口加入到聚合链路,且将所述第一端口的入口转发状态设置为允许转发状态;
    响应于确定所述第一端口的对端将入口转发状态设置为允许转发状态,在出口方向将所述第一端口加入到聚合链路。
  2. 根据权利要求1所述的方法,其中,在入口方向和出口方向相互独立地设置链路聚合的每个端口的状态时,链路聚合的每个端口的入口转发状态始终保持为允许转发状态。
  3. 根据权利要求1所述的方法,其中,在入口方向将所述第一端口加入到聚合链路,且将所述第一端口的入口转发状态设置为允许转发状态后,所述方法还包括:
    在入口方向和出口方向并非相互独立地设置链路聚合的每个端口的状态时,通过所述第一端口将私有协议报文发送至所述第一端口的对端,在等待第一预设时长后,确定所述第一端口的对端将入口转发状态设置为允许转发状态。
  4. 根据权利要求3所述的方法,其中,所述第一预设时长大于或等于预先估计的报文传输时长与预先估计的第一状态改变时长之和,所述报文传输时长表示所述私有协议报文从所述第一端口到所述第一端口的对端的传输时长,所述第一状态改变时长表示所述第一端口的对端在接收到所述私有协议报文后将入口转发状态设置为允许转发状态的时长。
  5. 根据权利要求1所述的方法,其中,在入口方向将所述第一端口加入到聚合链路,且将所述第一端口的入口转发状态设置为允许转发状态后,所述方法还包括:
    在入口方向和出口方向并非相互独立地设置链路聚合的每个端口的状态时,在等待第二预设时长后,确定所述第一端口的对端将入口转发状态设置为允许转发状态。
  6. 根据权利要求5所述的方法,其中,所述第二预设时长大于或等于预先估计的第二状态改变时长,所述第二状态改变时长为第一时刻与第二时刻的时间间隔,所述第一时刻为所述第一端口由down状态变为up状态的时刻,所述第二时刻为所述第一端口的对端将入口转发状态设置为允许转发状态的时刻。
  7. 根据权利要求1至6任一项所述的方法,还包括:
    提高对所述链路聚合的端口状态的监控频率;
    响应于监控到所述链路聚合的第一端口由up状态变为down状态,在所述聚合链路中删除所述第一端口。
  8. 根据权利要求1至6任一项所述的方法,还包括:
    提高对所述链路聚合的端口状态的监控任务的优先级;
    响应于监控到所述链路聚合的第一端口由up状态变为down状态,在所述聚合链路中删除所述第一端口。
  9. 根据权利要求1至6任一项所述的方法,还包括:
    提高对所述链路聚合的端口状态的监控频率,并提高对所述链路聚合的端口状态的监控任务的优先级;
    响应于监控到所述链路聚合的第一端口由up状态变为down状态,在所述聚合链路中删除所述第一端口。
  10. 一种网络设备,包括链路聚合的第一端口、处理器和用于存储能够在处理器上运行的计算机程序的存储器;其中,
    所述处理器用于运行所述计算机程序时,执行权利要求1至9任一项所述方法的步骤。
  11. 一种计算机存储介质,其上存储有计算机程序,其中,该计算机程序被处理器执行时实现权利要求1至9任一项所述方法的步骤。
PCT/CN2020/075504 2019-02-18 2020-02-17 链路聚合端口切换方法、网络设备和计算机存储介质 WO2020168996A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP20759906.9A EP3930267A4 (en) 2019-02-18 2020-02-17 LINK AGGREGATION PORT SWITCHING METHOD, NETWORK DEVICE AND COMPUTER STORAGE MEDIA

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910122286.3A CN111585883B (zh) 2019-02-18 2019-02-18 一种链路聚合端口切换方法、网络设备和计算机存储介质
CN201910122286.3 2019-02-18

Publications (1)

Publication Number Publication Date
WO2020168996A1 true WO2020168996A1 (zh) 2020-08-27

Family

ID=72126003

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/075504 WO2020168996A1 (zh) 2019-02-18 2020-02-17 链路聚合端口切换方法、网络设备和计算机存储介质

Country Status (3)

Country Link
EP (1) EP3930267A4 (zh)
CN (2) CN116366536A (zh)
WO (1) WO2020168996A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111131024A (zh) * 2019-12-09 2020-05-08 盛科网络(苏州)有限公司 聚合链路的处理方法及装置
CN115567463A (zh) * 2021-06-30 2023-01-03 中兴通讯股份有限公司 一种端口状态调整方法、装置及计算机可读存储介质
CN115996191A (zh) * 2022-11-21 2023-04-21 迈普通信技术股份有限公司 端口状态控制方法、装置、网络通信设备及存储介质
CN115865772A (zh) * 2022-11-25 2023-03-28 迈普通信技术股份有限公司 流量回切方法、装置、电子设备、m-lag系统及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101540722A (zh) * 2008-03-18 2009-09-23 华为技术有限公司 以太网链路聚合端口配置的方法和设备
CN103780472A (zh) * 2014-01-06 2014-05-07 杭州华三通信技术有限公司 一种聚合端口组的选中口管理方法及设备
US20140192817A1 (en) * 2013-01-04 2014-07-10 International Business Machines Corporation Virtual link aggregation using state machine
CN103944776A (zh) * 2014-03-26 2014-07-23 杭州华三通信技术有限公司 一种自环链路聚合的方法和装置
CN106411599A (zh) * 2016-10-31 2017-02-15 杭州华三通信技术有限公司 一种聚合链路恢复方法及装置

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8243594B1 (en) * 2007-12-10 2012-08-14 Force10 Networks, Inc. Coordinated control of multiple parallel links or link aggregations
CN101252532B (zh) * 2008-03-18 2010-08-25 华为技术有限公司 以太网链路聚合端口配置的方法和设备
CN101552725B (zh) * 2009-05-13 2011-12-21 杭州华三通信技术有限公司 聚合子链路恢复处理方法、系统及设备
JP5821815B2 (ja) * 2012-09-11 2015-11-24 日立金属株式会社 通信システムおよび通信システムの処理方法
US20140192635A1 (en) * 2013-01-04 2014-07-10 International Business Machines Corporation Start-up delay for event-driven virtual link aggregation
US10298435B2 (en) * 2015-06-08 2019-05-21 Quanta Computer Inc. Server link state detection and notification
CN106301871A (zh) * 2015-06-25 2017-01-04 中兴通讯股份有限公司 一种基于lacp的转发检测方法及系统
CN107465613B (zh) * 2016-06-03 2020-11-06 北京华为数字技术有限公司 链路聚合接口通信状态切换方法及装置
CN106534331B (zh) * 2016-11-30 2019-10-11 网宿科技股份有限公司 一种基于动态端口切换的数据传输方法和系统
CN106789264B (zh) * 2016-12-26 2019-12-03 北京东土军悦科技有限公司 一种链路聚合组通道快速切换的方法和装置
JP6740911B2 (ja) * 2017-01-16 2020-08-19 富士通株式会社 ポート切替プログラム、ポート切替方法、および情報処理装置
US20180307474A1 (en) * 2017-04-19 2018-10-25 Hewlett Packard Enterprise Development Lp Firmware update in a stacked network device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101540722A (zh) * 2008-03-18 2009-09-23 华为技术有限公司 以太网链路聚合端口配置的方法和设备
US20140192817A1 (en) * 2013-01-04 2014-07-10 International Business Machines Corporation Virtual link aggregation using state machine
CN103780472A (zh) * 2014-01-06 2014-05-07 杭州华三通信技术有限公司 一种聚合端口组的选中口管理方法及设备
CN103944776A (zh) * 2014-03-26 2014-07-23 杭州华三通信技术有限公司 一种自环链路聚合的方法和装置
CN106411599A (zh) * 2016-10-31 2017-02-15 杭州华三通信技术有限公司 一种聚合链路恢复方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3930267A4 *

Also Published As

Publication number Publication date
CN116366536A (zh) 2023-06-30
EP3930267A4 (en) 2022-11-02
CN111585883A (zh) 2020-08-25
CN111585883B (zh) 2023-03-24
EP3930267A1 (en) 2021-12-29

Similar Documents

Publication Publication Date Title
WO2020168996A1 (zh) 链路聚合端口切换方法、网络设备和计算机存储介质
US9503361B2 (en) Active/static path redundancy
KR101434375B1 (ko) 플로우 통신 시스템
CA3090903C (en) Packet sending method and related device
TWI761330B (zh) 通訊通道處理方法和系統
WO2017041577A1 (zh) 一种管理链路聚合成员端口丢包的方法和装置
EP3993330A1 (en) Flow rate control method and apparatus
TW201342079A (zh) 於晶載網路上之流量控制技術
JP5065269B2 (ja) ローカル・エリア・ネットワーク管理
CN112822102A (zh) 链路切换方法、装置、设备、系统及存储介质
CN113746743A (zh) 一种数据报文传输方法及装置
WO2022242170A1 (zh) 一种数据处理方法以及相关设备
Wang et al. Predictable vFabric on informative data plane
WO2016169214A1 (zh) 一种隧道保护切换的方法和装置
US8837506B2 (en) Data transfer device
WO2023236874A1 (zh) 通信链路的检测方法及装置
WO2017206785A1 (zh) 一种网元、保护倒换方法及其系统、存储介质
EP3694152B1 (en) Method for recovering faulty multi-layer link and controller
JP5592301B2 (ja) クライアント装置、通信システム、生存確認方法、及びプログラム
WO2015162619A1 (en) Managing link failures in software defined networks
US20220166721A1 (en) Traffic balancing method, network device, and electronic device
WO2020103586A1 (zh) 一种堆叠系统中多主检测方法及堆叠系统
JP5813835B2 (ja) クライアント装置、及び通信システム
JP6405679B2 (ja) パケット転送システムおよびパケット転送方法
WO2023273838A1 (zh) 基于bfd技术建立会话的方法、装置、网络设备及计算机存储介质

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: 20759906

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020759906

Country of ref document: EP

Effective date: 20210920