WO2019000952A1 - 一种实现Mux机的方法、设备及系统 - Google Patents

一种实现Mux机的方法、设备及系统 Download PDF

Info

Publication number
WO2019000952A1
WO2019000952A1 PCT/CN2018/075609 CN2018075609W WO2019000952A1 WO 2019000952 A1 WO2019000952 A1 WO 2019000952A1 CN 2018075609 W CN2018075609 W CN 2018075609W WO 2019000952 A1 WO2019000952 A1 WO 2019000952A1
Authority
WO
WIPO (PCT)
Prior art keywords
network device
state
port
aggregation
aggregation port
Prior art date
Application number
PCT/CN2018/075609
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 EP18824623.5A priority Critical patent/EP3633931B1/en
Publication of WO2019000952A1 publication Critical patent/WO2019000952A1/zh
Priority to US16/727,596 priority patent/US11258666B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1069Session establishment or de-establishment
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/54Store-and-forward switching systems 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0895Configuration of virtualised networks or elements, e.g. virtualised network function or OpenFlow elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • 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
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/32Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/14Multichannel or multilink protocols
    • 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 present application relates to the field of communications technologies, and in particular, to a method, device, and system for implementing a multiplexing (English: Mux) machine. More specifically, the present application relates to a technology for implementing a Mux machine in a network running Link Aggregation Control Protocol (LACP).
  • LACP Link Aggregation Control Protocol
  • the LACP provides a standard negotiation mode for network devices that implement data exchange.
  • the network devices at both ends of the LACP can automatically form an aggregation link according to its configuration and use the aggregation link to send and receive data. After the aggregation link is formed, the network devices at both ends of the aggregation link are responsible for maintaining the link state. When the aggregation conditions change, the link aggregation is automatically adjusted or dissipated.
  • the LACP state machine maintains the aggregation status of each aggregation port based on the port and the aggregation status of each aggregation port.
  • the LACP state machine exchanges LACP packets with other network devices and calls the aggregation port to perform aggregation group and aggregation member management.
  • the LACP state machine includes a receiving state machine (English: Receive machine, abbreviation: RX machine), a periodic transmitter (English: Periodic Transmission machine, abbreviation: PTX machine), a selection logic (English: Selection Logic), a Mux machine (English: Mux Machine) and transmitter (English: Transmission machine, abbreviation: TX machine).
  • the Mux machine is used to attach the aggregation port to the selected aggregator (English: aggregator), separate the aggregation port from the unselected aggregator, and open or close the collection and distribution of the aggregation port based on the current protocol information. status.
  • the network device runs a Mux machine associated with the aggregate port of the network device.
  • the network device switches the Mux machine of the aggregation port of the network device from an attached (English: ATTACHED) state to a collection and distribution (English: COLLECTING_DISTRIBUTING) state.
  • the network device cannot ensure that the Mux machine associated with the aggregation port of the peer network device of the network device is in the COLLECTING_DISTRIBUTING state.
  • an aggregated link between the network device and the peer network device may be in a state where the aggregation port of one end is in a collection and distribution state, and the aggregation port at the other end is not in a collection and distribution state. As a result, traffic is lost.
  • the embodiments of the present application provide a method, a device, and a system for implementing a Mux machine, which are used in a network running LACP to implement detection and processing of aggregation port states of two ends of an aggregation link in a Mux machine. Helps reduce packet loss caused by traffic during transmission.
  • a method of implementing a Mux machine is provided.
  • the method is applied to a network running LACP, the network comprising a first network device and a second network device, the first aggregation port of the first network device being connected to the second network device by a second Aggregate port connections.
  • the first network device sets a PROTECT_WAITING state in a Mux machine of the first aggregation port, where the PROTECT_WAITING state is used to identify that the first aggregation port is not in a collection and distribution state, but is advertised to other network devices
  • the state of the first aggregation port is the collection and distribution status.
  • the first network device determines that the first aggregation port is not in a collection and distribution state, and sends a first LACPDU message to the two network devices, where the first The LACPUD packet is used to notify the second network device that the first aggregation port is in a collection and distribution state, and triggers the second network device to set the second aggregation port to a collection and distribution state. Then, the first network device determines whether a second LACPDU packet from the second network device is received, where the second LACPDU message is used to indicate that the second aggregation port is in a collection and distribution state.
  • the first network device switches the Mux machine from the PROTECT_WAITING state to a COLLECTING_DISTRIBUTING state, and sets the first aggregation port For collection and distribution status.
  • the first network sets a PROTECT_WAITING state in the Mux machine of the first aggregation port.
  • the first network device determines that the first aggregation port is not in a collection and distribution state. Then, the first network device sends, to the two network devices, a first LACPDU message that announces that the first aggregation port is in a collection and distribution state.
  • the first network device determines that the second LACPDU packet from the second network device is used to indicate that the second aggregation port is in a collection and distribution state
  • the first network device The Mux machine is switched from the PROTECT_WAITING state to the COLLECTING_DISTRIBUTING state, and the first aggregation port is set to a collection and distribution state.
  • the implementation of the present application implements the detection and processing of the aggregated port single-port UP in the Mux machine, thereby helping to reduce packet loss caused by the service traffic during the transmission process.
  • the method further includes: receiving, by the first network device, The third LACPDU packet of the second network device. Determining, by the first network device, that the first aggregation port is in a selected state, and determining that the second aggregation port is in a synchronization state according to the third LACPDU packet, and determining, according to the third LACPDU packet, When the second aggregation port is not in the collection and distribution state, the first network device switches the Mux machine from the ATTACHED state to the PROTECT_WAITING state.
  • the first network device detects the synchronization status of the second aggregation port by using the second LACPDU packet, and detects the collection and collection of the second aggregation port by using the second LACPDU packet.
  • the status is distributed to ensure that after the Mux machine enters the PROTECT_WAITING state, detection of the second aggregate port from being in the collection and distribution state to being in the collection and distribution state is initiated.
  • the first network device determines, according to the third LACPDU packet, that the second aggregation port is in a synchronization state, and specifically includes: determining, by the first network device The first information included in the third LACPDU packet is matched with the second information that the first network device stores the first aggregation port, where the first information includes a peer port (English: Partner_Port), and the peer port takes precedence.
  • the second information includes the local port number (English: Actor_Port_Number), the local port priority (English: Actor_Port_Priority), the local system (English: Actor_System), the local system priority (English: Actor_System_Priority), the local operating port
  • the keyword English: Actor_Oper_Port_Key
  • the first network device determines that the local state synchronization Actor_State.Synchronization included in the third LACPDU packet is in a synchronized state.
  • the method further includes: when the first network device determines, according to the third LACPDU packet, that the second aggregation port is in a synchronization state, and according to the When the third LACPDU packet determines that the second aggregation port is in the collection and distribution state, the first network device switches the Mux machine from the ATTACHED state to the COLLECTING_DISTRIBUTING state, and the first aggregation port Set to collect and distribute status.
  • the first network device quickly enters the state of dual port collection and distribution when determining that the second aggregation port is in the collection and distribution state, which helps reduce the loss of traffic generated during the transmission process. package.
  • the method further includes: the first network device receiving a fourth LACPDU message from the second network device, where the fourth LACPDU message is used Indicates that the second aggregation port is not in a collection and distribution state. And when the first network device determines, according to the fourth LACPDU message, that the second aggregation port is not in a collection and distribution state, switching the Mux machine from the COLLECTING_DISTRIBUTING state to the PROTECT_WAITING state.
  • the first network device After the first network device receives the third LACPDU message indicating that the second aggregation port is in the collection and distribution state, the first network device switches the Mux machine to the PROTECT_WAITING state in time to help reduce the Packet loss caused by traffic during transmission.
  • the method further includes: when the first network device determines that at least one of the following conditions is met, switching the Mux machine from the PROTECT_WAITING state to the ATTACHED state: the first network device determines that the first aggregation port is in an unselected state; the first network device determines that the first aggregation port is in a standby state; and the first network device receives from the The fifth LACPDU packet of the second network device, and determining, according to the fifth LACPDU packet, that the second aggregation port is not in a synchronization state.
  • the first network device includes a timer, where the Mux machine of the first aggregation port is in a PROTECT_WAITING state
  • the method further includes: the first network The device starts the timer; until the timer expires, the first network device determines that the second LACPDU packet from the second network device is not received, and the first network device uses the Mux The machine is switched from the PROTECT_WAITING state to the ATTACHED state.
  • the method further includes: when the Mux machine is in a PROTECT_WAITING state, and the timer expires, the first network device sets the aggregation link
  • the single-port UP is used to indicate that one end of the aggregated link is in the collection and distribution state, and the other end of the aggregation port is not in the collection and distribution state.
  • the first network device sets the value of the single port UP flag bit to FALSE.
  • the duration of the timer is greater than or equal to 3 seconds, and the duration of the timer is less than or equal to 90 seconds.
  • a first network device having a function of implementing behavior of a first network device in the above method.
  • the functions may be implemented based on hardware, or may be implemented based on hardware.
  • the hardware or software includes one or more modules corresponding to the functions described above.
  • the first network device includes a processor and an interface configured to support the first network device to perform a corresponding function in the above method.
  • the interface is configured to support communication between the first network device and the second network device, send information or instructions involved in the foregoing method to the second network device, or receive information involved in the foregoing method from the second network device. Or instructions.
  • the first network device can also include a memory for coupling with a processor that retains program instructions and data necessary for the first network device.
  • the first network device includes: a processor, a transmitter, a random access memory, a read only memory, and a bus.
  • the processor is respectively coupled to the transmitter, the random access memory, and the read only memory through a bus.
  • the first network device is booted into a normal running state by booting in a basic input/output system in a read-only memory or a bootloader booting system in an embedded system.
  • the application and operating system are run in a random access memory such that the processor performs the method of the first aspect or any possible implementation of the first aspect.
  • a first network device in a third aspect, includes: a main control board and an interface board, and further, a switching network board.
  • the first network device is operative to perform the method of the first aspect or any possible implementation of the first aspect.
  • the first network device comprises means for performing the method of the first aspect or any possible implementation of the first aspect.
  • a first network system comprising a controller and a first forwarding device.
  • the first forwarding device includes: an interface board, and further, may further include a switching network board.
  • the first forwarding device is configured to perform the function of the interface board in the third aspect. Further, the function of the switching network board in the third aspect may also be performed.
  • the controller includes a receiver, a processor, a transmitter, a random access memory, a read only memory, and a bus.
  • the processor is coupled to the receiver, the transmitter, the random access memory, and the read only memory through a bus.
  • a fifth aspect provides a network system for implementing a Mux machine, where the network system includes a first network device and a second network device, where the first network device and/or the second network device is the foregoing third or fourth Aspect or first network device in the fifth aspect.
  • a computer storage medium for storing a program, code or instruction for use in the first network device, and the processor or the hardware device can perform the first of the above aspects when executing the program, code or instruction.
  • the function or step of a network device is provided for storing a program, code or instruction for use in the first network device, and the processor or the hardware device can perform the first of the above aspects when executing the program, code or instruction.
  • the first network sets a PROTECT_WAITING state in the Mux machine of the first aggregation port.
  • the first network device determines that the first aggregation port is not in a collection and distribution state. Then, the first network device sends, to the two network devices, a first LACPDU message that announces that the first aggregation port is in a collection and distribution state.
  • the first network device determines that the second LACPDU packet from the second network device is used to indicate that the second aggregation port is in a collection and distribution state
  • the first network device The Mux machine is switched from the PROTECT_WAITING state to the COLLECTING_DISTRIBUTING state, and the first aggregation port is set to a collection and distribution state.
  • the implementation of the present application implements the detection and processing of the aggregated port single-port UP in the Mux machine, thereby helping to reduce packet loss caused by the service traffic during the transmission process.
  • FIG. 1 is a schematic structural diagram of a network running LACP according to an embodiment of the present application
  • FIG. 2 is a state diagram of a Mux machine according to an embodiment of the present application.
  • FIG. 3 is a flowchart of a method for implementing a Mux machine according to an embodiment of the present application
  • FIG. 4 is a state diagram of another Mux machine according to an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a first network device according to an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of hardware of a first network device according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of hardware of another first network device according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of hardware of a first network system according to an embodiment of the present application.
  • TRUE means "true” or “conditional establishment”. In computer coding, the value of TRUE may be "1"; FALSE means “false” or “condition is not established", in computer coding, FALSE The value can be "0".
  • UP indicates that the port is open or available, that is, the port is allowed to send and receive data packets; DOWN indicates that the port is closed or unavailable, that is, the port is not allowed to send and receive data packets.
  • “determining” may include a manner implemented by “setting” means, or a manner implemented by “holding” means.
  • FIG. 1 is a schematic diagram of a network structure for running LACP according to an embodiment of the present application.
  • the network includes a first network device and a second network device.
  • the first network device communicates with the second network device via a link aggregation group (English: Link Aggregation Group, abbreviated: LAG).
  • the LAG includes at least one aggregation link (English: aggregation link).
  • the LAG includes an aggregated link 1
  • the first network device communicates with the second network device via the aggregated link 1.
  • One end of the aggregation link 1 is an aggregation port 11 on the first network device, and the other end of the aggregation link 1 is an aggregation port 21 on the second network device.
  • An aggregator 1 on the first network device and an aggregator 2 on the second network device are associated with the LAG.
  • the aggregator 1 and the aggregator 2 are respectively configured to manage an aggregation port of the aggregation link included in the LAG.
  • the aggregator1 manages the aggregation port 11
  • the aggregator2 manages the aggregation port 21.
  • the network further includes a third network device that communicates with the second network device via LAG1, the first network device communicating with the third device via LAG2.
  • Other network devices may be included between the two network devices connected via the LAG.
  • the LAG between the first network device and the second network device includes a switch.
  • the first network device and the second network device may be physical devices, and the physical devices include routers or switches. Both the first network device and the second network device can be connected to other network devices.
  • the first network device is connected to a client and the second network device is connected to a server. The client communicates with the server via the network shown in FIG.
  • the network device may include one or more aggregators.
  • the number of aggregators included in the network device may be more than, less than, or equal to the number of aggregate ports included in the network device.
  • the same aggregation port on the network device can belong to different aggregators at the same time.
  • each aggregation port of the first network device and the second network device is associated with an LACP state machine.
  • the aggregation port 11 is associated with the LACP state machine 11
  • the aggregation port 21 is associated with the LACP state machine 21.
  • the LACP state machine can be understood as the LACP state machine implemented by each of the first network device and the second network device on each aggregation interface.
  • the LACP state machine includes a receiving state machine (English: Receive machine, abbreviation: RX machine), a periodic transmitter (English: Periodic Transmission machine, abbreviation: PTX machine), a selection logic (English: Selection Logic), a Mux machine (English) :Mux machine) and transmitter (English: Transmission machine, abbreviation: TX machine).
  • a receiving state machine English: Receive machine, abbreviation: RX machine
  • PTX machine Periodic Transmission machine
  • selection logic English: Selection Logic
  • Mux machine English
  • TX machine Transmission machine
  • the Mux machine is implemented by using the aggregate link 1 in FIG. 1 as an example for description.
  • One end of the aggregation link 1 is an aggregation port 11 on the first network device
  • the other end of the aggregation link 1 is an aggregation port 21 on the second network device.
  • a Mux machine is implemented on the aggregation port 11 and the aggregation port 21, respectively.
  • the first network device implements a Mux machine on the aggregation port 11
  • the second network device implements a Mux machine on the aggregation port 21.
  • Figure 2 shows a state diagram of a Mux machine in a coupled control mode. As shown in FIG.
  • the Mux machine includes four states: DETACHED, WAITING, ATTACHED, and COLLECTING_DISTRIBUTING.
  • the first network device in the Mux machine implemented on the aggregation port 11, the first network device is regarded as a local end (English: actor), and the second network device is regarded as a peer end (English: partner
  • the second network device is regarded as an actor
  • the first network device is regarded as a partner.
  • "+” means "or” and "*” means "and”.
  • the first network device implements the Mux machine on the aggregation port 11, and enters the DETACHED state by default when initializing. When the Mux machine is in the DETACHED state, the first network device performs the following processing:
  • the local operation port synchronization state (English: Actor_Oper_Port_State.Synchronization, abbreviation: Actor.Sync) is determined to be FALSE, indicating that the aggregation port 11 of the first network device is not in a synchronization state, or may be considered as an unsynchronized state.
  • the Actor.Sync is used to indicate the synchronization status of the aggregation port 11 of the first network device.
  • the local operation port distribution status (English: Actor_Oper_Port_State.Distributing, abbreviation: Actor.Distributing) is determined to be FALSE, indicating that the aggregation port 11 is not in a distribution state, or may be considered as a non-distribution state.
  • the Actor.Distributing is used to indicate the distribution status of the aggregation port 11.
  • the local operation port collection state (English: Actor_Oper_Port_State.Collecting, abbreviation: Actor.Collecting) is determined to be FALSE, indicating that the aggregation port 11 is not in the collection state, or may be considered as not collecting the state.
  • the Actor.Collecting is used to indicate the collection status of the aggregation port 11.
  • NTT Need To Transmit
  • LACPDU Link Aggregation Control Protocol data unit
  • two fields may be used to respectively indicate the distribution status and collection status of the local operation port, such as Actor.Collecting and Actor.Distributing in the above; or a field may be used to indicate the distribution of the local operation port.
  • Status and collection status such as Actor.Collecting_Distributing.
  • the manner indicated by the Collecting and Distributing fields and the manner of using the Collecting_Distributing indication may be expressed as “collection and distribution status”. That is, the manner in which the Collecting and Distributing fields are respectively indicated and the manner in which the Collecting_Distributing is used are both "collection and distribution status" implementations.
  • the SELECTED state is used to indicate that a suitable aggregator is selected.
  • the STANDBY state is used to indicate that a suitable aggregator is selected, and the port associated with the aggregator does not enable the aggregation function.
  • the first network device performs the following process: a start wait time timer (English: wait_while_timer).
  • a start wait time timer English: wait_while_timer.
  • the first network device switches the Mux machine from the WAITING state to the DETACHED state.
  • the UNSELECTED state may be triggered by Selection Logic or by an RX machine.
  • the first network device switches the Mux machine from the WAITING state to the ATTACHED state. Wherein, if in the WAITING state, the aggregation port 11 is in the SELECTED state, when the wait_while_timer times out, the first network device determines the Ready state as TRUE. Wherein, the Ready state is determined to indicate that the wait_while_timer times out and waits for the aggregate port to be attached to the aggregator.
  • the first network device attaches the aggregated port 11 to the aggregator 1, and after completing the attaching process, performs the following process: determining the Actor.Sync as TRUE, indicating The aggregation port 11 of the first network device is in a synchronized state.
  • the Actor.Collecting is determined to be FALSE, indicating that the aggregation port 11 is not in the collection state.
  • the Actor.Distributing is determined to be FALSE, indicating that the aggregated port 11 is not in a distributed state.
  • the NTT is determined to be TRUE.
  • the first network device If the first network device receives the trigger event, causing the first network device to determine the aggregation port 11 as an UNSELECTED state or a STANDBY state, the first network device switches the Mux machine from the ATTACHED state to the DETACHED state. . After the Mux machine enters the DETACHED state, the first network device separates the aggregation port 11 from the aggregator 1, and determines corresponding state information of the aggregation port 11 as indicated in the DETACHED state in FIG. status.
  • the first network device switches the Mux machine from the ATTACHED state. For the COLLECTING_DISTRIBUTING state.
  • the Partner.Sync is determined to be TRUE, the first network device determines that the aggregation port 21 of the second network device is in a synchronization state, and the Partner.Sync is used to instruct the first network device to determine the The synchronization state of the aggregation port 21.
  • the determining that the Partner.Sync is TRUE may be interpreted as: the first network device learns that the aggregation port 21 is in a synchronization state, and the first network device approves the synchronization state of the aggregation port 21 .
  • the first network device determines the status of the Partner.Sync according to the LACPDU message received from the second network device.
  • the Mux machine is in the COLLECTING_DISTRIBUTING state
  • the first network device performs the following process: determining the Actor.Collecting as TRUE, indicating that the aggregation port 11 is in a collection state.
  • the Actor.Distributing is determined to be TRUE, indicating that the aggregation port 11 is in a distribution state.
  • the NTT is determined to be TRUE.
  • the Mux machine After the Mux machine enters the COLLECTING_DISTRIBUTING state, the first network device sets the aggregation port 11 to UP according to the aggregation port 11 in the collection and distribution state, so that the first network device allows the aggregation. Port 11 receives and transmits data messages.
  • the first network device receives the trigger event, causing the aggregation port 11 to be determined to be the UNSELECTED state or the STANDBY state, or causing the Partner.Sync to be determined to be FALSE, the first network device will be the Mux machine The COLLECTING_DISTRIBUTING state is switched to the ATTACHED state. Wherein, Partner.Sync is determined to be FALSE, indicating that the first network device determines that the aggregation port 21 of the second network device is not in a synchronized state.
  • the Mux machine shown in FIG. 2 can be applied to each of the aggregation ports of the first network device and the second network device.
  • the first network device implements the Mux machine shown in FIG. 2 on the aggregation port 11, and after the Mux machine enters the COLLECTING_DISTRIBUTING state, the first network device cannot ensure the aggregation port 21 of the second network device.
  • the above implemented Mux machine is also in the COLLECTING_DISTRIBUTING state.
  • the Mux machine on the aggregation port 21 cannot enter the COLLECTING_DISTRIBUTING state. This will cause the aggregation port 11 of the aggregation link 1 to be in the UP state and receive and send data packets.
  • the aggregation port 21 of the aggregation link 1 is in the DOWN state and cannot receive and send data packets. Therefore, the aggregation link 1 has an aggregation port at one end in the collection and distribution state, and the aggregation port on the other end is not in the collection and distribution state, or it can be considered that the aggregation port at one end of the aggregation link is UP and the aggregation port at the other end is aggregated. Is DOWN. The data packets sent from the aggregation port on the aggregation link cannot be received by the aggregation port on the aggregation link. The traffic is lost.
  • the aggregation port of one end of the aggregation link is in the collection and distribution state, and the aggregation port of the other end is not in the collection and distribution state, which may be referred to as a single port UP (English: Single-port_UP), that is, The aggregation port on one end of the aggregation link is UP, and the aggregation port on the other end is DOWN.
  • This can be called single-port UP.
  • the second network device is abnormal, which may be caused by a difference in implementation of network devices of different vendors or a network device failure or a link failure.
  • the error is, for example, an error occurs in the local system (English: Actor_System) or the local interface (English: Actor_Port) carried in the second LACPDU packet.
  • the Actor_System in the second LACPDU is used to indicate the system identifier of the second network device, and the Actor_Port is used to indicate the port number assigned by the second network device to the aggregation port.
  • the reason that the second LACPDU packet is incorrect may include: the second LACPDU packet is incorrect due to a failure of the other network device on the link between the first network device and the second network device, The second network device sends the second LACPDU packet to the forwarding plane from the control plane to the forwarding plane because the fault causes the second LACPDU packet to be incorrect, or the first network device reports the second LACPDU.
  • the second LACPDU packet is incorrect due to a fault in the process of reporting the packet from the forwarding plane to the control plane.
  • the first network device saves the status information of the second network device that is in error according to the actor status information in the second LACPDU, and the partner identified by the first network device according to the second LACPDU message is not the a second network device, but a second network device that is erroneous; the second network device saves the correct state information of the first network device according to the actor state information in the first LACPDU, and the second network device according to the The partner identified by the first LACPDU message is the correct first network device.
  • the first network device receives the LACPDU packet from the second network device again.
  • the LACPDU packet may be a correct LACPDU packet, or may be different from the second LACPDU packet.
  • An erroneous LACPDU packet is used to switch the state of the Mux machine to the COLLECTING_DISTRIBUTING state according to the partner status information in the LACPDU message from the second network device.
  • the status information of the second network device determines that the Mux machine does not enter the COLLECTING_DISTRIBUTING state.
  • the aggregation port of the first network device enters a steady state UP state, and the aggregation port of the second network device at the other end of the aggregation link is in the DOWN state, and a single port UP occurs on the aggregation link, causing service traffic. Lose the package.
  • the embodiment of the present application redesigns the Mux machine shown in FIG. 2, and the Mux machine can be applied to the network structure shown in FIG. 1.
  • the first network sets a protection wait (English: PROTECT_WAITING) state in the Mux machine of the first aggregation port.
  • PROTECT_WAITING a protection wait
  • the first network device determines that the first aggregation port is not in a collection and distribution state.
  • the first network device sends a first LACPDU message to the two network devices, where the first LACPUD message is used to notify the second network device that the first aggregation port is in a collection and distribution state, and The second network device is triggered to set the second aggregation port to a collection and distribution state. And, when the first network device determines that the second LACPDU packet from the second network device is used to indicate that the second aggregation port is in a collection and distribution state, the first network device The Mux machine is switched from the PROTECT_WAITING state to the COLLECTING_DISTRIBUTING state, and the first aggregation port is set to a collection and distribution state.
  • the implementation of the present application implements the detection and processing of the aggregated port single-port UP in the Mux machine, which helps reduce packet loss caused by the service traffic during the transmission process.
  • the specific Mux machine refer to the description of the subsequent embodiments of the present application.
  • FIG. 3 is a flowchart of a method for implementing a Mux machine according to an embodiment of the present application.
  • the method shown in FIG. 3 can be applied to the network running LACP shown in FIG. 1.
  • the network includes a first network device and a second network device, where a first aggregation port of the first network device is connected to a second aggregation port of the second network device via an aggregation link, where the first network device is The Mux machine is implemented on the first aggregation port.
  • the aggregation link 1 in the LAG of the first network device is used as an example, wherein the aggregation port 11 of the first network device is connected to the aggregation port of the second network device. 21 connections.
  • FIG. Fig. 4 is a view showing the state of a Mux machine of the application embodiment. The method shown in Figure 3 can be used to implement the Mux machine shown in Figure 4. The operations in the DETACHED state, the WAITING state, and the ATTACHED state are not shown in FIG.
  • FIG. 4 For the explanation of the mutual conversion between the states, reference may be made to the description of the foregoing embodiments, and details are not described herein.
  • FIG. 4 is the same as the description of FIG. 2 described above, and is not described herein.
  • the first aggregation port corresponds to the aggregation port 11 in the description
  • the second aggregation port corresponds to the aggregation port 21 in the description.
  • the first network device sets a PROTECT_WAITING state in a Mux machine of the first aggregation port, where the PROTECT_WAITING state is used to identify that the first aggregation port is not in a collection and distribution state, but is advertised to other network devices.
  • the state of the first aggregation port is a collection and distribution state.
  • the first network device implements a Mux machine on the aggregation port 11 of the first network device.
  • the first network device sets a PROTECT_WAITING state in the Mux machine, as shown in FIG. Comparing the Mux machine shown in Fig. 2, the Mux machine shown in Fig. 4 adds the PROTECT_WAITING state between the ATTACHED state and the COLLECTING_DISTRIBUTING state.
  • the first network device may implement switching between the ATTACHED state and the PROTECT_WAITING state of the Mux machine of the aggregation port 11.
  • the first network device may further implement switching between the COLLECTING_DISTRIBUTING state and the PROTECT_WAITING state of the Mux machine of the aggregation port 11.
  • the PROTECT_WAITING state is used to identify that the aggregated port 11 is not in the collection and distribution state, but the state of the aggregated port 11 advertised to other network devices is a collection and distribution state. That is, in the PROTECT_WAITING state, the first network device determines that the aggregated port 11 is not in the collection and distribution state. Determining, by the first network device, that the aggregation port 11 is not in a collection and distribution state comprises: the first network device maintaining the aggregation port 11 not in a collection and distribution state, or the first network The device sets the aggregation port 11 to be in a collection and distribution state.
  • the first network device detects that the aggregation port 11 is not in a collection and distribution state, and maintains the aggregation port 11 not in a collection and distribution state. For example, when the Mux machine of the aggregation port 11 is switched from the ATTACHED state to the PROTECT_WAITING state, the aggregation port 11 is not in the collection and distribution state. After the Mux machine enters the PROTECT_WAITING state, the first network device maintains the aggregation port 11 not in the collection and distribution state. In another possible implementation manner, the first network device detects that the aggregation port 11 is in a collection and distribution state, and sets the aggregation port 11 to be in a collection and distribution state.
  • the aggregation port 11 when the Mux machine of the aggregation port 11 is switched from the COLLECTING_DISTRIBUTING state to the PROTECT_WAITING state, the aggregation port 11 is in the collection and distribution state. After the Mux machine enters the PROTECT_WAITING state, the first network device sets the aggregation port 11 to be in a collection and distribution state. In still another possible implementation manner, the first network device does not detect the status of the aggregation port 11, but directly sets the aggregation port 11 to be in a collection and distribution state.
  • the state of the aggregation port 11 that the first network device advertises to other network devices is collection and distribution. status.
  • the other network device includes a network device that communicates with the first network device over an aggregated link.
  • the first network device announces to other network devices that the state of the aggregation port 11 is a collection and distribution state. In reality, however, the true state of the aggregation port 11 is not in the collection and distribution state.
  • the first network device determines that the first aggregation port is not in a collection and distribution state, and sends a first LACPDU message to the two network devices, where The first LACPUD message is used to notify the second network device that the first aggregation port is in a collection and distribution state, and trigger the second network device to set the second aggregation port to a collection and distribution state.
  • the first network device when the Mux machine of the aggregation port 11 is in the PROTECT_WAITING state, the first network device performs the following process: determining Actor.Collecting as FALSE, indicating that the aggregation port 11 is not in the collection state. Determining Actor.Distributing to FALSE indicates that the aggregated port 11 is not in the distribution state. The other network devices are advertised that Actor.Collecting is TRUE and Actor.Distributing is TRUE, indicating that the aggregated port 11 is in a collection and distribution state. The NTT is determined to be TRUE.
  • Actor.Collecting and Actor.Distributing can also be represented by Actor.Collecting_Distributing.
  • Actor.Collecting_Distributing is determined to be TRUE, indicating that the aggregated port 11 is in the collection state and the distribution state;
  • Actor.Collecting_Distributing is determined to be FALSE, indicating that the aggregated port 11 is not in the collection state and the distribution state.
  • the above two representations are all covered in the scope of "collection and distribution status".
  • the Actor.Collecting and Actor.Distributing are determined as the implementation of the FALSE.
  • FALSE the for the first network device.
  • the first network device further sends a first LACPDU message to the two network devices, where the first LACPUD message is used to notify the second network device that the aggregation port 11 is in a collection and distribution state.
  • the first LACPDU packet is further used to trigger the second network device to set the aggregation port 21 to a collection and distribution state.
  • the second network device determines, according to the first LACPDU packet, that the state of the aggregation port 11 is a collection and distribution state, and triggers setting the aggregation port 21 The process of collecting and distributing status.
  • the first LACPDU packet is an LACPDU packet sent by the first network device to the second network device.
  • the first LACPDU packet carries a local state (English: Actor_State) field, and the Actor_State field has a length of 1 byte.
  • the Actor_State field includes a Collecting flag bit and a Distributing flag bit.
  • the Collecting flag bit and the Distributing flag bit are used to indicate whether the aggregation port 11 is in a collection and distribution state. For example, when both the Collecting flag bit and the Distributing flag bit are set to 1, it indicates that the aggregation port 11 is in the collection and distribution state.
  • the format of the LACPDU packet and the Actor_State can also be seen in the descriptions of Figure 5-8 and Figure 5-9 in IEEE 802.1AX.
  • the second network device may invoke the RX machine to complete receiving and processing the first LACPDU packet.
  • the first network device determines whether a second LACPDU packet is received from the second network device, where the second LACPDU packet is used to indicate that the second aggregation port is in a collection and distribution state.
  • the second network device For example, if the second network device is successfully triggered by the first LACPDU packet, the second network device generates the second LACPDU packet, and sends the second LACPDU packet to the first A network device sends. Or, if the second network device is faulty or abnormal, the aggregation port 21 may not be in a collecting and distributing state, so that the second network device receives the first LACPDU packet, The second LACPDU packet cannot be sent to the first network device.
  • the first network device detects whether a second LACPDU packet is received from the second network device, where the second LACPDU packet is used to indicate that the aggregation port 21 is in a collection and distribution state.
  • the first network device may determine whether the aggregated port at one end of the aggregated link 1 is in a collection and distribution state, and the aggregated port on the other end is not in a collection and distribution state (no collection and no forwarding state). That is, the first network device can detect whether the aggregated link 1 has a single port UP.
  • the implementation manner of the first network device detecting whether the aggregation link 1 is a single-port UP is: if the aggregation port 21 of the second network device is in a collection and distribution state, the aggregation link 1 does not belong to Single port UP. If the aggregated port 21 of the second network device is not in the collection and distribution state at all times, the aggregated link 1 is a single port UP.
  • the second LACPDU packet is an LACPDU packet sent by the second network device to the first network device.
  • the second LACPDU message carries an Actor_State field, and the Actor_State field has a length of 1 byte.
  • the Actor_State field includes a Collecting flag bit and a Distributing flag bit.
  • the Collecting flag bit and the Distributing flag bit are used to indicate whether the aggregation port 21 is in a collection and distribution state. For example, when both the Collecting flag bit and the Distributing flag bit are set to 1, it indicates that the aggregation port 21 is in the collection and distribution state.
  • the format of the LACPDU packet and the Actor_State can also be seen in the descriptions of Figure 5-8 and Figure 5-9 in IEEE 802.1AX.
  • the first network device may invoke the RX machine to complete receiving and processing the second LACPDU packet.
  • the first network device determines that the second LACPDU packet is received, the first network device switches the Mux machine from the PROTECT_WAITING state to a COLLECTING_DISTRIBUTING state, and sets the first aggregation port. For collection and distribution status.
  • the LACPDU can be used to notify the other party.
  • the Mux machine of the aggregation port 21 of the second network device is switched from the ATTACHED state to the COLLECTING_DISTRIBUTING state, and the second network device switches the collection state of the aggregation port 21 to collect and distribute the aggregation port 21.
  • the status switches to distribution.
  • the aggregation port 21 undergoes a change in state information.
  • the second network device sends a second LACPDU message to the first network device, where the second LACPDU message is used to indicate that the aggregation port 21 is in a collection and distribution state.
  • the first network device determines whether the second LACPDU message is received. Therefore, the first network device may determine, according to the second LACPDU packet, whether the aggregation port 21 is in a collection and distribution state.
  • the second device determines that the collection status of the aggregation port 21 is to collect and determine the distribution status of the aggregation port 21 as a distribution.
  • the first network device switches the Mux machine from the PROTECT_WAITING state to a COLLECTING_DISTRIBUTING state according to the second LACPDU message indicating that the aggregation port 21 of the second device is in a collection and distribution state.
  • the first network device determines, according to the Collecting flag bit in the Actor_State field carried in the second LACPDU message, that the first network device determines the collection state of the peer operation port (English: Partner_Oper_Port_State.Collecting, abbreviation The value of :Partner.Collecting) is TRUE.
  • the first network device determines that the Distributing flag bit in the Actor_State field carried in the second LACPDU packet is TRUE, and the first network device determines a distribution status of the peer operation port (English: Partner_Oper_Port_State.Distributing, abbreviation: The value of Partner.Distributing) is TRUE.
  • the first network device sets the aggregation port 11 to a collection and distribution state.
  • both the aggregation port 11 and the aggregation port 21 are in a collection and distribution state. That is to say, the aggregation port 11 and the aggregation port 21 of the aggregated link 1 are both UP. That is, the first network device allows the aggregation port 11 to receive and transmit data messages, and the second network device allows the aggregation port 21 to receive and transmit data messages.
  • the Mux machine shown in FIG. 4 switches the Mux machine of the aggregation port to a stable collection and distribution state by increasing the PROTECT_WAITING state and ensuring that the aggregation ports at both ends of the aggregation link are both UP.
  • the first network sets the PROTECT_WAITING state in the Mux machine of the first aggregation port.
  • the first network device determines that the first aggregation port is not in a collection and distribution state. Then, the first network device sends a first LACPDU message to the two network devices, where the first LACPUD message is used to notify the second network device that the first aggregation port is in a collection and distribution state, and The second network device is triggered to set the second aggregation port to a collection and distribution state.
  • the first network device determines that the second LACPDU packet from the second network device is used to indicate that the second aggregation port is in a collection and distribution state
  • the first network device The Mux machine is switched from the PROTECT_WAITING state to the COLLECTING_DISTRIBUTING state, and the first aggregation port is set to a collection and distribution state.
  • the implementation of the present application implements the detection and processing of the aggregated port single-port UP in the Mux machine, thereby helping to reduce packet loss caused by the service traffic during the transmission process.
  • the method shown in FIG. 3 of the embodiment of the present application is an example in which the Mux machine is implemented by using the aggregation port of the first network device, and the method shown in FIG. 3 can also be applied to the aggregation of the second network device.
  • the two aggregation ports of the aggregated link implement the Mux machine shown in FIG.
  • the aggregation port 11 of the aggregation link 1 also implements the Mux machine shown in FIG. 4 during the implementation of the Mux machine shown in FIG.
  • the first network device is regarded as an actor
  • the second network device is regarded as a partner
  • the second A network device is considered an actor and the first network device is considered a partner.
  • the first network device includes a timer, where the Mux machine of the first aggregation port is in a PROTECT_WAITING state, the method further includes: the first network device starts a timer; until the timer After the timeout, the first network device determines that the second LACPDU message from the second network device is not received, and the first network device switches the Mux machine from the PROTECT_WAITING state to an ATTACHED state.
  • a timer is also set in the first network device, and the timer is associated with the aggregation port 11.
  • the first network device detects whether a second LACPDU message from the second network device is received during timer counting.
  • the timer can be implemented by a hardware timer or a software timer. By setting the timer, it is possible to prevent the Mux machine of the aggregation port 11 from being in the PROTECT_WAITING state for a long time.
  • the duration of the timer may be set according to an actual scenario of the networking and performance requirements of the network device, for example, 3s ⁇ T ⁇ 90s, where T represents the duration of the timer, and s represents second.
  • the first network device determines that the aggregated link 1 is a single, if the first network device does not receive the second LACPDU packet until the timer expires from the start of the timer. Port UP. That is, until the timer expires, the first network device does not receive the second LACPDU message, and the first network device may determine that the aggregation port 21 is not in the collection and distribution state. Based on the above situation, the first network device switches the Mux machine of the aggregation port 11 from the PROTECT_WAITING state to the ATTACHED state (as shown in FIG. 4). The first network device does not receive the second LACPDU message until the timer expires, and the first network device does not start receiving the timer until the timer expires.
  • the network device does not receive any LACPDU message from the second network device; or, from the start of the timer, until the timer expires, the first network device receives the second network
  • the LACPDU packet of the device but the LACPDU packet does not indicate that the aggregation port 21 is in the collection and distribution state.
  • the method further includes: when the Mux machine is in a COLLECTING_DISTRIBUTING state, and the timer expires, the first network device sets the aggregated link to a single port UP, the single port UP Used to indicate that one end of the aggregated link is in the collection and distribution state, and the other end of the aggregated port is not in the collection and distribution state.
  • the first network device may also set a Single-port_UP.
  • the Single-port_UP is used to indicate whether the aggregated link is a single-port UP.
  • the Single-port_UP is deployed in the Mux machine and triggered according to the timer. Specifically, in the PROTECT_WAITING state, the first network device does not receive the second LACPDU packet from the second network device, and the first network device sends the single network device until the timer expires.
  • the first network device does not receive the second LACPDU message, and the first network device switches the Mux machine of the aggregation port 11 from the PROTECT_WAITING state to the ATTACHED state. And, the first network device sets the value of the Single-port_UP flag bit to TRUE.
  • the first network device After the Mux machine of the aggregation port 11 of the first network device enters the ATTACHED state, because the value of the Single-port_UP flag is TRUE, the first network device does not switch the Mux from the ATTACHED state to PROTECT_WAITING status. Therefore, a further beneficial effect is that the Single-port_UP can avoid repeated oscillation between the ATTACHED state and the PROTECT_WAITING state of the Mux.
  • the first network device sets the value of the single port UP flag bit to FALSE.
  • the DETACHED state can be regarded as an initialization phase of the Mux machine.
  • the two ports may not be in a single port.
  • the aggregation port 11 and the aggregation port 21 of the aggregation link 1 are both DOWN, or the aggregation port 11 of the aggregation link 1 is Both the aggregation port 21 and the aggregation port 21 are UP (the aggregation port 11 is UP, and the external advertisement is UP).
  • setting the value of the Single-port_UP flag to FALSE helps to prevent the value of the old Single-port_UP flag from affecting the operation of the Mux machine.
  • the Mux machine of the first aggregation port is in the ATTACHED state, and the method further includes S1001 and S1002, so that the first network device completes the ATTACHED state of the Mux machine.
  • the process of switching to the PROTECT_WAITING state is shown in Figure 4.
  • the first network device receives a third LACPDU packet from the second network device.
  • the first network device determines that the first aggregation port is in a selected state, and determines that the second aggregation port is in a synchronization state according to the third LACPDU packet, and determines according to the third LACPDU packet.
  • the first network device switches the Mux machine from the ATTACHED state to the PROTECT_WAITING state.
  • the first network device may invoke Selection Logic to select an aggregator associated with the aggregation port 11, which is an aggregator 1 according to FIG.
  • the SELECTED is used to indicate that a suitable aggregator is selected.
  • the first network device may invoke the RX machine to complete the receiving and processing of the third LACPDU message by using the RX machine.
  • the third LACPDU packet is sent by the second network device.
  • the third LACPDU packet is used to determine whether the aggregation port 21 is in a synchronized state, and the third LACPDU packet is further used to determine whether the aggregation port 21 is in a collection and distribution state.
  • the first network device determines that the aggregation port 21 is in the synchronization state according to the third LACPDU packet, and determines the aggregation port 21 according to the third LACPDU packet.
  • the first network device switches the Mux machine of the aggregation port 11 from the ATTACHED state to the PROTECT_WAITING state.
  • the status information in the third LACPDU message for indicating the aggregation port 21 includes Actor_State, and the Actor_State includes a Collecting flag bit and a Distributing flag bit.
  • the first network device determines whether the Collecting flag bit and the Distributing flag bit included in the Actor_State in the third LACPDU message are set to TRUE. When the Collecting flag bit and the Distributing flag bit are set to FALSE, the first network device determines that the aggregation port 21 is not in the collection and distribution state.
  • the Mux machine of the aggregation port 11 of the first network device is in an ATTACHED state, and when the first network device determines that the aggregation port 21 is in a synchronization state and the aggregation port 21 is not In the case of the collection and distribution state, the first network device switches the Mux machine of the aggregation port 11 to the PROTECT_WAITING state. Thereby, it is ensured that after the Mux machine enters the PROTECT_WAITING state, the detection that the second aggregation port is never in the collection and distribution state to the collection and distribution state is initiated.
  • the method further includes S10021 and S10022.
  • S10021 and S10022 describe the implementation manner that the first network device determines that the second aggregation port is in a synchronized state according to the third LACPDU packet.
  • the first network device determines that the first information included in the third LACPDU packet matches the second information that the first network device stores the first aggregation port, where the first information includes a Partner_Port, a Partner_Port_Priority , Partner_System, Partner_System_Priority, Partner_Key, and Partner_State.Aggregation, the second information includes Actor_Port_Number, Actor_Port_Priority, Actor_System, Actor_System_Priority, Actor_Oper_Port_Key, and Actor_Oper_Port_State.Aggregation.
  • the first network device determines that the local state synchronization Actor_State.Synchronization included in the third LACPDU packet is in a synchronized state.
  • the first network device determines, according to the third LACPDU packet, whether the aggregation port 21 is in a synchronized state.
  • the first information in the third LACPDU packet includes: a peer port (English: Partner_Port), a peer port priority (English: Partner_Port_Priority), a peer system (English: Partner_System), and a peer end.
  • System priority English: Partner_System_Priority
  • peer keyword English: Partner_Key
  • peer state aggregation English: Partner_State.Aggregation
  • the local operating parameter values stored by the first network device include: local port number (English: Actor_Port_Number), local port priority (English: Actor_Port_Priority), local system (English: Actor_System), local system priority (English: Actor_System_Priority), local operation port keyword (English: Actor_Oper_Port_Key) and local operation port aggregation (English: Actor_Oper_Port_State.Aggregation).
  • the status information of the third LACPDU is used to indicate that the aggregation port 21 includes the local state synchronization (English: Actor_State. Synchronization), and the Actor_State.Synchronization is in the third LACPDU packet.
  • the first network device determines whether Actor_State.Synchronization in the third LACPDU message is set to TRUE. For the definition of each of the above information, refer to the description in IEEE 802.1AX, and details are not described here
  • the information for determining the synchronization status of the aggregation port 21 of the second network device and the information for determining the collection and distribution status of the aggregation port 21 may be carried in different third LACPDUs.
  • information for determining the synchronization status of the aggregation port 21 is carried in a third LACPDU message; information for determining the collection and distribution status of the aggregation port 21 is carried in another third LACPDU.
  • Two third LACPDU messages are respectively sent by the second network device to the first network device.
  • the Partner_Port Determining, by the first network device, the Partner_Port, the Partner_Port_Priority, the Partner_System, the Partner_System_Priority, the Partner_Key, and the Partner_State.Aggregation included in the third LACPDU, and the Actor_Port_Number, Actor_Port_Priority, Actor_System, Actor_System_Priority, Actor_Oper_Port_Key, and Actor_Oper_Port_State stored by the first network device
  • the Aggregation is matched, and the first network device determines that the Actor_State.Synchronization included in the third LACPDU packet is TRUE, and the first network device determines that the aggregation port 21 is in a synchronization state, that is, the first A network device determines Partner.Sync as TRUE.
  • the method further includes: S1003, based on the third LACPDU message in the foregoing S1001, to complete the process in which the first network device switches the Mux machine of the first aggregation port from an ATTACHED state to a COLLECTING_DISTRIBUTING state, As shown in Figure 4.
  • the first network device determines, according to S1001, the Partner_Port, Partner_Port_Priority, Partner_System, Partner_System_Priority, Partner_Key, and Partner_State.Aggregation included in the third LACPDU packet.
  • Actor_Port_Number, Actor_Port_Priority, Actor_System, Actor_System_Priority, Actor_Oper_Port_Key, and Actor_Oper_Port_State.Aggregation of the first network device are matched, and the first network device determines that Actor_State.Synchronization included in the third LACPDU message is TRUE, A network device determines that the aggregation port 21 is in a synchronized state.
  • the first network device further determines that the Collecting flag bit and the Distributing flag bit included in the Actor_State in the third LACPDU message are TRUE, so that the first network device determines that the aggregation port 21 is in a collection and distribution state. . Therefore, the first network device may switch the Mux machine from the ATTACHED state to the COLLECTING_DISTRIBUTING state according to the foregoing determination result.
  • S1003 illustrates that in the ATTACHED state, the first network device has confirmed that the aggregation port 21 is in a collection and distribution state, or may be considered to be that the aggregation port 21 is UP. Therefore, the Mux machine running on the aggregation port 11 no longer enters the PROTECT_WAITING state, but is directly switched from the ATTACHED state to the COLLECTING_DISTRIBUTING state. After entering the COLLECTING_DISTRIBUTING state, the first network device sets the aggregated port 11 to a collection and distribution state. That is, the Actor.Collecting and Actor.Distributing are determined to be TRUE, indicating that the aggregated port 11 is in a collection and distribution state. The aggregation port 11 is set to UP, and the aggregation link 1 enters a stable forwarding state.
  • the first network device sets the value of the Single-port_UP flag bit to FALSE.
  • the Mux machine of the aggregation port 11 is in an ATTACHED state, when the first network device determines that the aggregation port 21 is in a synchronization state and the aggregation port 21 is already in a collection and distribution state.
  • the first network device switches the Mux machine running on the aggregation port 11 to a COLLECTING_DISTRIBUTING state. Based on the foregoing implementation manner, the first network device quickly enters the state of dual port collection and distribution when determining that the second aggregation port is in the collection and distribution state, which helps reduce the loss of traffic generated during the transmission process. package.
  • the method further includes S1101 and S1102, so as to complete a process in which the first network device switches the Mux machine of the first aggregation port from a COLLECTING_DISTRIBUTING state to a PROTECT_WAITING state, as shown in FIG. 4 .
  • the first network device receives a fourth LACPDU message from the second network device, where the fourth LACPDU message is used to indicate that the second aggregation port is not in a collection and distribution state;
  • the aggregation port 11 and the aggregation port 21 are both in a collection and distribution state, and both ends of the aggregation link 1 are UP.
  • the first network device and the second network device forward data packets to each other via the aggregated link 1.
  • the status information of the aggregation port of the actor or the partner is notified by the LACPDU. It is assumed that the second network device is abnormal, causing the aggregation port 21 collection state to be switched from collection to non-collection and the aggregation port 21 distribution status to switch from distribution to non-distribution.
  • the second network device sends the fourth LACPDU packet to the first network device, where the Actor_State in the fourth LACPDU packet includes a Collecting flag bit and a Distributing flag bit.
  • the Collecting is determined to be FALSE, indicating that the aggregation port 21 is not in the collection state.
  • the Distributing is determined to be FALSE, indicating that the aggregation port 21 is not in a distribution state.
  • the first network device determines that the Collecting flag bit in the Actor_State field carried in the fourth LACPDU message is FALSE, and the first network device determines that the value of Partner.Collecting is FALSE.
  • the first network device determines, according to the fourth LACPDU, that the Distributing flag bit in the Actor_State field is FALSE, and the first network device determines that the value of Partner.Distributing is FALSE.
  • the Mux machine of the aggregation port 11 is in the COLLECTING_DISTRIBUTING state, and when the first network device determines that the aggregation port 21 is not in the collection and distribution state, the first network device will The Mux machine of the aggregation port 11 is switched from the COLLECTING_DISTRIBUTING state to the PROTECT_WAITING state. After the first network device receives the fourth LACPDU message indicating that the second aggregation port is not in the collection and distribution state, the Mux switch is switched to the PROTECT_WAITING state in time to help reduce the number of the second LACPDUs. Packet loss caused by traffic during transmission.
  • the method further includes S1201, so as to complete a process in which the first network device switches the Mux machine of the first aggregation port from a PROTECT_WAITING state to an ATTACHED state, as shown in FIG. 4.
  • the first network device determines that the Mux machine is switched from the PROTECT_WAITING state to the ATTACHED state when at least one of the following conditions is met: the first network device determines that the first aggregation port is not a selected state; the first network device determines that the first aggregation port is in a standby state; and the first network device receives a fifth LACPDU packet from the second network device, and according to the fifth LACPDU The message determines that the second aggregation port is not in a synchronized state.
  • the aggregation port 11 may undergo a state change. For example, the aggregation port 11 is changed to not select the aggregator 1, and the first network device switches the selected state of the aggregation port 11 to UNSELECTED. For another example, the aggregation port 11 of the first network device is changed to the selection aggregator 1, but the aggregation port 11 does not enable the aggregation function, and the first network device switches the selected state of the aggregation port 11 to STANDBY.
  • the first network device switches the Mux machine of the aggregation port 11 from the PROTECT_WAITING state to the ATTACHED state.
  • the UNSELECTED state can be triggered by the Selection Logic or by the RX machine; the STANDBY state can be triggered by the Selection Logic.
  • the first network device may further receive a fifth LACPDU message from the second network device, where the fifth LACPDU message is used to determine Whether the aggregation port 21 is in a synchronized state.
  • the first network device determines, according to the fifth LACPDU message, that the aggregation port 21 of the second network device is not in a synchronized state.
  • the implementation manner of the first network device that determines that the aggregation port 21 of the second network device is not in the synchronization state according to the fifth LACPDU packet may be referred to the corresponding descriptions of the foregoing S10021 and S10022, and details are not described herein.
  • the first network device switches the Mux machine of the aggregation port 11 from the PROTECT_WAITING state to the ATTACHED state.
  • the method further includes S1301, so as to complete a process in which the first network device switches the Mux machine from the COLLECTING_DISTRIBUTING state to the ATTACHED state, as shown in FIG. 4 .
  • the first network device determines that, when at least one of the following conditions is met, the Mux machine of the first aggregation interface is switched from the COLLECTING_DISTRIBUTING state to the ATTACHED state: the first network device determines The first aggregation port is in an unselected state; the first network device determines that the first aggregation port is in a standby state; and the first network device receives a fifth LACPDU packet from the second network device, And determining, according to the fifth LACPDU, that the second aggregation port is not in a synchronized state.
  • the method further includes:
  • S1302 The Mux machine is in an ATTACHED state, and the first network device stops the timer.
  • FIG. 5 is a schematic structural diagram of a first network device 1000 according to an embodiment of the present application.
  • the first network device 1000 shown in FIG. 5 can perform the corresponding steps performed by the first network device in the method of the above embodiment.
  • the first network device 1000 is running with an LACP, and the first aggregation port of the first network device 1000 is connected to the second aggregation port of the second network device via an aggregation link.
  • the first network device 1000 includes a processing unit 1002 and a transmitting unit 1004.
  • the processing unit 1002 is configured to set a PROTECT_WAITING state in the Mux machine of the first aggregation port, where the PROTECT_WAITING state is used to identify that the first aggregation port is not in a collection and distribution state, but is advertised to other network devices.
  • the state of the first aggregation port is a collection and distribution state;
  • the processing unit 1002 is further configured to: when the Mux machine is in the PROTECT_WAITING state, determine that the first aggregation port is not in a collection and distribution state;
  • the sending unit 1004 is configured to send a first LACPDU message to the two network devices, where the first LACPUD message is used to notify the second network device that the first aggregation port is in a collection and distribution state, and Trimming the second network device to set the second aggregation port to a collection and distribution state;
  • the processing unit 1002 is further configured to determine whether a second LACPDU packet is received from the second network device, where the second LACPDU packet is used to indicate that the second aggregation port is in a collection and distribution state;
  • the processing unit 1002 determines that the second LACPDU message is received, the processing unit 1002 is further configured to switch the Mux machine from the PROTECT_WAITING state to a COLLECTING_DISTRIBUTING state, and set the first aggregation port to Collect and distribute status.
  • the Mux machine before the Mux machine of the first aggregation port is in the PROTECT_WAITING state, the Mux machine is in an attached ATTACHED state, and the first network device further includes a receiving unit.
  • the receiving unit is configured to receive a third LACPDU packet from the second network device.
  • the processing unit 1002 determines that the first aggregation port is in a selected state, and determines that the second aggregation port is in a synchronization state according to the third LACPDU packet, and determines the first according to the third LACPDU message.
  • the processing unit 1002 is further configured to switch the Mux machine from the ATTACHED state to the PROTECT_WAITING state when the second aggregation port is not in the collection and distribution state.
  • the processing unit 1002 determines, according to the third LACPDU packet, that the second aggregation port is in a synchronization state, where the processing unit 1002 is further configured to determine that the third LACPDU packet is included.
  • the information matches the second information that the first network device stores the first aggregation port, where the first information includes a Partner_Port, a Partner_Port_Priority, a Partner_System, a Partner_System_Priority, a Partner_Key, and a Partner_State.Aggregation, and the second information includes an Actor_Port_Number, Actor_Port_Priority, Actor_System, Actor_System_Priority, Actor_Oper_Port_Key, and Actor_Oper_Port_State.Aggregation.
  • the processing unit 1002 is further configured to determine that the Actor_State.Synchronization included in the third LACPDU message is in a synchronized state.
  • the processing unit 1002 determines that the second aggregation port is in a synchronization state according to the third LACPDU packet, and determines that the second aggregation port is in a collection and distribution state according to the third LACPDU packet.
  • the processing unit 1002 is further configured to switch the Mux machine from the ATTACHED state to the COLLECTING_DISTRIBUTING state, and set the first aggregation port to a collection and distribution state.
  • the receiving unit is further configured to receive a fourth LACPDU message from the second network device, where the fourth LACPDU message is used to indicate that the second aggregation port is not in a collection and distribution state.
  • the processing unit 1002 determines that the second aggregation port is not in the collection and distribution state according to the fourth LACPDU message, the processing unit 1002 is further configured to switch the Mux machine from the COLLECTING_DISTRIBUTING state to the The PROTECT_WAITING state is described.
  • the processing unit 1002 when the processing unit 1002 determines that at least one of the following conditions is met, the processing unit 1002 is further configured to switch the Mux machine from the PROTECT_WAITING state to the ATTACHED state: the processing unit 1002 further For determining that the first aggregation port is in an unselected state; the processing unit 1002 is further configured to determine that the first aggregation port is in a standby state; and, the processing unit 1002 is further configured to receive, according to the received The fifth LACPDU packet of the second network device determines that the second aggregation port is not in a synchronized state.
  • the Mux machine at the first aggregation port is in a PROTECT_WAITING state, and the processing unit 1002 is further configured to start a timer. Until the timer expires, the processing unit 1002 determines that the second LACPDU message from the second network device is not received, and the processing unit 1002 is further configured to: use the PROTECT_WAITING state by the Mux machine. Switch to the ATTACHED state.
  • the processing unit 1002 is further configured to set the aggregation link as a single port UP, where the single port UP is used to indicate The aggregation port on one end of the aggregation link is in the collection and distribution state, and the aggregation port on the other end is not in the collection and distribution state.
  • the duration of the timer is greater than or equal to 3 seconds, and the duration of the timer is less than or equal to 90 seconds.
  • the first network device shown in FIG. 5 can perform the corresponding steps performed by the first network device in the method of the above embodiment. It is applied to the network that runs the LACP to detect and process the aggregation port status of the two ends of the aggregation link in the Mux. This helps reduce the packet loss caused by the service traffic during the transmission. It should be understood that the structure in FIG. 5 is equally applicable to the second network device in FIG.
  • FIG. 6 is a schematic structural diagram of hardware of a first network device 1100 according to an embodiment of the present application.
  • the first network device 1100 shown in FIG. 6 can perform the corresponding steps performed by the first network device in the method of the above embodiment.
  • the first network device 1100 includes a processor 1101, a memory 1102, an interface 1103, and a bus 1104.
  • the interface 1103 can be implemented by using a wireless or wired manner, and specifically can be a network card.
  • the above processor 1101, memory 1102, and interface 1103 are connected by a bus 1104.
  • the interface 1103 may specifically include a transmitter and a receiver, configured to send and receive information between the first network device and the second network device in the foregoing embodiment.
  • the interface 1103 is configured to support sending and receiving LACPDU messages with the second network device.
  • the processor 1101 is configured to perform processing performed by the first network device in the foregoing embodiment.
  • the processor 1101 is configured to set a collection and distribution status of the first aggregation port; and is further configured to determine whether the first aggregation port is in a collection and distribution state; and is also used to start or stop a timer; Determining whether to receive the LACPDU message sent by the second network device; also for implementing switching between the various states of the Mux machine; and/or other processes for the techniques described herein.
  • the processor 1101 is configured to support the processes S102, S104, S106, and S108 of FIG.
  • the memory 1102 includes an operating system 11021 and an application 11022 for storing programs, codes, or instructions that can be executed when a processor or a hardware device executes the programs, code, or instructions.
  • the memory 1102 can include a read-only memory (English: Read-only Memory, abbreviated as ROM) and a random access memory (English: Random Access Memory, abbreviation: RAM).
  • the ROM includes a basic input/output system (English: Basic Input/Output System, BIOS) or an embedded system; the RAM includes an application and an operating system.
  • the first network device 1100 When the first network device 1100 needs to be run, booting is performed by the BIOS in the ROM or the bootloader booting system in the embedded system, and the first network device 1100 is booted into a normal running state. After the first network device 1100 enters the normal running state, the application program and the operating system running in the RAM are executed, thereby completing the processing procedure involving the first network device in the method embodiment.
  • FIG. 6 only shows a simplified design of the first network device 1100.
  • the first network device can contain any number of interfaces, processors or memories.
  • this embodiment is only described by taking the first network device as an example. It should be understood that the second network device or more network devices have the same functions as the first network device, and details are not described herein again.
  • FIG. 7 is a schematic structural diagram of hardware of another first network device 1200 according to an embodiment of the present application.
  • the first network device 1200 shown in FIG. 7 can perform the corresponding steps performed by the first network device in the method of the above embodiment.
  • the first network device 1200 includes: a main control board 1210, an interface board 1230, a switching network board 1220, and an interface board 1240.
  • the main control board 1210 is used to complete functions such as system management, device maintenance, and protocol processing.
  • the switching network board 1220 is used to complete data exchange between each interface board (also referred to as a line card or a service board).
  • the interface boards 1230 and 1240 are used to provide various service interfaces (for example, a POS interface, a GE interface, an ATM interface, etc.), and implement forwarding of data packets.
  • the main control board 1210, the interface boards 1230 and 1240, and the switching network board 1220 are connected to each other through the system bus to implement interworking.
  • the central processing unit 1231 on the interface board 1230 is used to control and manage the interface board and communicate with the central processing unit on the main control board.
  • the physical interface card 1233 on the interface board 1230 receives the LACPDU message from the second network device, and sends the LACPDU to the central processing unit 1211 on the main control board 1210 via the central processing unit 1231 on the interface board 1230. Message.
  • the central processing unit 1211 on the main control board 1210 is configured to obtain the LACPDU message.
  • the central processing unit 1211 is further configured to set a PROTECT_WAITING state in the Mux machine of the first aggregation port, where the PROTECT_WAITING state is used to identify that the first aggregation port is not in a collection and distribution state, but is advertised to other network devices.
  • the state of the first aggregation port is the collection and distribution status.
  • the central processing unit 1211 is further configured to determine that the first aggregation port is not in a collection and distribution state when the Mux machine is in the PROTECT_WAITING state.
  • the central processing unit 1211 is further configured to control the interface board 1230 to send a first LACPDU message to the two network devices, where the first LACPUD message is used to advertise the first aggregation port of the second network device.
  • the central processing unit 1211 is further configured to determine whether a second LACPDU message from the second network device is received, where the second LACPDU message is used to indicate that the second aggregation port is in a collection and distribution state. When the central processing unit 1211 determines that the second LACPDU message is received, the central processing unit 1211 is further configured to switch the Mux machine from the PROTECT_WAITING state to a collection and distribution COLLECTING_DISTRIBUTING state, and the first The aggregation port is set to the collection and distribution status.
  • the central processing unit 1211 is further configured to generate an LACPDU message.
  • the central processor 1211 transmits the generated LACPDU message to the physical interface card 1233 via the central processor 1231 on the interface board 1230.
  • the physical interface card 1233 on the interface board 1230 sends the LACPDU packet to the second network device.
  • the forwarding entry storage 1234 on the interface board 1230 is used to store forwarding entries.
  • the central processing unit 1231 on the interface board 1230 is configured to control the network storage 1232 to obtain the forwarding entry in the forwarding entry storage 1234, and the central processing unit 1231 is configured to control the network storage 1232 to complete the receiving and sending of the traffic via the physical interface card 1233. .
  • the operation on the interface board 1240 in the embodiment of the present invention is consistent with the operation of the interface board 1230, and details are not described herein for brevity.
  • the first network device 1200 of the present embodiment may correspond to the functions and/or various steps of the foregoing method embodiments, and details are not described herein again.
  • this embodiment is only described by taking the first network device as an example.
  • the second network device or more network devices have the same functions as the first network device, and details are not described herein again.
  • the main control board may have one or more blocks, and when there are multiple blocks, the main control board and the standby main control board may be included.
  • the interface board may have one or more blocks. The stronger the data processing capability of the first network device, the more interface boards are provided.
  • the physical interface card on the interface board can also have one or more blocks.
  • the switching network board may not exist, and there may be one or more blocks. When there are multiple blocks, the load sharing redundant backup can be implemented together.
  • the first network device does not need to exchange the network board, and the interface board undertakes the processing function of the service data of the entire system.
  • the first network device may have at least one switching network board, and implement data exchange between multiple interface boards through the switching network board to provide large-capacity data exchange and processing capability. Therefore, the data access and processing capabilities of the first network device of the distributed architecture are greater than those of the centralized architecture. Which architecture is used depends on the specific network deployment scenario, and is not limited here.
  • FIG. 8 is a schematic structural diagram of hardware of a first network system 1300 according to an embodiment of the present application.
  • the first network system 1300 shown in FIG. 8 can perform the corresponding steps performed by the first network device in the method of the above embodiment.
  • This product form of the first network system 1300 is applicable to a network architecture based on control and forwarding (for example, Software Defined Network (SDN).
  • SDN Software Defined Network
  • the main control board 1210 of the first network device 1200 shown in FIG. 7 is separated from the device to form a new independent physical device (ie, the controller 1210A as shown in FIG. 8), and the remaining formation Another independent physical device (ie, the first forwarding device 1200A as shown in FIG. 8).
  • the controller 1210A interacts with the first forwarding device 1200A through a control channel protocol.
  • the control channel protocol can be OpenFlow (English: OpenFlow) protocol, Path Computation Element Communication Protocol (English: Path Computation Element Communication Protocol, PCEP), BGP, Routing System Interface (English: Interface to the Routing System, abbreviation: I2RS) Wait. That is, the first network system 1300 in the present embodiment includes the separated controller 1210A and the first forwarding device 1200A as compared with the embodiment corresponding to FIG. 7 described above.
  • the controller 1210A may be implemented based on a general-purpose physical server or a dedicated hardware structure.
  • the controller includes a receiver, a processor, a transmitter, a RAM, a ROM, and a bus (not shown in the figure). ).
  • the processor is coupled to the receiver, the transmitter, the RAM, and the ROM through a bus.
  • the BIOS is booted in the ROM or the bootloader booting system in the embedded system to boot, and the controller is put into a normal running state. After the controller enters the normal operating state, the application and operating system are run in RAM, causing the processor to perform all of the functions and steps of the main control board 1210 of FIG. 7 described above.
  • the first forwarding device 1200A may be implemented based on a dedicated hardware structure, and its functions and structures are consistent with the functions and structures of the interface board 1230, the interface board 1240, and the switching network board 1220 in FIG. 7 described above, and perform corresponding functions and steps. It may also be a virtual first forwarding device implemented based on a universal physical server and network function virtualization (English: Netwrk Function Virtulization, NFV) technology, and the virtual first forwarding device is a virtual router. In the scenario of the virtual first forwarding device, the first forwarding device mentioned in the foregoing first forwarding device embodiment includes an interface board, a switching network board, and a processor in the virtual environment. The server allocates interface resources, network resources, and processing resources used by the virtual first forwarding device. The function or the step of implementing the first forwarding device by using a general physical server, or the function or the step of implementing the first forwarding device by using the NFV technology, may refer to the embodiment of FIG. 6 .
  • controller 1210A and the first forwarding device 1200A in the first network system 1300 in this embodiment may implement various functions and steps implemented by the first network device in the method embodiment. Let me repeat. In addition, this embodiment is only described by taking the first network device as an example. It should be understood that the second network device or more network devices have the same functions as the first network device, and details are not described herein again.
  • the embodiment of the present application provides a computer storage medium for storing computer software instructions used by the first network device, which includes a program designed to execute the foregoing method embodiments.
  • the embodiment of the present application further includes a network system for implementing a Mux machine, where the network system includes a first network device and a second network device, where the first network device and/or the second network device is The foregoing FIG. 5 or FIG. 6 or FIG. 7; or the first network device and/or the second network device is the first network system in FIG. 8 described above.
  • the steps of a method or algorithm described in connection with the present disclosure may be implemented in a hardware or may be implemented by a processor executing software instructions.
  • the software instructions may be comprised of corresponding software modules that may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable hard disk, CD-ROM, or any other form of storage well known in the art.
  • An exemplary storage medium is coupled to the processor to enable the processor to read information from, and write information to, the storage medium.
  • the storage medium can also be an integral part of the processor.
  • the processor and the storage medium can be located in an ASIC. Additionally, the ASIC can be located in the user equipment.
  • the processor and the storage medium may also reside as discrete components in the user equipment.
  • the functions described herein can be implemented in hardware, software, firmware, or any combination thereof.
  • the functions may be stored in a computer readable medium or transmitted as one or more instructions or code on a computer readable medium.
  • Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another.
  • a storage medium may be any available media that can be accessed by a general purpose or special purpose computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Multimedia (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

一种实现Mux机的方法、设备及系统。所述方法包括,第一网络在第一聚合端口的Mux机中设置PROTECT_WAITING状态。当Mux机处于PROTECT_WAITING状态时,第一网络设备确定第一聚合端口未处于收集和分发状态,并向第二网络设备发送通告第一聚合端口处于收集和分发状态的第一LACPDU报文。当第一网络设备确定接收到来自第二网络设备的、用于指示第二聚合端口处于收集和分发状态的第二LACPDU报文,将Mux机由PROTECT_WAITING状态切换为COLLECTING_DISTRIBUTING状态,并将第一聚合端口设置为收集和分发状态。本申请实施方式实现Mux机中的聚合链路单端口UP的检测和处理,从而有助于减少业务流量在传输过程中产生的丢包。

Description

一种实现Mux机的方法、设备及系统
本申请要求于2017年06月28日提交中国专利局、申请号为201710508989.0、发明名称为“一种实现Mux机的方法、设备及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种实现复用(英文:Mux)机的方法、设备及系统。更具体的,本申请涉及在运行链路聚合控制协议(英文:Link Aggregation Control Protocol,缩写:LACP)的网络中实现Mux机的技术。
背景技术
LACP为实现数据交换的网络设备提供一种标准的协商方式,采用LACP聚合的两端网络设备可以根据自身配置自动形成聚合链路,并利用聚合链路收发数据。聚合链路形成后,聚合链路两端的网络设备负责维护链路状态,在聚合条件发生变化时,自动调整或解散链路聚合。
LACP状态机基于端口维护各个聚合端口及其对端聚合端口的信息,计算每个聚合端口的聚合状态,并与其它网络设备交换LACP报文,调用聚合端口进行聚合组以及聚合成员管理。LACP状态机包括接收状态机(英文:Receive machine,缩写:RX machine)、周期发送机(英文:Periodic Transmission machine,缩写:PTX machine)、选择逻辑(英文:Selection Logic)、Mux机(英文:Mux machine)和发送机(英文:Transmission machine,缩写:TX machine)。其中,Mux机用于将聚合端口附接到选定的聚合器(英文:aggregator),将聚合端口从不选定的聚合器分离,和基于当前的协议信息打开或关闭聚合端口的收集和分发状态。
在实际的应用场景中,网络设备运行与所述网络设备的聚合端口相关联的Mux机。在满足触发条件的情况下,所述网络设备将所述网络设备的所述聚合端口的Mux机由附接(英文:ATTACHED)状态切换为收集分发(英文:COLLECTING_DISTRIBUTING)状态。但是,所述网络设备无法确保所述网络设备的对端网络设备的聚合端口相关联的Mux机处于COLLECTING_DISTRIBUTING状态。因此,在实际的应用场景中,所述网络设备和所述对端网络设备之间的聚合链路可能出现一端聚合端口处于收集和分发状态,另一端聚合端口未处于收集和分发状态的情况,从而导致业务流量出现丢包。
发明内容
有鉴于此,本申请实施例提供了一种实现Mux机的方法、设备及系统,应用在运行LACP的网络中,实现Mux机中的聚合链路的两端聚合端口状态的检测和处理,有助于减少业务流量在传输过程中产生的丢包。
本申请实施例提供的技术方案如下。
第一方面,提供了一种实现Mux机的方法。所述方法应用于运行LACP的网络中,所述网络包括第一网络设备和第二网络设备,所述第一网络设备的第一聚合端口经由聚合链路与所述第二网络设备的第二聚合端口连接。所述第一网络设备在所述第一聚合端口的Mux机中设置PROTECT_WAITING状态,所述PROTECT_WAITING状态用于标识所述第一聚合端口未处于收集和分发状态,但向其他网络设备通告的所述第一聚合端口的状态为收集和分发状态。当所述Mux机处于所述PROTECT_WAITING状态时,所述第一网络设备确定所述第一聚合端口未处于收集和分发状态,并向所述二网络设备发送第一LACPDU报文,所述 第一LACPUD报文用于通告所述第二网络设备所述第一聚合端口处于收集和分发状态,并触发所述第二网络设备将所述第二聚合端口设置为收集和分发状态。然后,所述第一网络设备确定是否接收到来自所述第二网络设备的第二LACPDU报文,所述第二LACPDU报文用于指示所述第二聚合端口处于收集和分发状态。并且,当所述第一网络设备确定接收到所述第二LACPDU报文,所述第一网络设备将所述Mux机由所述PROTECT_WAITING状态切换为COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。
基于实施例提供的方案,所述第一网络在所述第一聚合端口的Mux机中设置PROTECT_WAITING状态。当所述Mux机处于所述PROTECT_WAITING状态时,所述第一网络设备确定所述第一聚合端口处于未处于收集和分发状态。然后,所述第一网络设备向所述二网络设备发送通告所述第一聚合端口处于收集和分发状态的第一LACPDU报文。并且,当所述第一网络设备确定接收到来自所述第二网络设备的、用于指示所述第二聚合端口处于收集和分发状态的第二LACPDU报文,所述第一网络设备将所述Mux机由所述PROTECT_WAITING状态切换为COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。本申请实施方式实现Mux机中的聚合链路单端口UP的检测和处理,从而有助于减少业务流量在传输过程中产生的丢包。
在第一方面的一种可能的实现方式中,在所述第一聚合端口的Mux机处于PROTECT_WAITING状态之前,所述Mux机处于ATTACHED状态,所述方法还包括,所述第一网络设备接收来自所述第二网络设备的第三LACPDU报文。当所述第一网络设备确定所述第一聚合端口处于选中状态,并且根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态,以及根据所述第三LACPDU报文确定所述第二聚合端口未处于收集和分发状态时,所述第一网络设备将所述Mux机由所述ATTACHED状态切换为所述PROTECT_WAITING状态。
基于上述实现方式,所述第一网络设备不仅通过所述第二LACPDU报文检测所述第二聚合端口的同步状态,还通过所述第二LACPDU报文检测所述第二聚合端口的收集和分发状态,从而确保在Mux机进入PROTECT_WAITING状态后,启动对所述第二聚合端口从未处于收集和分发状态到处于收集和分发状态的检测。
在第一方面的又一种可能的实现方式中,所述第一网络设备根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态,具体包括,所述第一网络设备确定所述第三LACPDU报文包括的第一信息与所述第一网络设备存储所述第一聚合端口的第二信息匹配,所述第一信息包括对端端口(英文:Partner_Port)、对端端口优先级(英文:Partner_Port_Priority)、对端系统(英文:Partner_System)、对端系统优先级(英文:Partner_System_Priority)、对端关键字(英文:Partner_Key)和对端状态聚合(英文:Partner_State.Aggregation),所述第二信息包括本端端口号(英文:Actor_Port_Number)、本端端口优先级(英文:Actor_Port_Priority)、本端系统(英文:Actor_System)、本端系统优先级(英文:Actor_System_Priority)、本端操作端口关键字(英文:Actor_Oper_Port_Key)和本端操作端口聚合(英文:Actor_Oper_Port_State.Aggregation)。所述第一网络设备确定所述第三LACPDU报文包括的本端状态同步Actor_State.Synchronization处于同步状态。
在第一方面的再一种可能的实现方式中,所述方法还包括,当所述第一网络设备根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态,并且根据所述第三LACPDU报文 确定所述第二聚合端口处于收集和分发状态时,所述第一网络设备将所述Mux机由所述ATTACHED状态切换为所述COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。
基于上述实现方式,所述第一网络设备在确定所述第二聚合端口处于收集和分发状态时,快速的进入双端口收集和分发的状态,有助于减少业务流量在传输过程中产生的丢包。
在第一方面的再一种可能的实现方式中,所述方法还包括,所述第一网络设备接收来自所述第二网络设备的第四LACPDU报文,所述第四LACPDU报文用于指示所述第二聚合端口未处于收集和分发状态。当所述第一网络设备根据所述第四LACPDU报文确定所述第二聚合端口未处于收集和分发状态时,将所述Mux机由所述COLLECTING_DISTRIBUTING状态切换为所述PROTECT_WAITING状态。
基于上述实现方式,当所述第一网络设备收到指示所述第二聚合端口状态为未处于收集和分发状态的第三LACPDU报文后,及时将Mux机切换为PROTECT_WAITING状态,有助于减少业务流量在传输过程中产生的丢包。
在第一方面的再一种可能的实现方式中,所述方法还包括,所述第一网络设备确定以下条件中至少一个条件成立时,将所述Mux机由所述PROTECT_WAITING状态切换为所述ATTACHED状态:所述第一网络设备确定所述第一聚合端口处于不选中状态;所述第一网络设备确定所述第一聚合端口处于备用状态;和,所述第一网络设备接收来自所述第二网络设备的第五LACPDU报文,并根据所述第五LACPDU报文确定所述第二聚合端口未处于同步状态。
在第一方面的再一种可能的实现方式中,所述第一网络设备包括定时器,在所述第一聚合端口的Mux机处于PROTECT_WAITING状态中,所述方法还包括,所述第一网络设备启动所述定时器;直到所述定时器超时,所述第一网络设备确定未接收到来自所述第二网络设备的所述第二LACPDU报文,所述第一网络设备将所述Mux机由所述PROTECT_WAITING状态切换为ATTACHED状态。
在第一方面的再一种可能的实现方式中,所述方法还包括,当所述Mux机处于PROTECT_WAITING状态,并且所述定时器超时时,所述第一网络设备将所述聚合链路设置为单端口UP,所述单端口UP用于指示所述聚合链路的一端聚合端口处于收集和分发状态,另一端聚合端口未处于收集和分发状态。
基于上述实现方式,可以避免所述Mux的ATTACHED状态和PROTECT_WAITING状态之间的反复震荡。
在第一方面中,可选的,在分离(英文:DETACHED)状态中,所述第一网络设备将所述单端口UP标志位的值设置为FALSE。
在第一方面中,可选的,所述定时器的时长大于等于3秒,并且所述定时器的时长小于等于90秒。
第二方面,提供了第一网络设备,所述第一网络设备具有实现上述方法中第一网络设备行为的功能。所述功能可以基于硬件实现,也可以基于硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。
在一个可能的设计中,第一网络设备的结构中包括处理器和接口,所述处理器被配置为支持第一网络设备执行上述方法中相应的功能。所述接口用于支持第一网络设备与第二网络设备之间的通信,向第二网络设备发送上述方法中所涉及的信息或者指令,或者从第二网 络设备接收上述方法中所涉及的信息或者指令。所述第一网络设备还可以包括存储器,所述存储器用于与处理器耦合,其保存第一网络设备必要的程序指令和数据。
在另一个可能的设计中,所述第一网络设备包括:处理器、发送器、随机存取存储器、只读存储器以及总线。其中,处理器通过总线分别耦接发送器、随机存取存储器以及只读存储器。其中,当需要运行第一网络设备时,通过固化在只读存储器中的基本输入/输出系统或者嵌入式系统中的bootloader引导系统进行启动,引导第一网络设备进入正常运行状态。在第一网络设备进入正常运行状态后,在随机存取存储器中运行应用程序和操作系统,使得该处理器执行第一方面或第一方面的任意可能的实现方式中的方法。
第三方面,提供一种第一网络设备,所述第一网络设备包括:主控板和接口板,进一步,还可以包括交换网板。所述第一网络设备用于执行第一方面或第一方面的任意可能的实现方式中的方法。具体地,所述第一网络设备包括用于执行第一方面或第一方面的任意可能的实现方式中的方法的模块。
第四方面,提供一种第一网络系统,所述第一网络系统包括控制器和第一转发设备。所述第一转发设备包括:接口板,进一步,还可以包括交换网板。所述第一转发设备用于执行第三方面中的接口板的功能,进一步,还可以执行第三方面中交换网板的功能。所述控制器包括接收器、处理器、发送器、随机存取存储器、只读存储器以及总线。其中,处理器通过总线分别耦接接收器、发送器、随机存取存储器以及只读存储器。其中,当需要运行控制器时,通过固化在只读存储器中的基本输入/输出系统或者嵌入式系统中的bootloader引导系统进行启动,引导控制器进入正常运行状态。在控制器进入正常运行状态后,在随机存取存储器中运行应用程序和操作系统,使得该处理器执行第三方面中主控板的功能。第五方面,提供一种实现Mux机的网络系统,所述网络系统包括第一网络设备和第二网络设备,所述第一网络设备和/或第二网络设备为前述第三方面或第四方面或第五方面中的第一网络设备。
第六方面,提供了一种计算机存储介质,用于储存为上述第一网络设备所用的程序、代码或指令,当处理器或硬件设备执行这些程序、代码或指令时可以完成上述方面中第一网络设备的功能或步骤。
通过上述方案,本申请实施例提供的用于实现Mux机的方法、设备及系统。所述第一网络在所述第一聚合端口的Mux机中设置PROTECT_WAITING状态。当所述Mux机处于所述PROTECT_WAITING状态时,所述第一网络设备确定所述第一聚合端口处于未处于收集和分发状态。然后,所述第一网络设备向所述二网络设备发送通告所述第一聚合端口处于收集和分发状态的第一LACPDU报文。并且,当所述第一网络设备确定接收到来自所述第二网络设备的、用于指示所述第二聚合端口处于收集和分发状态的第二LACPDU报文,所述第一网络设备将所述Mux机由所述PROTECT_WAITING状态切换为COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。本申请实施方式实现Mux机中的聚合链路单端口UP的检测和处理,从而有助于减少业务流量在传输过程中产生的丢包。
附图说明
图1为本申请实施例的一种运行LACP的网络结构示意图;
图2为本申请实施例的一种Mux机的状态图;
图3为本申请实施例的一种实现Mux机的方法流程图;
图4为本申请实施例的另一种Mux机的状态图;
图5为本申请实施例的第一网络设备的结构示意图;
图6为本申请实施例的第一网络设备的硬件结构示意图;
图7为本申请实施例的另第一网络设备的硬件结构示意图;
图8为本申请实施例的第一网络系统的硬件结构示意图。
具体实施方式
下面通过具体实施例,分别进行详细的说明。
本申请所涉及的LACP可以参见电气和电子工程师协会(英文:Institute of Electrical and Electronics Engineers,缩写:IEEE)802.1AX和IEEE 802.3AD的说明,IEEE 802.1AX和IEEE802.3A以全文引用的方式并入本申请中。在本申请实施例中,TRUE表示“真”或“条件成立”,在计算机编码中,TRUE的取值可以是“1”;FALSE表示“假”或“条件不成立”,在计算机编码中,FALSE的取值可以是“0”。在本申请实施例中,UP表示端口打开或可用,即:允许端口发送和接收数据报文;DOWN表示端口关闭或不可用,即:不允许端口发送和接收数据报文。在本申请实施例中,“确定”可以包括通过“设置”手段实现的方式,或者通过“保持”手段实现的方式。
图1为本申请实施例的一种运行LACP的网络结构示意。如图1所示,所述网络包括第一网络设备和第二网络设备。所述第一网络设备经由链路聚合组(英文:Link Aggregation Group,缩写:LAG)与所述第二网络设备通信。所述LAG包括至少一条聚合链路(英文:aggregation link)。举例说明,所述LAG包括聚合链路1,所述第一网络设备经由所述聚合链路1与所述第二网络设备通信。所述聚合链路1的一端为所述第一网络设备上的聚合端口(英文:aggregation port)11,所述聚合链路1的另一端为所述第二网络设备上的聚合端口21。所述第一网络设备上的聚合器(英文:aggregator)1和所述第二网络设备上的聚合器2与所述LAG关联。所述聚合器1和聚合器2分别用于管理所述LAG包括的聚合链路的聚合端口,例如aggregator1管理聚合端口11,aggregator2管理聚合端口21。
图1中示出了2台网络设备,应当理解,所述网络中包括的网络设备的数量不受限制,可以为2台或者3台或者更多数量。例如,所述网络还包括第三网络设备,所述第一网络设备经由LAG1与所述第二网络设备通信,所述第一网络设备经由LAG2与所述第三设备通信。经由LAG连接的两个网络设备之间可以包括其他网络设备。例如,所述第一网络设备与所述第二网络设备之间的LAG包括一台交换机。所述第一网络设备和所述第二网络设备可以是物理设备,所述物理设备包括路由器或交换机。所述第一网络设备和所述第二网络设备均可以连接其他网络设备。例如,所述第一网络设备连接客户机,所述第二网络设备连接服务器。所述客户端经由图1所示的网络与所述服务器通信。
本申请实施例中的LAG、聚合链路、聚合端口和聚合器的定义可以参见IEEE 802.1AX中的说明,此处不进行赘述。其中,网络设备可以包括一个或多个聚合器。所述网络设备包括的聚合器的数量可以多于、少于或等于所述网络设备包括的聚合端口的数量。所述网络设备上的同一个聚合端口可以同时归属不同的聚合器。
在图1中,所述第一网络设备和所述第二网络设备分别运行LACP。具体的,所述第一网络设备和所述第二网络设备的每个聚合端口关联一个LACP状态机,例如,聚合端口11关联LACP状态机11,聚合端口21关联LACP状态机21。由于聚合端口与LACP状态机是一一对应的,因此LACP状态机可以理解为:所述第一网络设备和所述第二网络设备在每个 聚合接口上实现的LACP状态机。所述LACP状态机包括接收状态机(英文:Receive machine,缩写:RX machine)、周期发送机(英文:Periodic Transmission machine,缩写:PTX machine)、选择逻辑(英文:Selection Logic)、Mux机(英文:Mux machine)和发送机(英文:Transmission machine,缩写:TX machine)。上述LACP状态机包括的5个子状态机的定义和实现原理可以参见IEEE 802.1AX中的说明,此处不进行赘述。所述第一网络设备和所述第二网络设备的每个聚合接口通过调用上述状态机,实现链路的聚合和解聚合。
以图1中的聚合链路1实现Mux机为例进行说明。所述聚合链路1的一端为所述第一网络设备上的聚合端口11,所述聚合链路1的另一端为所述第二网络设备上的聚合端口21。在所述聚合端口11和所述聚合端口21上分别实现Mux机。具体的,所述第一网络设备在所述聚合端口11上实现Mux机,所述第二网络设备在所述聚合端口21上实现Mux机。图2示出了一种耦合控制(英文:coupled control)模式的Mux机的状态图。如图2所示,所述Mux机包括分离(英文:DETACHED)、等待(英文:WAITING)、附接(英文:ATTACHED)和收集分发(英文:COLLECTING_DISTRIBUTING)4个状态。在图2中,在所述聚合端口11上实现的Mux机中,所述第一网络设备被视为本端(英文:actor),所述第二网络设备被视为对端(英文:partner);在所述聚合端口21上实现的Mux机中,所述第二网络设备被视为actor,所述第一网络设备被视为partner。图2中,“+”表示“或”,“*”表示“和”。所述第一网络设备在所述聚合端口11上实现Mux机,初始化时默认进入DETACHED状态。当Mux机处于DETACHED状态时,所述第一网络设备进行以下处理:
将本端操作端口同步状态(英文:Actor_Oper_Port_State.Synchronization,缩写:Actor.Sync)确定为FALSE,表示所述第一网络设备的聚合端口11未处于同步状态,或者可以认为是不同步状态。其中,所述Actor.Sync用于指示所述第一网络设备的聚合端口11的同步状态。将本端操作端口分发状态(英文:Actor_Oper_Port_State.Distributing,缩写:Actor.Distributing)确定为FALSE,表示所述聚合端口11未处于分发状态,或者可以认为是不分发状态。其中,所述Actor.Distributing用于指示所述聚合端口11的分发状态。
将本端操作端口收集状态(英文:Actor_Oper_Port_State.Collecting,缩写:Actor.Collecting)确定为FALSE,表示所述聚合端口11未处于收集状态,或者可以认为是不收集状态。其中,所述Actor.Collecting用于指示所述聚合端口11的收集状态。
将需要传送(英文:Need To Transmit,缩写:NTT)确定为TRUE,所述NTT用于指示是否允许所述第一网络设备与所述第二网络设备之间传送链路聚合控制协议数据单元(英文:Link Aggregation Control Protocol data unit,缩写:LACPDU)报文。
在本申请的实施例中,可以使用两个字段分别指示本端操作端口的分发状态和收集状态,例如上述中的Actor.Collecting和Actor.Distributing;也可以使用一个字段指示本端操作端口的分发状态和收集状态,例如Actor.Collecting_Distributing。同样的原则,可以使用两个字段分别指示对端操作端口的分发状态和收集状态,例如Partner.Collecting和Partner.Distributing;也可以使用一个字段指示本端操作端口的分发状态和收集状态,例如Partner.Collecting_Distributing。在本申请实施例中,使用Collecting和Distributing字段分别指示的方式和使用Collecting_Distributing指示的方式均可以表述为“收集和分发状态”。即,使用Collecting和Distributing字段分别指示的方式和使用Collecting_Distributing指示的方式均是“收集和分发状态”的实现方式。
当所述第一网络设备确定所述聚合端口11处于选中(英文:SELECTED)状态(如图 2中所示,Selected=SELECTED)或备用(英文:STANDBY)状态(如图2中所示,Selected=STANDBY),所述第一网络设备将Mux机由DETACHED状态切换为WAITING状态。具体的,所述第一网络设备可以调用Selection Logic选择与所述聚合端口11相关联的聚合器,根据图1,该聚合器为聚合器1。所述SELECTED状态用于指示合适的聚合器被选中。所述STANDBY状态用于指示合适的聚合器被选中,并且,与聚合器相关联的端口不使能聚合功能。当Mux机处于WAITING状态时,所述第一网络设备进行以下处理:启动等待时间计时器(英文:wait_while_timer)。在WAITING状态中,如果所述第一网络设备接收到触发事件,所述第一网络设备将所述聚合端口11确定为不选中(英文:UNSELECTED)状态(如图2中所示,Selected=UNSELECTED),所述第一网络设备将Mux机由WAITING状态切换为DETACHED状态。具体的,所述UNSELECTED状态可以由Selection Logic进行触发,也可以由RX machine进行触发。
当所述聚合端口11被确定为SELECTED状态,并且Ready状态为TRUE时,所述第一网络设备将Mux机由WAITING状态切换为ATTACHED状态。其中,如果在WAITING状态中,所述聚合端口11处于SELECTED状态,则所述wait_while_timer超时时,所述第一网络设备将Ready状态确定为TRUE。其中,Ready状态被确定TRUE表示所述wait_while_timer超时,并且等待聚合端口被附接到聚合器。如果在WAITING状态中,所述聚合端口11的处于STANDBY状态,则即使所述wait_while_timer超时,Ready状态不会被确定为TRUE,WAITING状态也不会改变。在ATTACHED状态下,所述第一网络设备将所述聚合端口11附接到所述聚合器1,并且在完成附接过程后进行以下处理:将所述Actor.Sync确定为TRUE,表示所述第一网络设备的聚合端口11处于同步状态。将所述Actor.Collecting确定为FALSE,表示所述聚合端口11未处于收集状态。将所述Actor.Distributing确定为FALSE,表示所述聚合端口11未处于分发状态。将所述NTT确定为TRUE。
如果所述第一网络设备接收到触发事件,导致所述第一网络设备将所述聚合端口11的确定为UNSELECTED状态或STANDBY状态,所述第一网络设备将Mux机由ATTACHED状态切换为DETACHED状态。Mux机进入DETACHED状态后,所述第一网络设备将所述聚合端口11从所述聚合器1中分离,并且,将聚合端口11的相应的状态信息确定为图2中DETACHED状态中所指示的状态。
当所述聚合端口11的处于SELECTED状态,并且,对端操作端口同步状态(英文:Partner_Oper_Port_State.Synchronization,缩写:Partner.Sync)被确定为TRUE,所述第一网络设备将Mux机由ATTACHED状态切换为COLLECTING_DISTRIBUTING状态。其中,所述Partner.Sync被确定为TRUE表示所述第一网络设备确定所述第二网络设备的聚合端口21处于同步状态,所述Partner.Sync用于指示所述第一网络设备确定所述聚合端口21的同步状态。具体的,所述Partner.Sync被确定为TRUE可以被解释为:所述第一网络设备获知所述聚合端口21处于同步状态,并且,所述第一网络设备认可所述聚合端口21的同步状态。其中,所述第一网络设备根据从所述第二网络设备接收到的LACPDU报文,确定所述Partner.Sync的状态。当Mux机处于COLLECTING_DISTRIBUTING状态时,所述第一网络设备进行以下处理:将所述Actor.Collecting确定为TRUE,表示所述聚合端口11处于收集状态。将所述Actor.Distributing确定为TRUE,表示所述聚合端口11处于分发状态。将所述NTT确定为TRUE。如此这样,Mux机进入COLLECTING_DISTRIBUTING状态后,所述第一网络设备根据所述聚合端口11处于收集和分发状态,将所述聚合端口11设置为UP,从而,所 述第一网络设备允许所述聚合端口11接收和发送数据报文。
如果所述第一网络设备接收到触发事件,导致所述聚合端口11的被确定为UNSELECTED状态或STANDBY状态,或者导致所述Partner.Sync被确定为FALSE,所述第一网络设备将Mux机由COLLECTING_DISTRIBUTING状态切换为ATTACHED状态。其中,Partner.Sync被确定为FALSE表示所述第一网络设备确定所述第二网络设备的聚合端口21未处于同步状态。
图2示出的实现Mux机的方法流程图中的各个状态的解释也可以参见IEEE 802.1AX中的说明。图2所示的Mux机可以应用在所述第一网络设备和第二网络设备的每个聚合端口上。所述第一网络设备在所述聚合端口11上实现图2所示的Mux机,并且所述Mux机进入COLLECTING_DISTRIBUTING状态后,所述第一网络设备无法确保所述第二网络设备的聚合端口21上实现的Mux机也处于COLLECTING_DISTRIBUTING状态。例如,如果所述第二网络设备存在异常,导致所述聚合端口21上的Mux机不能进入COLLECTING_DISTRIBUTING状态。这将导致聚合链路1的聚合端口11为UP状态,可以接收和发送数据报文;聚合链路1的聚合端口21为DOWN状态,不能接收和发送数据报文。从而,所述聚合链路1出现一端聚合端口处于收集和分发状态,另一端聚合端口未处于收集和分发状态的情况,或者可以认为是,聚合链路的一端聚合端口为UP,另一端聚合端口为DOWN。聚合链路上处于UP的聚合端口发出的数据报文,无法被聚合链路上处于DOWN的聚合端口接收,从而导致业务流量丢包。
在本申请实施例中,聚合链路的一端聚合端口处于收集和分发状态,另一端聚合端口未处于收集和分发状态的情况可以被称为单端口UP(英文:Single-port_UP),也就是说,聚合链路的一端聚合端口为UP,另一端聚合端口为DOWN的情况可以被称为单端口UP。其中,所述第二网络设备存在异常,可能是由于不同厂商网络设备的实现差异或者网络设备故障或者链路故障等导致的。
以图1为例说明,假设第一网络设备向第二网络设备发送的第一LACPDU报文是正确的,所述第二网络设备向所述第一网络设备发送的第二LACPDU报文存在错误。所述错误例如是所述第二LACPDU报文携带的本端系统(英文:Actor_System)或本端接口(英文:Actor_Port)等出现错误。其中,所述第二LACPDU报文中的Actor_System用于指示所述第二网络设备的系统标识,Actor_Port用于指示第二网络设备为聚合端口分配的端口号。所述第二LACPDU报文存在错误的原因可能包括:所述第一网络设备和所述第二网络设备之间链路上的其他网络设备因为故障造成所述第二LACPDU报文错误、所述第二网络设备在将所述第二LACPDU报文从控制平面下发到转发平面过程中因为故障造成所述第二LACPDU报文错误,或所述第一网络设备在将所述第二LACPDU报文从转发平面上报到控制平面过程中因为故障造成所述第二LACPDU报文错误。这样,所述第一网络设备根据第二LACPDU中的actor状态信息,保存错误的第二网络设备的状态信息,所述第一网络设备根据所述第二LACPDU报文识别出的partner不是所述第二网络设备,而是错误的第二网络设备;所述第二网络设备根据第一LACPDU中的actor状态信息,保存正确的第一网络设备的状态信息,所述第二网络设备根据所述第一LACPDU报文识别出的partner是正确的所述第一网络设备。根据LACP的实现,所述第一网络设备再次接收到来自所述第二网络设备的LACPDU报文(该LACPDU报文可能是正确的LACPDU报文,也可能是不同于第二LACPDU报文的另一错误的LACPDU报文),根据来自所述第二网络设备的LACPDU报文 中的partner状态信息,将Mux机的状态切换为COLLECTING_DISTRIBUTING状态。所述第二网络设备再次接收到来自所述第一网络设备的LACPDU报文,根据来自所述第一网络设备的LACPDU报文中的partner状态信息(该信息为之前存储的错误的所述第二网络设备的状态信息),确定Mux机的不进入COLLECTING_DISTRIBUTING状态。从而,所述第一网络设备的聚合端口进入稳态的UP状态,而聚合链路另一端的所述第二网络设备的聚合端口处于DOWN状态,聚合链路出现了单端口UP,导致业务流量丢包。
为了解决上述问题,本申请实施例对图2所示的Mux机进行重新设计,并且,该Mux机可以应用在图1所示的网络结构中。从而,所述第一网络在所述第一聚合端口的Mux机中设置保护等待(英文:PROTECT_WAITING)状态。当所述Mux机处于所述PROTECT_WAITING状态时,所述第一网络设备确定所述第一聚合端口处于未处于收集和分发状态。然后,所述第一网络设备向所述二网络设备发送第一LACPDU报文,所述第一LACPUD报文用于通告所述第二网络设备所述第一聚合端口处于收集和分发状态,并触发所述第二网络设备将所述第二聚合端口设置为收集和分发状态。并且,当所述第一网络设备确定接收到来自所述第二网络设备的、用于指示所述第二聚合端口处于收集和分发状态的第二LACPDU报文,所述第一网络设备将所述Mux机由所述PROTECT_WAITING状态切换为COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。
本申请实施方式实现Mux机中的聚合链路单端口UP的检测和处理,有助于减少业务流量在传输过程中产生的丢包。具体Mux机的实现方式请参见本申请后续实施例的说明。
图3为本申请实施例的一种实现Mux机的方法流程图。图3所示的方法可以应用于图1所示的运行LACP的网络中。所述网络包括第一网络设备和第二网络设备,所述第一网络设备的第一聚合端口经由聚合链路与所述第二网络设备的第二聚合端口连接,所述第一网络设备在所述第一聚合端口上实现所述Mux机。
在本实施例中,以图1中的LAG中的聚合链路1为例进行说明,其中,所述第一网络设备的聚合端口11经由聚合链路1与所述第二网络设备的聚合端口21连接。应当理解,所述第一网络设备包括的所有聚合接口和所述第二网络设备包括的所有聚合接口均可以运行图3所示的方法。图4示出了申请实施例的一种Mux机的状态图。图3所示的方法可以用于实现图4所示的Mux机。图4中未示出DETACHED状态、WAITING状态和ATTACHED状态下的操作,以及,图4中未示出DETACHED状态、WAITING状态和ATTACHED状态之间的切换条件。相应的,图4中的DETACHED状态、WAITING状态和ATTACHED状态下的操作,以及上述3个状态之间的切换条件可以参见图2的相应部分,图4中不再进行赘述;并且,上述3个状态之间相互转换的解释可以参见前述实施例的描述,此处不进行赘述。另外,关于actor和partner,以及“+”和“*”的解释,图4与前述图2的描述相同,此处不进行赘述。在本申请实施例中,所述第一聚合端口对应举例说明中的聚合端口11,所述第二聚合端口对应举例说明中的聚合端口21。本实施例结合图1和图4对图3所示的方法进行说明,所述方法包括:
S102、所述第一网络设备在所述第一聚合端口的Mux机中设置PROTECT_WAITING状态,所述PROTECT_WAITING状态用于标识所述第一聚合端口未处于收集和分发状态,但向其他网络设备通告的所述第一聚合端口的状态为收集和分发状态。
举例说明,所述第一网络设备在所述第一网络设备的聚合端口11上实现Mux机。所述第一网络设备在所述Mux机中设置PROTECT_WAITING状态,如图4所示。相比较图 2所示的Mux机,图4所示的Mux机在ATTACHED状态和COLLECTING_DISTRIBUTING状态之间增加了PROTECT_WAITING状态。当满足切换条件,所述第一网络设备可以实现所述聚合端口11的Mux机的ATTACHED状态和PROTECT_WAITING状态之间的切换。并且,当满足切换条件,所述第一网络设备还可以实现所述聚合端口11的Mux机的COLLECTING_DISTRIBUTING状态和PROTECT_WAITING状态之间的切换。
所述PROTECT_WAITING状态用于标识所述聚合端口11未处于收集和分发状态,但向其他网络设备通告的所述聚合端口11的状态为收集和分发状态。也就是说,在PROTECT_WAITING状态中,所述第一网络设备会将所述聚合端口11确定为未处于收集和分发状态。所述第一网络设备将所述聚合端口11确定为未处于收集和分发状态包括:所述第一网络设备将所述聚合端口11保持为未处于收集和分发状态,或者,所述第一网络设备将所述聚合端口11设置为未处于收集和分发状态。具体的,在一种可能的实现方式中,所述第一网络设备检测到所述聚合端口11未处于收集和分发状态,则维持所述聚合端口11未处于收集和分发状态。例如,当所述聚合端口11的Mux机由ATTACHED状态切换为PROTECT_WAITING状态时,所述聚合端口11未处于收集和分发状态。Mux机进入PROTECT_WAITING状态后,所述第一网络设备保持所述聚合端口11的未处于收集和分发状态。在另一种可能的实现方式中,所述第一网络设备检测到所述聚合端口11处于收集和分发状态,则将所述聚合端口11设置为未处于收集和分发状态。例如,当所述聚合端口11的Mux机由COLLECTING_DISTRIBUTING状态切换为PROTECT_WAITING状态时,所述聚合端口11处于收集和分发状态。Mux机进入PROTECT_WAITING状态后,所述第一网络设备将所述聚合端口11设置为未处于收集和分发状态。在又一种可能的实现方式中,所述第一网络设备不检测所述聚合端口11的状态,而是直接将所述聚合端口11设置为未处于收集和分发状态。
在PROTECT_WAITING状态中,所述第一网络设备将所述聚合端口11确定为未处于收集和分发状态后,所述第一网络设备向其他网络设备通告的所述聚合端口11的状态为收集和分发状态。所述其他网络设备包括与所述第一网络设备通过聚合链路通信的网络设备。所述第一网络设备向其他网络设备宣告:所述聚合端口11的状态为收集和分发状态。但实际上,所述聚合端口11的真实的状态为未处于收集和分发状态。
S104、当所述Mux机处于所述PROTECT_WAITING状态时,所述第一网络设备确定所述第一聚合端口未处于收集和分发状态,并向所述二网络设备发送第一LACPDU报文,所述第一LACPUD报文用于通告所述第二网络设备所述第一聚合端口处于收集和分发状态,并触发所述第二网络设备将所述第二聚合端口设置为收集和分发状态。
举例说明,当所述聚合端口11的Mux机处于所述PROTECT_WAITING状态时,所述第一网络设备进行以下处理:将Actor.Collecting确定为FALSE,表示所述聚合端口11未处于收集状态。将Actor.Distributing确定为FALSE,表示所述聚合端口11未处于分发状态。向其他网络设备通告Actor.Collecting为TRUE和Actor.Distributing为TRUE,表示所述聚合端口11处于收集和分发状态。将所述NTT确定为TRUE。
其中,上述Actor.Collecting和Actor.Distributing也可以由Actor.Collecting_Distributing表示。例如,Actor.Collecting_Distributing被确定为TRUE,表示所述聚合端口11处于收集状态和分发状态;Actor.Collecting_Distributing被确定为FALSE,表示所述聚合端口11未处于收集状态和分发状态。在本申请实施例中,上述两种表示方式均被涵盖在“收集和 分发状态”的范围内。所述第一网络设备将Actor.Collecting和Actor.Distributing确定为FALSE的实现方式,可以参见前述S102的说明,此处不进行赘述。
所述第一网络设备还向所述二网络设备发送第一LACPDU报文,所述第一LACPUD报文用于通告所述第二网络设备所述聚合端口11处于收集和分发状态。另外,所述第一LACPDU报文还用于触发所述第二网络设备将所述聚合端口21设置为收集和分发状态。具体的,所述第二网络设备接收到所述第一LACPDU报文后,根据所述第一LACPDU报文确定所述聚合端口11的状态为收集和分发状态,触发将所述聚合端口21设置为收集和分发状态的过程。
其中,所述第一LACPDU报文是由所述第一网络设备向所述第二网络设备发送的LACPDU报文。所述第一LACPDU报文携带有本端状态(英文:Actor_State)字段,所述Actor_State字段长度为1字节。所述Actor_State字段包括Collecting标志位和Distributing标志位。所述Collecting标志位和Distributing标志位用于指示所述聚合端口11是否处于收集和分发状态。例如,当Collecting标志位和Distributing标志位均被置位为1时,表示聚合端口11处于收集和分发状态。其中,LACPDU报文和Actor_State的格式也可以参见IEEE 802.1AX中图5-8和图5-9的说明。另外,所述第二网络设备可以调用RX machine完成对所述第一LACPDU报文的接收和处理。
S106、所述第一网络设备确定是否接收到来自所述第二网络设备的第二LACPDU报文,所述第二LACPDU报文用于指示所述第二聚合端口处于收集和分发状态。
举例说明,如果所述第二网络设备被所述第一LACPDU报文触发成功,所述第二网络设备将生成所述第二LACPDU报文,并且将所述第二LACPDU报文向所述第一网络设备发送。或者,如果所述第二网络设备存在故障或异常,可能导致所述聚合端口21未处于收集和分发状态,从而,所述第二网络设备在接收到所述第一LACPDU报文的情况下,无法向所述第一网络设备发送所述第二LACPDU报文。
所述第一网络设备检测是否接收到来自所述第二网络设备的第二LACPDU报文,所述第二LACPDU报文用于指示所述聚合端口21处于收集和分发状态。从而,所述第一网络设备可以确定所述聚合链路1是否存在一端的聚合端口处于收集和分发状态,另一端的聚合端口未处于收集和分发状态(不收集和不转发状态)的情况。也就是说,所述第一网络设备可以检测所述聚合链路1是否存在单端口UP的情况。具体的,所述第一网络设备检测聚合链路1是否为单端口UP的实现方式是:如果所述第二网络设备的聚合端口21处于收集和分发状态,则所述聚合链路1不属于单端口UP。如果所述第二网络设备的聚合端口21始终未处于收集和分发状态,则所述聚合链路1为单端口UP。
其中,所述第二LACPDU报文是由所述第二网络设备向所述第一网络设备发送的LACPDU报文。所述第二LACPDU报文携带有Actor_State字段,所述Actor_State字段长度为1字节。所述Actor_State字段包括Collecting标志位和Distributing标志位。所述Collecting标志位和Distributing标志位用于指示所述聚合端口21是否处于收集和分发状态。例如,当Collecting标志位和Distributing标志位均被置位为1时,表示聚合端口21处于收集和分发状态。其中,LACPDU报文和Actor_State的格式也可以参见IEEE 802.1AX中图5-8和图5-9的说明。另外,所述第一网络设备可以调用RX machine完成对所述第二LACPDU报文的接收和处理。
S108、当所述第一网络设备确定接收到所述第二LACPDU报文,所述第一网络设备 将所述Mux机由所述PROTECT_WAITING状态切换为COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。
根据LACP,actor或partner的聚合端口发生状态信息的变化,可以通过LACPDU报文通知对方。例如,所述第二网络设备的聚合端口21的Mux机由ATTACHED状态切换为COLLECTING_DISTRIBUTING状态,所述第二网络设备将所述聚合端口21的收集状态切换为收集和将所述聚合端口21的分发状态切换为分发。如此这样,所述聚合端口21发生了状态信息的变化。所述第二网络设备将向所述第一网络设备发送第二LACPDU报文,所述第二LACPDU报文用于指示所述聚合端口21处于收集和分发状态。在图4所示的Mux机中,所述第一网络设备确定是否接收到所述第二LACPDU报文。从而,第一网络设备可以根据所述第二LACPDU报文,确定所述聚合端口21是否处于收集和分发状态。
如果所述第一网络设备接收到所述第二LACPDU报文,则说明所述第二设备将聚合端口21的收集状态确定为收集和将聚合端口21的分发状态确定为分发。所述第一网络设备根据指示所述第二设备的聚合端口21处于收集和分发状态的所述第二LACPDU报文,将所述Mux机由所述PROTECT_WAITING状态切换为COLLECTING_DISTRIBUTING状态。具体的,所述第一网络设备根据所述第二LACPDU报文携带的Actor_State字段中的Collecting标志位为TRUE,所述第一网络设备确定对端操作端口收集状态(英文:Partner_Oper_Port_State.Collecting,缩写:Partner.Collecting)的值为TRUE。所述第一网络设备根据所述第二LACPDU报文携带的所述Actor_State字段中的Distributing标志位为TRUE,所述第一网络设备确定对端操作端口分发状态(英文:Partner_Oper_Port_State.Distributing,缩写:Partner.Distributing)的值为TRUE。所述第一网络设备根据Partner.Collecting=TRUE和Partner.Distributing=TRUE,将所述Mux机由所述PROTECT_WAITING状态切换为COLLECTING_DISTRIBUTING状态。
当所述聚合端口11的Mux机处于COLLECTING_DISTRIBUTING状态,所述第一网络设备将所述聚合端口11设置为收集和分发状态。从而,所述聚合端口11和聚合端口21均处于收集和分发状态。也就是说,所述聚合链路1的聚合端口11和聚合端口21均为UP。即,所述第一网络设备允许所述聚合端口11接收和发送数据报文,并且,所述第二网络设备允许所述聚合端口21接收和发送数据报文。
图4所示的Mux机通过增加PROTECT_WAITING状态,确保了聚合链路两端的聚合端口均UP的情况下,将聚合端口的Mux机切换到稳定的收集和分发状态。
通过上述实施方式,在运行LACP的网络场景中,所述第一网络在所述第一聚合端口的Mux机中设置PROTECT_WAITING状态。当所述Mux机处于所述PROTECT_WAITING状态时,所述第一网络设备确定所述第一聚合端口处于未处于收集和分发状态。然后,所述第一网络设备向所述二网络设备发送第一LACPDU报文,所述第一LACPUD报文用于通告所述第二网络设备所述第一聚合端口处于收集和分发状态,并触发所述第二网络设备将所述第二聚合端口设置为收集和分发状态。并且,当所述第一网络设备确定接收到来自所述第二网络设备的、用于指示所述第二聚合端口处于收集和分发状态的第二LACPDU报文,所述第一网络设备将所述Mux机由所述PROTECT_WAITING状态切换为COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。本申请实施方式实现Mux机中的聚合链路单端口UP的检测和处理,从而有助于减少业务流量在传输过程中产生的丢包。
应当理解,本申请实施例的图3所示的方法是以所述第一网络设备的聚合端口实现Mux机为例说明,图3所示的方法同样可以应用在所述第二网络设备的聚合端口中。而且,对于同一条聚合链路而言,所述聚合链路的两个聚合端口均实现图4所示的Mux机。举例说明,图1所示的聚合链路1的聚合端口11在实现图4所示的Mux机期间,聚合链路1的聚合端口21也在实现图4所示的Mux机。并且,在所述聚合端口11的Mux机中,所述第一网络设备被视为actor,所述第二网络设备被视为partner;在所述聚合端口21的Mux机中,所述第二网络设备被视为actor,所述第一网络设备被视为partner。
可选的,所述第一网络设备包括定时器,在所述第一聚合端口的Mux机处于PROTECT_WAITING状态中,所述方法还包括:所述第一网络设备启动定时器;直到所述定时器超时,所述第一网络设备确定未接收到来自所述第二网络设备的所述第二LACPDU报文,所述第一网络设备将所述Mux机由所述PROTECT_WAITING状态切换为ATTACHED状态。
举例说明,所述第一网络设备中还设置有定时器,所述定时器与所述聚合端口11相关联。所述第一网络设备在计时器计时期间检测是否接收到来自所述第二网络设备的第二LACPDU报文。所述定时器可以由硬件计时器或者软件计时器实现。通过设置所述定时器,可以防止所述聚合端口11的Mux机长时间处于所述PROTECT_WAITING状态。在一种可能的实现方式中,所述定时器的时长可以根据组网的实际场景和网络设备的性能要求进行设定,例如,3s≤T≤90s,其中T表示定时器的时长,s表示秒。
如果从所述定时器开始计时起,直到所述定时器超时,所述第一网络设备始终没有接收到所述第二LACPDU报文,所述第一网络设备确定所述聚合链路1为单端口UP。也就是说,直到所述定时器超时,所述第一网络设备始终没有接收到所述第二LACPDU报文,所述第一网络设备可以确定所述聚合端口21未处于收集和分发状态。基于上述情况,所述第一网络设备会将所述聚合端口11的所述Mux机由所述PROTECT_WAITING状态切换为ATTACHED状态(如图4所示)。其中,所述直到所述定时器超时,所述第一网络设备始终没有接收到所述第二LACPDU报文包括:从所述定时器开始计时起,直到所述定时器超时,所述第一网络设备没有接收到任何来自所述第二网络设备的LACPDU报文;或者,从所述定时器开始计时起,直到所述定时器超时,所述第一网络设备接收到来自所述第二网络设备的LACPDU报文,但该LACPDU报文并没有指示所述所述聚合端口21处于收集和分发状态。
可选的,所述方法还包括:当所述Mux机处于COLLECTING_DISTRIBUTING状态,并且所述定时器超时时,所述第一网络设备将所述聚合链路设置为单端口UP,所述单端口UP用于指示所述聚合链路的一端聚合端口处于收集和分发状态,另一端聚合端口未处于收集和分发状态
举例说明,所述第一网络设备还可以设置Single-port_UP。所述Single-port_UP用于指示聚合链路是否为单端口UP。其中,所述Single-port_UP被部署在Mux机中,根据所述定时器进行触发。具体的,在PROTECT_WAITING状态中,直到所述定时器超时,所述第一网络设备未接收到来自所述第二网络设备的所述第二LACPDU报文,所述第一网络设备将所述Single-port_UP标志位的值被设置为TRUE,即Single-port_UP=TRUE。其中,Single-port_UP标志位的值被设置为TRUE表示所述聚合链路1存在单端口UP的情况。因此,直到所述定时器超时,所述第一网络设备未接收到所述第二LACPDU报文,所述第 一网络设备会将所述聚合端口11的Mux机由PROTECT_WAITING状态切换为ATTACHED状态,并且,所述第一网络设备将所述Single-port_UP标志位的值被设置为TRUE。
所述第一网络设备的聚合端口11的所述Mux机进入ATTACHED状态后,由于所述Single-port_UP标志位的值为TRUE,所述第一网络设备不会将所述Mux由ATTACHED状态切换为PROTECT_WAITING状态。因此,进一步的有益效果是:所述Single-port_UP可以避免所述Mux的ATTACHED状态和PROTECT_WAITING状态之间的反复震荡。
可选的,Mux机处于DETACHED状态时,所述第一网络设备将所述单端口UP标志位的值设置为FALSE。
所述DETACHED状态可以被看作Mux机的初始化阶段,在DETACHED状态中,所述第一网络设备将Single-port_UP标志位的值设置为FALSE(Single-port_UP=FALSE),表示聚合链路1未处于单端口UP。在本申请实施例中,所述未处于单端口UP可能存在两种情况:所述聚合链路1的聚合端口11和聚合端口21均为DOWN,或者,所述聚合链路1的聚合端口11和聚合端口21均为UP(聚合端口11为UP包括对外通告为UP的情况)。在所述DETACHED状态中,将Single-port_UP标志位的值设置为FALSE,有助于避免旧的Single-port_UP标志位的值影响Mux机的运行。
可选的,在S102或S104之前,所述第一聚合端口的Mux机处于所述ATTACHED状态,所述方法还包括S1001和S1002,以便完成所述第一网络设备将所述Mux机由ATTACHED状态切换为PROTECT_WAITING状态的过程,如图4所示。
S1001、所述第一网络设备接收来自所述第二网络设备的第三LACPDU报文;
S1002、当所述第一网络设备确定所述第一聚合端口处于选中状态,并且根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态,以及根据所述第三LACPDU报文确定所述第二聚合端口未处于收集和分发状态时,所述第一网络设备将所述Mux机由所述ATTACHED状态切换为所述PROTECT_WAITING状态。
举例说明,所述第一网络设备可以调用Selection Logic选择与所述聚合端口11相关联的聚合器,根据图1,该聚合器为聚合器1。所述SELECTED用于指示合适的聚合器被选中。当所述Selection Logic完成所述聚合端口11相关联的聚合器的选择后,所述第一网络设备可以确定所述第一网络设备的聚合端口11处于选中状态(Selected=SELECTED)。
所述第一网络设备可以调用RX machine,使用RX machine完成对所述第三LACPDU报文的接收和处理。所述第三LACPDU报文是由所述第二网络设备发送的。所述第三LACPDU报文被用于确定所述聚合端口21是否处于同步状态,并且所述第三LACPDU报文还被用于确定所述聚合端口21是否处于收集和分发状态。当所述聚合端口11处于选中状态,并且所述第一网络设备根据所述第三LACPDU报文确定所述聚合端口21处于同步状态,以及根据所述第三LACPDU报文确定所述聚合端口21未处于收集和分发状态时,所述第一网络设备将所述聚合端口11的Mux机由ATTACHED状态切换为PROTECT_WAITING状态。
其中,所述第三LACPDU报文中的用于指示所述聚合端口21的状态信息包括Actor_State,所述Actor_State包括Collecting标志位和Distributing标志位。所述第一网络设备确定所述第三LACPDU报文中所述Actor_State包括的Collecting标志位和Distributing 标志位是否被设置为TRUE。当Collecting标志位和Distributing标志位被设置为FALSE时,所述第一网络设备确定所述聚合端口21未处于收集和分发状态。
通过上述S1001和S1002的实现方式,所述第一网络设备的聚合端口11的Mux机处于ATTACHED状态中,当所述第一网络设备确定所述聚合端口21处于同步状态和所述聚合端口21未处于收集和分发状态的情况下,所述第一网络设备将聚合端口11的Mux机切换为PROTECT_WAITING状态。从而,确保在Mux机进入PROTECT_WAITING状态后,启动对所述第二聚合端口从未处于收集和分发状态到处于收集和分发状态的检测。
在S1002中,进一步可选的,所述方法还包括S10021和S10022。S10021和S10022说明了所述第一网络设备根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态的实现方式。
S10021、所述第一网络设备确定所述第三LACPDU报文包括的第一信息与所述第一网络设备存储所述第一聚合端口的第二信息匹配,所述第一信息包括Partner_Port、Partner_Port_Priority、Partner_System、Partner_System_Priority、Partner_Key和Partner_State.Aggregation,所述第二信息包括Actor_Port_Number、Actor_Port_Priority、Actor_System、Actor_System_Priority、Actor_Oper_Port_Key和Actor_Oper_Port_State.Aggregation。
S10022、所述第一网络设备确定所述第三LACPDU报文包括的本端状态同步Actor_State.Synchronization处于同步状态。
所述第一网络设备根据所述第三LACPDU报文确定所述聚合端口21是否处于同步状态。具体的,所述第三LACPDU报文中的所述第一信息包括:对端端口(英文:Partner_Port)、对端端口优先级(英文:Partner_Port_Priority)、对端系统(英文:Partner_System)、对端系统优先级(英文:Partner_System_Priority)、对端关键字(英文:Partner_Key)和对端状态聚合(英文:Partner_State.Aggregation)。所述第一网络设备确定上述信息与所述第一网络设备存储的所述第二信息,即本端操作参数值(英文:corresponding operational parameter values for the Actor)是否匹配。所述第一网络设备存储的本端操作参数值包括:本端端口号(英文:Actor_Port_Number)、本端端口优先级(英文:Actor_Port_Priority)、本端系统(英文:Actor_System)、本端系统优先级(英文:Actor_System_Priority)、本端操作端口关键字(英文:Actor_Oper_Port_Key)和本端操作端口聚合(英文:Actor_Oper_Port_State.Aggregation)。而且,所述第三LACPDU报文中的用于指示所述聚合端口21的状态信息包括本端状态同步(英文:Actor_State.Synchronization),所述Actor_State.Synchronization是所述第三LACPDU报文中的Actor_State字段的Synchronization标志位。所述第一网络设备确定所述第三LACPDU报文中Actor_State.Synchronization是否被设置为TRUE。其中,上述各个信息的定义可以参见IEEE 802.1AX中的说明,此处不进行赘述。
其中,可选的,用于确定所述第二网络设备的聚合端口21的同步状态的信息和用于确定所述聚合端口21的收集和分发状态的信息可以被携带在不同的第三LACPDU报文中。例如,用于确定所述聚合端口21的同步状态的信息被携带在一个第三LACPDU报文中;用于确定所述聚合端口21的收集和分发状态的信息被携带在另一个第三LACPDU报文中。两个第三LACPDU报文被所述第二网络设备分别发送到所述第一网络设备。
所述第一网络设备确定所述第三LACPDU报文中包括的Partner_Port、 Partner_Port_Priority、Partner_System、Partner_System_Priority、Partner_Key和Partner_State.Aggregation与所述第一网络设备存储的Actor_Port_Number、Actor_Port_Priority、Actor_System、Actor_System_Priority、Actor_Oper_Port_Key和Actor_Oper_Port_State.Aggregation相匹配,并且,所述第一网络设备确定所述第三LACPDU报文中包括的Actor_State.Synchronization为TRUE,所述第一网络设备确定所述聚合端口21处于同步状态,即所述第一网络设备将Partner.Sync确定为TRUE。具体的,所述Partner.Sync被确定为TRUE可以被解释为:所述第一网络设备获知所述聚合端口21处于同步状态(根据Actor_State.Synchronization=TRUE),并且,所述第一网络设备认可所述聚合端口21处于同步状态(根据上述匹配的结果)。
可选的,所述方法还包括S1003,基于前述S1001中的第三LACPDU报文,以便完成所述第一网络设备将所述第一聚合端口的Mux机由ATTACHED状态切换为COLLECTING_DISTRIBUTING状态的过程,如图4所示。
S1003、当所述第一网络设备根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态,并且根据所述第三LACPDU报文确定所述第二聚合端口处于收集和分发状态时,所述第一网络设备将所述Mux机由所述ATTACHED状态切换为所述COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。
举例说明,根据S1001,所述第一网络设备接收到所述第三LACPDU报文后,确定所述第三LACPDU报文中包括的Partner_Port、Partner_Port_Priority、Partner_System、Partner_System_Priority、Partner_Key和Partner_State.Aggregation与所述第一网络设备存储的Actor_Port_Number、Actor_Port_Priority、Actor_System、Actor_System_Priority、Actor_Oper_Port_Key和Actor_Oper_Port_State.Aggregation相匹配,并且,所述第一网络设备确定所述第三LACPDU报文中包括的Actor_State.Synchronization为TRUE,所述第一网络设备确定所述聚合端口21处于同步状态。所述第一网络设备还确定所述第三LACPDU报文中所述Actor_State包括的Collecting标志位和Distributing标志位为TRUE,从而,所述第一网络设备确定所述聚合端口21处于收集和分发状态。因此,所述第一网络设备可以根据上述确定结果,将所述Mux机由所述ATTACHED状态切换为所述COLLECTING_DISTRIBUTING状态。
S1003说明了在ATTACHED状态中,所述第一网络设备已经确认所述聚合端口21处于收集和分发状态,或者可以认为是,所述聚合端口21为UP。因此,所述聚合端口11运行的Mux机不再进入PROTECT_WAITING状态,而是由ATTACHED状态直接切换为COLLECTING_DISTRIBUTING状态。进入COLLECTING_DISTRIBUTING状态后,所述第一网络设备将所述聚合端口11设置为收集和分发状态。也就是说,所述Actor.Collecting和Actor.Distributing被确定为TRUE,表示所述聚合端口11处于收集和分发状态。所述聚合端口11被设置为UP,聚合链路1进入稳定的转发状态。
在S1003中,可选的,所述第一网络设备将所述Single-port_UP标志位的值设置为FALSE。这样设置的目的是为了防止Mux机中可能存在Single-port_UP=TRUE的旧信息造成Mux机的误操作。
通过上述S1003的实现方式,所述聚合端口11的Mux机处于ATTACHED状态中,当所述第一网络设备确定所述聚合端口21处于同步状态和所述聚合端口21已经处于收集和分发状态的情况下,所述第一网络设备将所述聚合端口11上运行的Mux机切换为 COLLECTING_DISTRIBUTING状态。基于上述实现方式,所述第一网络设备在确定所述第二聚合端口处于收集和分发状态时,快速的进入双端口收集和分发的状态,有助于减少业务流量在传输过程中产生的丢包。
可选的,所述方法还包括S1101和S1102,以便完成所述第一网络设备将所述第一聚合端口的Mux机由COLLECTING_DISTRIBUTING状态切换为PROTECT_WAITING状态的过程,如图4所示。
S1101、所述第一网络设备接收来自所述第二网络设备的第四LACPDU报文,所述第四LACPDU报文用于指示所述第二聚合端口未处于收集和分发状态;
S1102、当所述第一网络设备根据所述第四LACPDU报文确定所述第二聚合端口未处于收集和分发状态时,将所述Mux机由所述COLLECTING_DISTRIBUTING状态切换为所述PROTECT_WAITING状态。
根据前述实施例的描述,当所述聚合端口11的Mux机处于COLLECTING_DISTRIBUTING状态中,所述聚合端口11和所述聚合端口21均为收集和分发状态,聚合链路1的两端均为UP,所述第一网络设备和所述第二网络设备经由所述聚合链路1互相转发数据报文。
根据LACP,actor或partner的聚合端口发生状态信息的变化,均会通过LACPDU报文通知对方。假设所述第二网络设备发生异常,导致所述聚合端口21收集状态由收集切换为不收集和所述聚合端口21分发状态由分发切换为不分发。所述第二网络设备向所述第一网络设备发送所述第四LACPDU报文,所述第四LACPDU报文中的Actor_State包括Collecting标志位和Distributing标志位。其中,所述Collecting被确定为FALSE,表示所述聚合端口21未处于收集状态。所述Distributing被确定为FALSE,表示所述聚合端口21未处于分发状态。所述第一网络设备根据所述第四LACPDU报文携带的所述Actor_State字段中的Collecting标志位为FALSE,所述第一网络设备确定Partner.Collecting的值为FALSE。所述第一网络设备根据所述第四LACPDU报文携带的所述Actor_State字段中的Distributing标志位为FALSE,所述第一网络设备确定Partner.Distributing的值为FALSE。所述第一网络设备根据Partner.Collecting=FALSE和Partner.Distributing=FALSE,将所述Mux机由COLLECTING_DISTRIBUTING状态切换为PROTECT_WAITING状态。
通过上述S1101和S1102的实现方式,所述聚合端口11的Mux机处于COLLECTING_DISTRIBUTING状态中,当所述第一网络设备确定所述聚合端口21未处于收集和分发状态时,所述第一网络设备将聚合端口11的所述Mux机由COLLECTING_DISTRIBUTING状态切换为PROTECT_WAITING状态。基于上述实现方式,当所述第一网络设备收到指示所述第二聚合端口状态为未处于收集和分发状态的第四LACPDU报文后,及时将Mux机切换为PROTECT_WAITING状态,有助于减少业务流量在传输过程中产生的丢包。
可选的,所述方法还包括S1201,以便完成所述第一网络设备将所述第一聚合端口的Mux机由PROTECT_WAITING状态切换为ATTACHED状态的过程,如图4所示。
S1201、所述第一网络设备确定以下条件中至少一个条件成立时,将所述Mux机由所述PROTECT_WAITING状态切换为所述ATTACHED状态:所述第一网络设备确定所述第一聚合端口处于不选中状态;所述第一网络设备确定所述第一聚合端口处于备用状态;和,所述第一网络设备接收来自所述第二网络设备的第五LACPDU报文,并根据所述第五 LACPDU报文确定所述第二聚合端口未处于同步状态。
举例说明,当所述聚合端口11的Mux机处于PROTECT_WAITING状态中,所述聚合端口11可能发生状态变化。例如,所述聚合端口11变更为不选择聚合器1,所述第一网络设备将聚合端口11的选中状态切换为UNSELECTED。又例如,所述第一网络设备的聚合端口11变更为选择聚合器1,但聚合端口11不使能聚合功能,所述第一网络设备将聚合端口11的选中状态切换为STANDBY。基于所述聚合端口11处于UNSELECTED状态或STANDBY状态,所述第一网络设备将所述聚合端口11的Mux机由PROTECT_WAITING状态切换为ATTACHED状态。其中,所述UNSELECTED状态可以由Selection Logic进行触发,也可以由RX machine进行触发;所述STANDBY状态可以由Selection Logic进行触发。
当所述聚合端口11运行的Mux机处于PROTECT_WAITING状态中,所述第一网络设备还可能接收来自所述第二网络设备的第五LACPDU报文,所述第五LACPDU报文被用于确定所述聚合端口21是否处于同步状态。所述第一网络设备根据所述第五LACPDU报文确定所述第二网络设备的聚合端口21未处于同步状态。其中,所述第一网络设备根据所述第五LACPDU报文确定所述第二网络设备的聚合端口21未处于同步状态的实现方式可以参见前述S10021和S10022的相应描述,此处不进行赘述。基于聚合端口21未处于同步状态,所述第一网络设备将所述聚合端口11的Mux机由PROTECT_WAITING状态切换为ATTACHED状态。
可选的,所述方法还包括S1301,以便完成所述第一网络设备将Mux机由COLLECTING_DISTRIBUTING状态切换为ATTACHED状态的过程,如图4所示。
S1301、所述第一网络设备确定以下条件中至少一个条件成立时,将所述第一聚合接口的所述Mux机由所述COLLECTING_DISTRIBUTING状态切换为所述ATTACHED状态:所述第一网络设备确定所述第一聚合端口处于不选中状态;所述第一网络设备确定所述第一聚合端口处于备用状态;和,所述第一网络设备接收来自所述第二网络设备的第五LACPDU报文,并根据所述第五LACPDU报文确定所述第二聚合端口未处于同步状态。所述第一网络设备根据触发条件,将所述聚合端口11的Mux机由COLLECTING_DISTRIBUTING状态切换为ATTACHED状态的实现方式可以参见前述S1201的相应描述,此处不进行赘述。
可选的,在S1301后,所述方法还包括:
S1302、所述Mux机在ATTACHED状态中,所述第一网络设备停止所述定时器。
在PROTECT_WAITING状态中,所述第一网络设备启动了所述定时器。所述第一网络设备根据上述触发条件将所述Mux机由所述PROTECT_WAITING状态切换为所述ATTACHED状态后,所述定时器仍然在计时。在ATTACHED状态中,为了防止所述定时器超时导致Single-port_UP=TRUE,所述第一网络设备停止所述定时器的计时。
图5为本申请实施例的第一网络设备1000的结构示意图。图5所示的第一网络设备1000可以执行上述实施例的方法中第一网络设备执行的相应步骤。所述第一网络设备1000运行有LACP,所述第一网络设备1000的第一聚合端口经由聚合链路与所述第二网络设备的第二聚合端口连接。如图5所示,所述第一网络设备1000包括处理单元1002和发送单元1004。
所述处理单元1002,用于在所述第一聚合端口的Mux机中设置PROTECT_WAITING状态,所述PROTECT_WAITING状态用于标识所述第一聚合端口未处于收集和分发状态,但向其他网络设备通告的所述第一聚合端口的状态为收集和分发状态;
所述处理单元1002还用于当所述Mux机处于所述PROTECT_WAITING状态时,确定所述第一聚合端口未处于收集和分发状态;
所述发送单元1004,用于向所述二网络设备发送第一LACPDU报文,所述第一LACPUD报文用于通告所述第二网络设备所述第一聚合端口处于收集和分发状态,并触发所述第二网络设备将所述第二聚合端口设置为收集和分发状态;
所述处理单元1002还用于确定是否接收到来自所述第二网络设备的第二LACPDU报文,所述第二LACPDU报文用于指示所述第二聚合端口处于收集和分发状态;
当所述处理单元1002确定接收到所述第二LACPDU报文,所述处理单元1002还用于将所述Mux机由所述PROTECT_WAITING状态切换为COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。
可选的,在所述第一聚合端口的Mux机处于PROTECT_WAITING状态之前,所述Mux机处于附接ATTACHED状态,所述第一网络设备还包括接收单元。所述接收单元用于接收来自所述第二网络设备的第三LACPDU报文。当所述处理单元1002确定所述第一聚合端口处于选中状态,并且根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态,以及根据所述第三LACPDU报文确定所述第二聚合端口未处于收集和分发状态时,所述处理单元1002还用于将所述Mux机由所述ATTACHED状态切换为所述PROTECT_WAITING状态。
可选的,所述处理单元1002根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态,具体包括:所述处理单元1002还用于确定所述第三LACPDU报文包括的第一信息与所述第一网络设备存储所述第一聚合端口的第二信息匹配,所述第一信息包括Partner_Port、Partner_Port_Priority、Partner_System、Partner_System_Priority、Partner_Key和Partner_State.Aggregation,所述第二信息包括Actor_Port_Number、Actor_Port_Priority、Actor_System、Actor_System_Priority、Actor_Oper_Port_Key和Actor_Oper_Port_State.Aggregation。所述处理单元1002还用于确定所述第三LACPDU报文包括的Actor_State.Synchronization处于同步状态。
可选的,当所述处理单元1002根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态,并且根据所述第三LACPDU报文确定所述第二聚合端口处于收集和分发状态时,所述处理单元1002还用于将所述Mux机由所述ATTACHED状态切换为所述COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。
可选的,所述接收单元还用于接收来自所述第二网络设备的第四LACPDU报文,所述第四LACPDU报文用于指示所述第二聚合端口未处于收集和分发状态。当所述处理单元1002根据所述第四LACPDU报文确定所述第二聚合端口未处于收集和分发状态时,所述处理单元1002还用于将所述Mux机由所述COLLECTING_DISTRIBUTING状态切换为所述PROTECT_WAITING状态。
可选的,所述处理单元1002确定以下条件中至少一个条件成立时,所述处理单元1002还用于将所述Mux机由所述PROTECT_WAITING状态切换为所述ATTACHED状态:所述处理单元1002还用于确定所述第一聚合端口处于不选中状态;所述处理单元1002还用于确定所述第一聚合端口处于备用状态;和,所述处理单元1002还用于根据接收到的来自所述第二网络设备的第五LACPDU报文确定所述第二聚合端口未处于同步状态。
可选的,在所述第一聚合端口的Mux机处于PROTECT_WAITING状态中,所述处理 单元1002还用于启动定时器。直到所述定时器超时,所述处理单元1002确定未接收到来自所述第二网络设备的所述第二LACPDU报文,所述处理单元1002还用于将所述Mux机由所述PROTECT_WAITING状态切换为ATTACHED状态。
可选的,当所述Mux机处于PROTECT_WAITING状态,并且所述定时器超时时,所述处理单元1002还用于将所述聚合链路设置为单端口UP,所述单端口UP用于指示所述聚合链路的一端聚合端口处于收集和分发状态,另一端聚合端口未处于收集和分发状态。
可选的,所述定时器的时长大于等于3秒,并且所述定时器的时长小于等于90秒。
图5所示的第一网络设备可以执行上述实施例的方法中第一网络设备执行的相应步骤。应用在运行LACP的网络中,实现Mux机中的聚合链路的两端聚合端口状态的检测和处理,有助于减少业务流量在传输过程中产生的丢包。应当理解,所述图5中的结构同样适用于所述图1中的第二网络设备。
图6为本申请实施例的第一网络设备1100的硬件结构示意图。图6所示的第一网络设备1100可以执行上述实施例的方法中第一网络设备执行的相应步骤。
如图6所示,所述第一网络设备1100包括处理器1101、存储器1102、接口1103和总线1104。其中接口1103可以通过无线或有线的方式实现,具体来讲可以是网卡。上述处理器1101、存储器1102和接口1103通过总线1104连接。
所述接口1103具体可以包括发送器和接收器,用于第一网络设备与上述实施例中的第二网络设备之间收发信息。作为举例,所述接口1103用于支持与所述第二网络设备收发LACPDU报文。所述处理器1101用于执行上述实施例中由第一网络设备进行的处理。例如,所述处理器1101用于设置所述第一聚合端口的收集和分发状态;还用于确定所述第一聚合端口是否处于收集和分发状态;还用于启动或停止定时器;还用于确定是否接收到第二网络设备发送的LACPDU报文;还用于实现Mux机各个状态之间的切换;和/或用于本文所描述的技术的其他过程。作为举例,所述处理器1101用于支持图3中的过程S102、S104、S106和S108。存储器1102包括操作系统11021和应用程序11022,用于存储程序、代码或指令,当处理器或硬件设备执行这些程序、代码或指令时可以完成方法实施例中涉及第一网络设备的处理过程。可选的,所述存储器1102可以包括只读存储器(英文:Read-only Memory,缩写:ROM)和随机存取存储器(英文:Random Access Memory,缩写:RAM)。其中,所述ROM包括基本输入/输出系统(英文:Basic Input/Output System,缩写:BIOS)或嵌入式系统;所述RAM包括应用程序和操作系统。当需要运行第一网络设备1100时,通过固化在ROM中的BIOS或者嵌入式系统中的bootloader引导系统进行启动,引导第一网络设备1100进入正常运行状态。在第一网络设备1100进入正常运行状态后,运行在RAM中的应用程序和操作系统,从而,完成方法实施例中涉及第一网络设备的处理过程。
可以理解的是,图6仅仅示出了第一网络设备1100的简化设计。在实际应用中,第一网络设备可以包含任意数量的接口,处理器或者存储器。另外,本实施例仅以第一网络设备为例进行说明,应当理解,第二网络设备,或者更多的网络设备具有与所述第一网络设备相同的功能,此处不再一一赘述。
图7为本申请实施例的另第一网络设备1200的硬件结构示意图。图7所示的第一网络设备1200可以执行上述实施例的方法中第一网络设备执行的相应步骤。
如图7所述,第一网络设备1200包括:主控板1210、接口板1230、交换网板1220和接口板1240。主控板1210用于完成系统管理、设备维护、协议处理等功能。交换网板1220用 于完成各接口板(接口板也称为线卡或业务板)之间的数据交换。接口板1230和1240用于提供各种业务接口(例如,POS接口、GE接口、ATM接口等),并实现数据包的转发。主控板1210、接口板1230和1240,以及交换网板1220之间通过系统总线与系统背板相连实现互通。接口板1230上的中央处理器1231用于对接口板进行控制管理并与主控板上的中央处理器进行通信。
接口板1230上的物理接口卡1233接收来自所述第二网络设备的LACPDU报文,并且,经由接口板1230上的中央处理器1231向主控板1210上的中央处理器1211上送所述LACPDU报文。主控板1210上的中央处理器1211用于获取所述LACPDU报文。
中央处理器1211还用于在所述第一聚合端口的Mux机中设置PROTECT_WAITING状态,所述PROTECT_WAITING状态用于标识所述第一聚合端口未处于收集和分发状态,但向其他网络设备通告的所述第一聚合端口的状态为收集和分发状态。所述中央处理器1211还用于当所述Mux机处于所述PROTECT_WAITING状态时,确定所述第一聚合端口未处于收集和分发状态。所述中央处理器1211还用于控制所述接口板1230向所述二网络设备发送第一LACPDU报文,所述第一LACPUD报文用于通告所述第二网络设备所述第一聚合端口处于收集和分发状态,并触发所述第二网络设备将所述第二聚合端口设置为收集和分发状态。所述中央处理器1211还用于确定是否接收到来自所述第二网络设备的第二LACPDU报文,所述第二LACPDU报文用于指示所述第二聚合端口处于收集和分发状态。当所述中央处理器1211确定接收到所述第二LACPDU报文,所述中央处理器1211还用于将所述Mux机由所述PROTECT_WAITING状态切换为收集分发COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。
中央处理器1211还用于生成LACPDU报文。中央处理器1211将生成的LACPDU报文由经由接口板1230上的中央处理器1231向物理接口卡1233发送。接口板1230上的物理接口卡1233向所述第二网络设备发送所述LACPDU报文。
接口板1230上的转发表项存储器1234用于保存转发表项。接口板1230上的中央处理器1231用于控制网络存储器1232获取转发表项存储器1234中的转发表项,并且,中央处理器1231用于控制网络存储器1232经由物理接口卡1233完成流量的接收和发送。
应理解,本发明实施例中接口板1240上的操作与所述接口板1230的操作一致,为了简洁,不再赘述。应理解,本实施例的第一网络设备1200可对应于上述方法实施例所具有的功能和/或所实施的各种步骤,在此不再赘述。另外,本实施例仅以第一网络设备为例进行说明,应当理解,第二网络设备,或者更多的网络设备具有与所述第一网络设备相同的功能,此处不再一一赘述。
此外,需要说明的是,主控板可能有一块或多块,有多块的时候可以包括主用主控板和备用主控板。接口板可能有一块或多块,第一网络设备的数据处理能力越强,提供的接口板越多。接口板上的物理接口卡也可以有一块或多块。交换网板可能没有,也可能有一块或多块,有多块的时候可以共同实现负荷分担冗余备份。在集中式转发架构下,第一网络设备可以不需要交换网板,接口板承担整个系统的业务数据的处理功能。在分布式转发架构下,第一网络设备可以有至少一块交换网板,通过交换网板实现多块接口板之间的数据交换,提供大容量的数据交换和处理能力。所以,分布式架构的第一网络设备的数据接入和处理能力要大于集中式架构的设备。具体采用哪种架构,取决于具体的组网部署场景,此处不做任何限定。
图8为本申请实施例的第一网络系统1300的硬件结构示意图。图8所示的第一网络系统1300可以执行上述实施例的方法中第一网络设备执行的相应步骤。
第一网络系统1300的这种产品形态适用于基于控制与转发分离的网络架构(例如,软件定义网络(英文:Software Defined Network,缩写:SDN))。在SDN中,如图7所示的第一网络设备1200的主控板1210从设备中分离出来,形成新的独立的物理设备(即如图8所示的控制器1210A),剩下的形成另一独立的物理设备(即如图8所示的第一转发设备1200A)。控制器1210A与第一转发设备1200A通过控制通道协议实现交互。控制通道协议可以是开放流(英文:OpenFlow)协议、路径计算通信协议(英文:Path Computation Element Communication Protocol,缩写:PCEP)、BGP、路由系统接口(英文:Interface to the Routing System,缩写:I2RS)等。也就是说,与上述图7所对应的实施例相比,本实施中的第一网络系统1300包括分离出去的控制器1210A和第一转发设备1200A。
控制器1210A可以是基于通用的物理服务器实现或者是专用的硬件结构实现,在一个设计示例中,所述控制器包括接收器、处理器、发送器、RAM、ROM以及总线(图中未示出)。其中,处理器通过总线分别耦接接收器、发送器、RAM以及ROM。其中,当需要运行控制器时,通过固化在ROM中的BIOS或者嵌入式系统中的bootloader引导系统进行启动,引导控制器进入正常运行状态。在控制器进入正常运行状态后,在RAM中运行应用程序和操作系统,使得该处理器执行上述图7中主控板1210的所有功能和步骤。
第一转发设备1200A可以是基于专用的硬件结构实现,其功能和结构与上述图7中的接口板1230、接口板1240和交换网板1220的功能和结构保持一致,执行相应的功能和步骤。也可以是基于通用的物理服务器和网络功能虚拟化(英文:Netwrk Function Virtulization,缩写:NFV)技术实现的虚拟第一转发设备,所述虚拟第一转发设备为虚拟路由器。在虚拟第一转发设备的场景下,上述实体第一转发设备实施例中提到的该第一转发设备包括接口板、交换网板以及处理器在虚拟环境下可以认为是其所基于通用的物理服务器分配给该虚拟第一转发设备所使用的接口资源、网络资源以及处理资源。采用通用物理服务器实施该第一转发设备的功能或步骤,或者采用通用物理服务器并利用NFV技术实施该第一转发设备的功能或步骤具体可以参考图6的实施例。
应理解,本实施例中第一网络系统1300中的控制器1210A和该第一转发设备1200A可以实现方法实施例中的第一网络设备所实施的各种功能、步骤,为了简洁,在此不再赘述。另外,本实施例仅以第一网络设备为例进行说明,应当理解,第二网络设备,或者更多的网络设备具有与所述第一网络设备相同的功能,此处不再一一赘述。
另外,本申请实施例提供了一种计算机存储介质,用于储存为上述第一网络设备所用的计算机软件指令,其包含用于执行上述方法实施例所设计的程序。
如图1所示,本申请实施例还包括一种实现Mux机的网络系统,所述网络系统包括第一网络设备和第二网络设备,所述第一网络设备和/或第二网络设备为前述图5或图6或图7;或者所述第一网络设备和/或第二网络设备为前述图8中的第一网络系统。
结合本申请公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于RAM存储器、闪存、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入 信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于用户设备中。当然,处理器和存储介质也可以作为分立组件存在于用户设备中。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。
以上所述的具体实施方式,对本申请的目的、技术方案和有益效果进行了进一步详细说明。所应理解的是,以上所述仅为本申请的具体实施方式而已。

Claims (19)

  1. 一种实现复用Mux机的方法,其特征在于,所述方法应用于运行链路聚合控制协议LACP的网络中,所述网络包括第一网络设备和第二网络设备,所述第一网络设备的第一聚合端口经由聚合链路与所述第二网络设备的第二聚合端口连接,所述方法包括:
    所述第一网络设备在所述第一聚合端口的Mux机中设置保护等待PROTECT_WAITING状态,所述PROTECT_WAITING状态用于标识所述第一聚合端口未处于收集和分发状态,但向其他网络设备通告的所述第一聚合端口的状态为收集和分发状态;
    当所述Mux机处于所述PROTECT_WAITING状态时,所述第一网络设备确定所述第一聚合端口未处于收集和分发状态,并向所述二网络设备发送第一链路聚合控制协议数据单元LACPDU报文,所述第一LACPUD报文用于通告所述第二网络设备所述第一聚合端口处于收集和分发状态,并触发所述第二网络设备将所述第二聚合端口设置为收集和分发状态;
    所述第一网络设备确定是否接收到来自所述第二网络设备的第二LACPDU报文,所述第二LACPDU报文用于指示所述第二聚合端口处于收集和分发状态;
    当所述第一网络设备确定接收到所述第二LACPDU报文,所述第一网络设备将所述Mux机由所述PROTECT_WAITING状态切换为收集分发COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。
  2. 根据权利要求1所述的方法,其特征在于,在所述第一聚合端口的Mux机处于PROTECT_WAITING状态之前,所述Mux机处于附接ATTACHED状态,所述方法还包括:
    所述第一网络设备接收来自所述第二网络设备的第三LACPDU报文;
    当所述第一网络设备确定所述第一聚合端口处于选中状态,并且根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态,以及根据所述第三LACPDU报文确定所述第二聚合端口未处于收集和分发状态时,所述第一网络设备将所述Mux机由所述ATTACHED状态切换为所述PROTECT_WAITING状态。
  3. 根据权利要求2所述的方法,其特征在于,所述第一网络设备根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态,具体包括:
    所述第一网络设备确定所述第三LACPDU报文包括的第一信息与所述第一网络设备存储所述第一聚合端口的第二信息匹配,所述第一信息包括对端端口Partner_Port、对端端口优先级Partner_Port_Priority、对端系统Partner_System、对端系统优先级Partner_System_Priority、对端关键字Partner_Key和对端状态聚合Partner_State.Aggregation,所述第二信息包括本端端口号Actor_Port_Number、本端端口优先级Actor_Port_Priority、本端系统Actor_System、本端系统优先级Actor_System_Priority、本端操作端口关键字Actor_Oper_Port_Key和本端操作端口聚合Actor_Oper_Port_State.Aggregation;
    所述第一网络设备确定所述第三LACPDU报文包括的本端状态同步Actor_State.Synchronization处于同步状态。
  4. 根据权利要求2或3所述的方法,其特征在于,所述方法还包括:
    当所述第一网络设备根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态,并且根据所述第三LACPDU报文确定所述第二聚合端口处于收集和分发状态时,所述第一网络设备将所述Mux机由所述ATTACHED状态切换为所述COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述方法还包括:
    所述第一网络设备接收来自所述第二网络设备的第四LACPDU报文,所述第四LACPDU报文用于指示所述第二聚合端口未处于收集和分发状态;
    当所述第一网络设备根据所述第四LACPDU报文确定所述第二聚合端口未处于收集和分发状态时,将所述Mux机由所述COLLECTING_DISTRIBUTING状态切换为所述PROTECT_WAITING状态。
  6. 根据权利要求2-5中任一项所述的方法,其特征在于,所述方法还包括:
    所述第一网络设备确定以下条件中至少一个条件成立时,将所述Mux机由所述PROTECT_WAITING状态切换为所述ATTACHED状态:
    所述第一网络设备确定所述第一聚合端口处于不选中状态;
    所述第一网络设备确定所述第一聚合端口处于备用状态;和,
    所述第一网络设备接收来自所述第二网络设备的第五LACPDU报文,并根据所述第五LACPDU报文确定所述第二聚合端口未处于同步状态。
  7. 根据权利要求1所述的方法,其特征在于,所述第一网络设备包括定时器,在所述第一聚合端口的Mux机处于PROTECT_WAITING状态中,所述方法还包括:
    所述第一网络设备启动所述定时器;
    直到所述定时器超时,所述第一网络设备确定未接收到来自所述第二网络设备的所述第二LACPDU报文,所述第一网络设备将所述Mux机由所述PROTECT_WAITING状态切换为ATTACHED状态。
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:
    当所述Mux机处于PROTECT_WAITING状态,并且所述定时器超时时,所述第一网络设备将所述聚合链路设置为单端口UP,所述单端口UP用于指示所述聚合链路的一端聚合端口处于收集和分发状态,另一端聚合端口未处于收集和分发状态。
  9. 根据权利要求7或8所述的方法,其特征在于,所述定时器的时长大于等于3秒,并且所述定时器的时长小于等于90秒。
  10. 一种第一网络设备,其特征在于,所述第一网络设备运行有链路聚合控制协议LACP,所述第一网络设备的第一聚合端口经由聚合链路与所述第二网络设备的第二聚合端口连接,所述第一网络设备包括处理单元和发送单元,
    所述处理单元,用于在所述第一聚合端口的Mux机中设置保护等待 PROTECT_WAITING状态,所述PROTECT_WAITING状态用于标识所述第一聚合端口未处于收集和分发状态,但向其他网络设备通告的所述第一聚合端口的状态为收集和分发状态;
    所述处理单元还用于当所述Mux机处于所述PROTECT_WAITING状态时,确定所述第一聚合端口未处于收集和分发状态;
    所述发送单元,用于向所述二网络设备发送第一链路聚合控制协议数据单元LACPDU报文,所述第一LACPUD报文用于通告所述第二网络设备所述第一聚合端口处于收集和分发状态,并触发所述第二网络设备将所述第二聚合端口设置为收集和分发状态;
    所述处理单元还用于确定是否接收到来自所述第二网络设备的第二LACPDU报文,所述第二LACPDU报文用于指示所述第二聚合端口处于收集和分发状态;
    当所述处理单元确定接收到所述第二LACPDU报文,所述处理单元还用于将所述Mux机由所述PROTECT_WAITING状态切换为收集分发COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。
  11. 根据权利要求10所述的第一网络设备,其特征在于,在所述第一聚合端口的Mux机处于PROTECT_WAITING状态之前,所述Mux机处于附接ATTACHED状态,所述第一网络设备还包括接收单元,
    所述接收单元用于接收来自所述第二网络设备的第三LACPDU报文;
    当所述处理单元确定所述第一聚合端口处于选中状态,并且根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态,以及根据所述第三LACPDU报文确定所述第二聚合端口未处于收集和分发状态时,所述处理单元还用于将所述Mux机由所述ATTACHED状态切换为所述PROTECT_WAITING状态。
  12. 根据权利要求11所述的第一网络设备,其特征在于,所述处理单元根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态,具体包括:
    所述处理单元还用于确定所述第三LACPDU报文包括的第一信息与所述第一网络设备存储所述第一聚合端口的第二信息匹配,所述第一信息包括对端端口Partner_Port、对端端口优先级Partner_Port_Priority、对端系统Partner_System、对端系统优先级Partner_System_Priority、对端关键字Partner_Key和对端状态聚合Partner_State.Aggregation,所述第二信息包括本端端口号Actor_Port_Number、本端端口优先级Actor_Port_Priority、本端系统Actor_System、本端系统优先级Actor_System_Priority、本端操作端口关键字Actor_Oper_Port_Key和本端操作端口聚合Actor_Oper_Port_State.Aggregation;
    所述处理单元还用于确定所述第三LACPDU报文包括的本端状态同步Actor_State.Synchronization处于同步状态。
  13. 根据权利要求11或12所述的第一网络设备,其特征在于,
    当所述处理单元根据所述第三LACPDU报文确定所述第二聚合端口处于同步状态,并且根据所述第三LACPDU报文确定所述第二聚合端口处于收集和分发状态时,所述处理单元还用于将所述Mux机由所述ATTACHED状态切换为所述COLLECTING_DISTRIBUTING状态,并将所述第一聚合端口设置为收集和分发状态。
  14. 根据权利要求10-13中任一项所述的第一网络设备,其特征在于,
    所述接收单元还用于接收来自所述第二网络设备的第四LACPDU报文,所述第四LACPDU报文用于指示所述第二聚合端口未处于收集和分发状态;
    当所述处理单元根据所述第四LACPDU报文确定所述第二聚合端口未处于收集和分发状态时,所述处理单元还用于将所述Mux机由所述COLLECTING_DISTRIBUTING状态切换为所述PROTECT_WAITING状态。
  15. 根据权利要求11-14中任一项所述的第一网络设备,其特征在于,
    所述处理单元确定以下条件中至少一个条件成立时,所述处理单元还用于将所述Mux机由所述PROTECT_WAITING状态切换为所述ATTACHED状态:
    所述处理单元还用于确定所述第一聚合端口处于不选中状态;
    所述处理单元还用于确定所述第一聚合端口处于备用状态;和,
    所述处理单元还用于根据接收到的来自所述第二网络设备的第五LACPDU报文确定所述第二聚合端口未处于同步状态。
  16. 根据权利要求10所述的第一网络设备,其特征在于,在所述第一聚合端口的Mux机处于PROTECT_WAITING状态中,
    所述处理单元还用于启动定时器;
    直到所述定时器超时,所述处理单元确定未接收到来自所述第二网络设备的所述第二LACPDU报文,所述处理单元还用于将所述Mux机由所述PROTECT_WAITING状态切换为ATTACHED状态。
  17. 根据权利要求16所述的第一网络设备,其特征在于,
    当所述Mux机处于PROTECT_WAITING状态,并且所述定时器超时时,所述处理单元还用于将所述聚合链路设置为单端口UP,所述单端口UP用于指示所述聚合链路的一端聚合端口处于收集和分发状态,另一端聚合端口未处于收集和分发状态。
  18. 根据权利要求16或17所述的第一网络设备,其特征在于,所述定时器的时长大于等于3秒,并且所述定时器的时长小于等于90秒。
  19. 一种实现复用Mux机的网络系统,所述网络系统包括第一网络设备和第二网络设备,所述第一网络设备和/或所述第二网络设备为权利要求10至18中任一所述的第一网络设备。
PCT/CN2018/075609 2017-06-28 2018-02-07 一种实现Mux机的方法、设备及系统 WO2019000952A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP18824623.5A EP3633931B1 (en) 2017-06-28 2018-02-07 Method and system for implementing mux machine
US16/727,596 US11258666B2 (en) 2017-06-28 2019-12-26 Method, device, and system for implementing MUX machine

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710508989.0A CN109150709B (zh) 2017-06-28 2017-06-28 一种实现Mux机的方法、设备及系统
CN201710508989.0 2017-06-28

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/727,596 Continuation US11258666B2 (en) 2017-06-28 2019-12-26 Method, device, and system for implementing MUX machine

Publications (1)

Publication Number Publication Date
WO2019000952A1 true WO2019000952A1 (zh) 2019-01-03

Family

ID=64741005

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/075609 WO2019000952A1 (zh) 2017-06-28 2018-02-07 一种实现Mux机的方法、设备及系统

Country Status (4)

Country Link
US (1) US11258666B2 (zh)
EP (1) EP3633931B1 (zh)
CN (1) CN109150709B (zh)
WO (1) WO2019000952A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4044524A4 (en) * 2019-10-29 2022-11-16 Huawei Technologies Co., Ltd. METHOD AND DEVICE FOR SELECTING PORT SWITCHING UNDER WORKING STATE DURING DUAL HOMING ACCESS

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112511326B (zh) * 2020-03-16 2024-02-02 中兴通讯股份有限公司 一种切换方法、装置、设备和存储介质
CN114024897B (zh) * 2021-09-18 2023-06-27 新华三信息安全技术有限公司 端口切换方法及系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101945042A (zh) * 2010-09-03 2011-01-12 中兴通讯股份有限公司 一种链路聚合的方法及设备
US20110038267A1 (en) * 2009-08-12 2011-02-17 Fujitsu Network Communications, Inc. System and Method for Monitoring the Connectivity of a Path Between Nodes in a Network
US20170063672A1 (en) * 2015-08-28 2017-03-02 Ciena Corporation Methods and systems to select active and standby ports in link aggregation groups

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101984573B (zh) * 2010-11-15 2015-07-22 中兴通讯股份有限公司 分布式实现lacp标准状态机的方法及系统
US9654418B2 (en) * 2013-11-05 2017-05-16 Telefonaktiebolaget L M Ericsson (Publ) Method and system of supporting operator commands in link aggregation group
CN105122737A (zh) * 2013-11-12 2015-12-02 华为技术有限公司 一种链路聚合的方法、装置和系统
WO2017158401A1 (en) * 2016-03-15 2017-09-21 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for supporting bidirectional forwarding (bfd) over multi-chassis link aggregation group (mc-lag) in internet protocol (ip) multiprotocol label switching (mpls) networks
US10972380B2 (en) * 2016-04-05 2021-04-06 Versa Networks, Inc. Method for configuring a connection using redundant service nodes

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110038267A1 (en) * 2009-08-12 2011-02-17 Fujitsu Network Communications, Inc. System and Method for Monitoring the Connectivity of a Path Between Nodes in a Network
CN101945042A (zh) * 2010-09-03 2011-01-12 中兴通讯股份有限公司 一种链路聚合的方法及设备
US20170063672A1 (en) * 2015-08-28 2017-03-02 Ciena Corporation Methods and systems to select active and standby ports in link aggregation groups

Non-Patent Citations (1)

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

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4044524A4 (en) * 2019-10-29 2022-11-16 Huawei Technologies Co., Ltd. METHOD AND DEVICE FOR SELECTING PORT SWITCHING UNDER WORKING STATE DURING DUAL HOMING ACCESS
US11882059B2 (en) 2019-10-29 2024-01-23 Huawei Technologies Co., Ltd. Method for selecting port to be switched to operating state in dual-homing access and device

Also Published As

Publication number Publication date
US11258666B2 (en) 2022-02-22
CN109150709A (zh) 2019-01-04
EP3633931A4 (en) 2020-07-01
EP3633931A1 (en) 2020-04-08
CN109150709B (zh) 2020-02-14
US20200136912A1 (en) 2020-04-30
EP3633931B1 (en) 2023-08-02

Similar Documents

Publication Publication Date Title
EP1982447B1 (en) System and method for detecting and recovering from virtual switch link failures
WO2019000953A1 (zh) 一种实现Mux机的方法、设备及系统
US11349687B2 (en) Packet processing method, device, and system
WO2018188569A1 (zh) 一种转发数据报文的方法、设备和系统
WO2019233179A1 (zh) 一种数据报文的检测方法、设备及系统
US8839023B2 (en) Transmitting network information using link or port aggregation protocols
WO2021043086A1 (zh) 一种sbfd会话的建立方法、设备及系统
US9246793B2 (en) Network, network fault recovery method, and node device
CN102195865A (zh) 多宿网络中的通信网络路径和状态信息
US11258666B2 (en) Method, device, and system for implementing MUX machine
US20190007302A1 (en) Mechanism for Dual Active Detection Link Monitoring in Virtual Switching System with Hardware Accelerated Fast Hello
US11356372B2 (en) Data traffic processing method, device, and system
WO2018161794A1 (zh) 一种设备升级方法及接入设备
CN109691031B (zh) 业务报文传输方法及节点设备
EP3038296A1 (en) Pool element status information synchronization method, pool register and pool element
WO2011113395A2 (zh) 一种负载分担方法和装置
US20110320633A1 (en) System and methods for a managed application server restart
JP5518771B2 (ja) 冗長ネットワークシステム、終端装置及び中継点隣接装置
WO2021073367A1 (zh) 一种数据处理方法、设备及系统
CN113132220B (zh) 一种路由信息的处理方法及装置
CN113965613A (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: 18824623

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

Country of ref document: EP

Effective date: 20200102