Message forwarding method and device based on aggregation port, switching device and medium

By using a fixed-configuration inbound traffic aggregation port list in the switching device, the broadcast storm and data packet loss problems caused by state changes of the aggregation port member ports are solved, and software operation is simplified and stable message forwarding is achieved.

CN116016390BActive Publication Date: 2025-10-10北京东土军悦科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211624231.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-16
Publication Date
2025-10-10
Estimated Expiration
2042-12-16

AI Technical Summary

Technical Problem

In the prior art, when the state of a member port of an aggregation port changes, complex software operations are required to update the STP state, resulting in data packet loss and broadcast storms.

Method used

A fixed inbound traffic aggregation port list is used to record the pre-configured aggregation ports and their member ports on the switching device. This list does not change with the member port status. The message forwarding port is determined by querying the list.

Benefits of technology

It effectively avoids broadcast storms and data packet losses caused by member port status changes and simplifies software operation complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016390B_ABST
    Figure CN116016390B_ABST
Patent Text Reader

Abstract

The application discloses a message forwarding method and device based on an aggregation port, a switching device and a medium. The method comprises the following steps: when a target message is received through a first aggregation port, each first member port included in the first aggregation port is obtained in an incoming traffic aggregation port list. In the incoming traffic aggregation port list, at least one aggregation port preconfigured by the switching device is fixedly written, and each member port included in each aggregation port is not changed along with the change of the member port state. At least one target forwarding port is determined in all switching ports according to each first member port, and the target message is forwarded through the at least one target forwarding port. The technical scheme of the embodiment of the application provides a new form of message forwarding method based on an aggregation port, and can effectively reduce the software operation complexity and avoid the packet loss phenomenon when the member port in the aggregation port fails or recovers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Ethernet communications, and in particular to a message forwarding method, device, switching equipment and medium based on aggregated ports. Background Art

[0002] Port aggregation technology provides port bundling for switching devices, virtualizing multiple physical ports (also called switch ports or ports) into a single aggregated port. Aggregated ports can increase bandwidth, share loads, and add redundant links.

[0003] When implementing port aggregation in the existing technology, it is necessary to set Figure 1a The aggregation port list shown in FIG. 1 records the member ports contained in each aggregation port in the switching device and the total number of member ports of each aggregation port. Figure 1a As shown, Aggregate Port 1 includes three member ports: Switch Port 1, Switch Port 2, and Switch Port 3. When packet forwarding is required for an Aggregate Port, a member port is selected from all the member ports of the Aggregate Port based on the configured load balancing algorithm for packet forwarding. When the port status of a member port in an Aggregate Port changes, the member ports and the total number of member ports in the Aggregate Port List are dynamically updated.

[0004] In the process of implementing the present invention, the inventors found that the existing technology has the following defects: when the port state of the member port of the aggregation port changes, in order to avoid a broadcast storm, it is necessary to update the Spanning Tree Protocol (STP) state of the member port through complex software operations. In addition, in the process of updating the STP state of the member port, data packets may be lost. Summary of the Invention

[0005] The embodiments of the present invention provide a method, apparatus, switching device and medium for forwarding packets based on an aggregation port, so as to effectively reduce the complexity of software operation and avoid packet loss when a member port in the aggregation port fails or recovers from a failure.

[0006] In a first aspect, an embodiment of the present invention provides a method for forwarding packets based on an aggregate port, the method comprising:

[0007] When receiving the target message through the first aggregation port, obtaining each first member port included in the first aggregation port in the inbound traffic aggregation port list;

[0008] The at least one aggregation port in the ingress traffic aggregation port list is fixedly written in the switch device, and each member port included in each aggregation port is not changed following a change in a state of the member port.

[0009] The target forwarding port determination module is configured to determine at least one target forwarding port in all switch ports according to each first member port, and forward the target message through the at least one target forwarding port.

[0010] In a second aspect, an embodiment of the present application provides a message forwarding device based on an aggregation port, which comprises:

[0011] The first member port determination module is configured to, when a target message is received through a first aggregation port, acquire each first member port included in the first aggregation port in an ingress traffic aggregation port list.

[0012] The at least one aggregation port in the ingress traffic aggregation port list is fixedly written in the switch device, and each member port included in each aggregation port is not changed following a change in a state of the member port.

[0013] The target forwarding port determination module is configured to determine at least one target forwarding port in all switch ports according to each first member port, and forward the target message through the at least one target forwarding port.

[0014] In a third aspect, an embodiment of the present application further provides a switch device, which comprises:

[0015] at least one processor; and

[0016] a memory connected with the at least one processor in communication; wherein

[0017] The memory stores a computer program which can be executed by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the message forwarding method based on an aggregation port according to any one of the embodiments of the present application.

[0018] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, which stores a computer instruction, and the computer instruction is used to enable a processor to execute the message forwarding method based on an aggregation port according to any one of the embodiments of the present application.

[0019] The technical solution of the embodiment of the present invention is to obtain the first member port in the inbound traffic aggregation port list when the first aggregation port receives the message; determine at least one target forwarding port in all switching ports based on the obtained first member port, and forward the target message through the at least one target forwarding port. The forwarding port is determined by querying the inbound traffic aggregation port list that does not change with the change of the member port status. This can effectively avoid broadcast storms when the member ports of the aggregation port have port status without updating the STP status of the member port, and further, can completely avoid the complex software operations and packet loss introduced when updating the STP status of the member port.

[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1a This is a schematic diagram of the structure of an aggregated port list in the prior art;

[0023] Figure 1b This is a flow chart of a method for forwarding packets based on aggregated ports according to a first embodiment of the present invention;

[0024] Figure 1c 1 is a schematic diagram of the structure of an inbound traffic aggregation port list applicable to the method of embodiment 1 of the present invention;

[0025] Figure 2a This is a flow chart of a method for forwarding packets based on aggregated ports according to a second embodiment of the present invention;

[0026] Figure 2b 1 is a schematic diagram of the structure of an outbound traffic aggregation port list applicable to the method of embodiment 2 of the present invention;

[0027] Figure 2c This is a structural diagram of message forwarding implementation between multiple switching devices to which the method according to an embodiment of the present invention is applicable;

[0028] Figure 3 1 is a schematic structural diagram of a packet forwarding device based on aggregated ports according to a third embodiment of the present invention;

[0029] Figure 4 1 is a schematic structural diagram of an electronic device that can be used to implement an embodiment of the present invention according to a fourth embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] First, to facilitate understanding, the defects of the prior art and the main implementation principles of the embodiments of the present invention are briefly described.

[0033] In the prior art, if switch port 1, switch port 2, and switch port 3 of switch device A are configured as aggregate port 1, then switch port 1, switch port 2, and switch port 3 of switch device A need to be connected to switch port 1', switch port 2', and switch port 3' of switch device B, respectively, and switch port 1', switch port 2', and switch port 3' of switch device B need to be simultaneously configured as aggregate port 1'. In this case, switch port 1, switch port 2, and switch port 3 are member ports of aggregate port 1, and switch port 1', switch port 2', and switch port 3' are member ports of aggregate port 1'.

[0034] When switch B sends a broadcast message X to the aggregation port 1 of switch A through the aggregation port 1', one of the switch ports 1, 2 and 3 of switch A will receive the broadcast message X and mark the message as a message received by the aggregation port 1. Figure 1aThe aggregated port list shown can determine that the broadcast message X does not need to be broadcast to any switch port among switch port 1, switch port 2 and switch port 3. The broadcast message X only needs to be forwarded through the ordinary ports or aggregated ports of the switching device 1 except switch port 1, switch port 2 and switch port 3.

[0035] When a member port in Aggregation Port 1, for example, switch port 2, experiences a port failure, it is necessary to control the removal of switch port 2 from Aggregation Port 1 in the Aggregation Port List on switching device 1. The failover time depends on the time when the software detects the failure of switch port 2 and the time when the Aggregation Port List updates the member ports and the total number of member ports included in Aggregation Port 1. When the failure of switch port 2 is recovered, it is necessary to control the re-addition of switch port 2 to the Aggregation Port List. Correspondingly, when switching device B detects a port failure (typically, a port DOWN event) on switch port 2 in Switch Port A, it will also remove switch port 2' connected to switch port 2 from Aggregation Port 1'.

[0036] When the fault of switch port 2 in switch port A is resolved (typically, an UP event occurs on the port), the time when switch device A and switch device B detect that the fault of switch port 2 is resolved may be inconsistent. At this time, switch device A and switch device B cannot configure their respective aggregate ports (aggregate port 1 and aggregate port 1') at the same time, resulting in switch port 2 in switch device A being in an aggregated state, while switch port 2' in switch device B is in a non-aggregated state.

[0037] At this time, if switching device A sends a new broadcast message Y to switching device B through aggregation port 1, since switching port 2' is in a non-aggregation state in switching device B, switching device B will broadcast broadcast message Y through switching port 2'. This is equivalent to switching device B returning the message sent by switching device A to switching device A, which also generates a broadcast storm.

[0038] In the prior art, in order to avoid broadcast storms, it is necessary to set the STP state of the faulty port (the port that generates the DOWN event) in the aggregation port to the BLOCK state. After the fault of the faulty port is rectified and it rejoins the aggregation port, the STP state of the port is changed to the FORWARD state to complete the fault recovery. Such an operation is not only complex in software operation, but also may cause packet loss during the fault recovery.

[0039] In order to completely solve the problems of the prior art, a new inbound traffic aggregation port list is creatively used in this application. In this inbound traffic aggregation port list, at least one aggregation port pre-configured by the switching device is fixedly written. The member ports included in each aggregation port do not change with the change of the member port status (failure or fault recovery). The switching device determines the forwarding port of the message by querying the inbound traffic aggregation port list. Even if the STP status of the port is not adaptively adjusted, the generation of broadcast storms can be completely avoided. The specific process of the inbound traffic aggregation port list is detailed in the following specific embodiment section.

[0040] Example 1

[0041] Figure 1b This is a flow chart of a method for forwarding packets based on aggregated ports provided in the first embodiment of the present invention. This embodiment is applicable to the case where aggregated ports are used for packet reception and packet forwarding. The method can be executed by a packet forwarding device based on aggregated ports. The packet forwarding device based on aggregated ports can be implemented in the form of hardware and / or software and can generally be integrated into a switching device. Figure 1b As shown, the method includes:

[0042] S110 : When a target message is received through the first aggregation port, obtain each first member port included in the first aggregation port from the inbound traffic aggregation port list.

[0043] The inbound traffic aggregation port list is fixed with at least one aggregation port pre-configured by the switching device, and the member ports included in each aggregation port do not change with changes in the member port status.

[0044] In this embodiment, the inbound traffic aggregation port list also stores one or more aggregation ports, each of which includes multiple member ports. However, after the configuration of the aggregation ports of the switching device is completed, the values ​​in the inbound traffic aggregation port list will not change.

[0045] For example, in Figure 1c A schematic diagram of the structure of an inbound traffic aggregation port list is shown in FIG. Figure 1c As shown, after initial configuration, the local switching device virtualizes two aggregate ports: Aggregation Port 1 and Aggregation Port 2. Aggregation Port 1 includes three member ports: Switch Port 1, Switch Port 2, and Switch Port 3. Aggregation Port 2 includes three member ports: Switch Port 4, Switch Port 5, and Switch Port 6. As an example, Aggregation Port 1 and Aggregation Port 2 have the same number of member ports. In practice, different aggregate ports can have the same or different number of member ports.

[0046] It should be understood that once configured, the inbound traffic aggregation port list does not dynamically change with changes in the status of the member ports. That is, as long as the hardware configuration of the aggregation ports on the local switching device remains unchanged, the inbound traffic aggregation port list remains fixed. This list remains unchanged even if a member port is de-aggregated due to a failure or re-aggregated due to recovery.

[0047] In this embodiment, the first aggregation port can be understood as the aggregation port in the local switching device that currently receives the message (ie, the target message).

[0048] When other switching devices connected to the local switching device send a target message to the local switching device through the aggregation ports connected to the first aggregation port in a one-to-one correspondence, the first aggregation port will receive the target message. Specifically, one member port in the first aggregation port receives the target message.

[0049] After receiving the target message, the first member ports included in the first aggregation port can be obtained by querying the inbound traffic aggregation port list. The first member ports mentioned above can be understood as all the member ports included in the first aggregation port during initial configuration.

[0050] By querying the inbound traffic aggregation port list, it can be ensured that when a switch port pre-configured in the first aggregation port is temporarily not added to the first aggregation port due to a fault, the local switching device can also know the switch port, thereby avoiding sending the target message obtained from the first aggregation port to the switch port again to avoid causing a broadcast storm.

[0051] S120 : Determine at least one target forwarding port among all switch ports according to each first member port, and forward the target message through the at least one target forwarding port.

[0052] The target forwarding port can be understood as the egress port of the target message. It is understood that the main function of a switch is to store and forward messages, that is, to forward messages received from one switch port through one or more other switch ports.

[0053] It is understood that, since the first member ports collectively constitute the first aggregate port during initial configuration, each of the first member ports of the local switching device is connected to multiple switch ports of the same adjacent switching device (e.g., switching device X). When the local switching device receives a target message via the first aggregate port, it indicates that the target message was sent by switching device X to the local switching device. Furthermore, the target forwarding port determined by the local switching device must not include the first member ports.

[0054] Accordingly, in an optional implementation of this embodiment, determining at least one target forwarding port from all switch ports according to each first member port may include:

[0055] Determine at least one candidate forwarding port from all switch ports according to the message description information of the target message;

[0056] In at least one candidate forwarding port, each first member port is filtered out to obtain at least one target forwarding port.

[0057] The message description information of the target message may include the forwarding type of the target message, such as broadcast, multicast, or unicast, and may also include the destination IP (Internet Protocol) address of the target message, etc. By combining the above message description information, one or more candidate forwarding ports may be determined.

[0058] Among them, the alternative forwarding port can be understood as all the switch ports that can be selected for forwarding the target message according to the message description information. In a specific example, if the target message is defined as a broadcast message in the message description information, all the switch ports in the local switching device can be determined as the alternative forwarding ports; if the target message is defined as a multicast message in the message description information, all the switch ports set in the multicast table can be determined as the alternative forwarding ports; if the target message is defined as a unicast message in the message description information, the message forwarding table can be queried based on the destination IP address of the target message, and the switch port set for the destination IP address in the message forwarding table can be determined as the alternative forwarding port.

[0059] In an optional implementation of this embodiment, based on the above embodiments, determining at least one candidate forwarding port from all switch ports according to the message description information of the target message may specifically include:

[0060] If the target message is determined to be a broadcast message according to the message description information of the target message, all switch ports are determined as candidate forwarding ports.

[0061] Furthermore, after determining one or more candidate forwarding ports, in order to avoid broadcast storms, the first member ports may be filtered out from the one or more candidate forwarding ports to obtain one or more target forwarding ports.

[0062] The target forwarding port can be understood as the port of the local switching device that forwards the target message. By sending the target message to the above one or more target forwarding ports, the target message can be sent to other switching devices connected to each target forwarding port.

[0063] With the above settings, even if switch port 2 in switch device A is in an aggregated state and switch port 2' in switch device B is in a non-aggregated state as in the above example, if switch device A sends a new broadcast message Y to switch device B through aggregate port 1, even if switch port 2' is initially determined as a candidate forwarding port in switch device B, since switch port 1', switch port 2', and switch port 3' are pre-configured in aggregate port 1' in the inbound traffic aggregate port list, switch port 2' will be filtered out from the candidate forwarding ports when the target forwarding port is finally determined.

[0064] The technical solution of the embodiment of the present invention is to add a new inbound traffic aggregation port list to the switching device, and at the same time set the member ports included in the aggregation port of the inbound traffic aggregation port list not to change following the change of the member port status. Accordingly, when the target message is received through the first aggregation port, the first member ports included in the first aggregation port can be obtained in the inbound traffic aggregation port list, and then at least one target forwarding port can be determined among all the switching ports based on the first member ports, and the target message is forwarded through the at least one target forwarding port. The technical solution provides a new form of message forwarding method based on aggregation ports, which can avoid synchronous modification of the STP status of the member ports in the aggregation port when a fault occurs or the fault is recovered, thereby effectively reducing the complexity of software operation while avoiding packet loss.

[0065] Example 2

[0066] Figure 2aA flowchart of a message forwarding method based on an aggregation port is provided for the second embodiment of the present invention. This embodiment is a refinement of the above embodiment. Specifically, according to each first member port, at least one target forwarding port is determined in all switching ports, and the operation of forwarding the target message through at least one target forwarding port is concretized as follows: if it is determined that the target forwarding port includes a second aggregation port, the outbound traffic aggregation port list is queried to obtain all second member ports included in the second aggregation port; wherein, the member ports included in each aggregation port in the outbound traffic aggregation port list change with the change of the member port status; the target second member port is determined among all second member ports, and the target message is forwarded through the target second member port.

[0067] Correspondingly, such as Figure 2a As shown, the method includes:

[0068] S210 : When a target message is received through the first aggregation port, obtain each first member port included in the first aggregation port from the inbound traffic aggregation port list.

[0069] The inbound traffic aggregation port list is fixed with at least one aggregation port pre-configured by the switching device, and the member ports included in each aggregation port do not change with changes in the member port status.

[0070] S220: Determine at least one target forwarding port among all switch ports according to each first member port.

[0071] S230: If it is determined that the target forwarding port includes the second aggregation port, query the traffic aggregation port list to obtain all second member ports included in the second aggregation port.

[0072] The second aggregation port may be an aggregation port included in the target forwarding port, and the number of the second aggregation port may be one or more, which is not limited in this embodiment.

[0073] In this embodiment, the target forwarding ports determined by the local switching device may include aggregation ports or common switching ports that have not been aggregated.

[0074] If all target forwarding ports are common switch ports, the target message can be directly sent to each target forwarding port. If the target forwarding ports include one or more second aggregation ports, a member port needs to be selected from each second aggregation port, and the target message is forwarded through the selected member port.

[0075] Furthermore, it is necessary to first query and obtain all second member ports included in the second aggregation port in the outbound traffic aggregation port list. The member ports included in each aggregation port in the outbound traffic aggregation port list change as the member port status changes.

[0076] That is, the outbound traffic aggregation port list also includes each aggregation port, but the member ports included in each aggregation port will change as the member port status changes.

[0077] In a specific example, if Aggregation Port 1 is pre-configured for the local switching device, and Switch Port 1, Switch Port 2, and Switch Port 3 are pre-virtualized and bound in Aggregation Port 1, if at time point t1, the three switch ports are all in the open state (i.e., the UP state), then when querying the outbound traffic aggregation port list at this time, the three member ports, Switch Port 1, Switch Port 2, and Switch Port 3, can be found for Aggregation Port 1; if at time point t2, Switch Port 1 and Switch Port 3 are in the open state, and Switch Port 2 is in the closed state (i.e., the DOWN state), then when querying the outbound traffic aggregation port list at this time, the two member ports, Switch Port 1 and Switch Port 3, can be found for Aggregation Port 1.

[0078] The open state can be understood as a state where packets can be forwarded normally, and the closed state can be understood as a state where packets cannot be forwarded normally due to a port failure.

[0079] It should be noted that if every member port in each aggregator in the inbound aggregation port list is in the enabled state, the contents of the inbound aggregation port list and the outbound aggregation port list should be completely identical. If one or more member ports in one or more aggregators in the inbound aggregation port list are disabled, the contents of the inbound aggregation port list and the outbound aggregation port list will differ. In other words, the inbound aggregation port list stores the ideal member ports for each aggregator, while the outbound aggregation port list stores the actual available member ports for each aggregator.

[0080] In this embodiment, by querying the traffic aggregation port list, all second member ports in the second aggregation port that are currently in the processing-enabled state can be obtained.

[0081] S240: Determine a target second member port among all second member ports, and forward the target message through the target second member port.

[0082] The method for determining the target second member port from all the second member ports may be random selection or selection according to a preset load balancing algorithm, and this embodiment does not limit this.

[0083] Optionally, determining the target second member port from all the second member ports can comprise:

[0084] performing hash operation on at least one message description item in the message description information of the target message to obtain a message hash value matched with the target message; querying out the egress traffic aggregation port list to obtain a total number of member ports included in the second aggregation port; performing modulo operation on the total number of member ports included in the second aggregation port using the message hash value, and determining the target second member port from all the second member ports according to the result of the modulo operation.

[0085] In the message description item, at least one of the source Internet protocol address, the destination Internet protocol address, the Ethernet protocol and the media access control layer of the target message can be included. Meanwhile, the hash operation can be understood as: transforming an input of arbitrary length into an output of fixed length through a hash algorithm, and outputting the output of fixed length as a hash value.

[0086] In the embodiment, an implementation manner of implementing aggregation port load balancing by performing hash operation is provided. First, the hash value of the target message can be calculated according to one or more message description items in the target message. By performing modulo operation on the total number N of member ports included in the second aggregation port using the hash value, an integer X in [0, N-1] can be obtained. Then, according to the arrangement order of the member ports in the egress traffic aggregation port list, the X+1th member port can be obtained as the target second member port. The target second member port can be understood as the member port selected from the second aggregation port for forwarding the target message.

[0087] A structure diagram of an egress traffic aggregation port list is shown in Figure 2b As shown in Figure 2b , the aggregation port 1 and the aggregation port 2 are included in the egress traffic aggregation port list. For the aggregation port 1, the total number of member ports currently included in the aggregation port 1 is 2, and the member ports are respectively the switch port 1 and the switch port 3.

[0088] In a specific example, if the decimal representation of the message hash value matched with the target message is 140, the second aggregation port is the aggregation port 1, and the total number of member ports included in the aggregation port 1 is 2, then the result of the modulo operation is 0, and the target second member port can be the first member port in the member ports of the aggregation port 1, i.e., the switch port 1.

[0089] The technical solution of the embodiment of the present invention is to obtain the first member port from the inbound traffic aggregation port list when receiving a message at the first aggregation port, and finally determine at least one target forwarding port among all the switch ports based on the obtained first member port, and when determining that the target forwarding port includes the second aggregation port, determine the target second member port among all the second member ports included in the second aggregation port by querying the outbound traffic aggregation port list, and forward the target message through the target member port in the second aggregation port. The technical solution of the embodiment of the present invention realizes the effective reception and forwarding of the target message in each aggregation port of the same switching device by comprehensively using the inbound traffic aggregation port list and the outbound traffic aggregation port list, and provides a new form of message forwarding method based on aggregation ports, which can avoid the need to synchronously modify the STP status of the member ports in the aggregation port when a member port in the aggregation port fails or recovers from a failure, thereby effectively reducing the complexity of software operations while avoiding packet loss.

[0090] Based on the above embodiments, the method may further include:

[0091] The port status of each member port included in each aggregation port in the inbound traffic aggregation port list is detected in real time; and the member ports included in each aggregation port in the outbound traffic aggregation port list are updated according to the port status detection result.

[0092] Specifically, updating the member ports included in each aggregation port in the traffic aggregation port list according to the port status detection result may include:

[0093] If, according to the port state detection result, it is determined that the first target member port included in the first target aggregation port in the outbound traffic aggregation port list is switched from the open state to the closed state, then the first target member port is removed from the first target aggregation port in the outbound traffic aggregation port list, and the total number of member ports included in the first target aggregation port is updated;

[0094] If, according to the port status detection result, it is determined that the second target member port that has been historically removed from the second target aggregation port in the outgoing traffic aggregation port list is switched from a closed state to an open state, the second target member port is re-added to the second target aggregation port in the outgoing traffic aggregation port list, and the total number of member ports included in the second target aggregation port is updated.

[0095] In this optional implementation, a port in the open state can be understood as: the port has the function of receiving and sending messages, and can normally complete the forwarding of target messages; a port in the closed state can be understood as: the port cannot normally complete the forwarding of target messages due to reasons such as disconnection or failure.

[0096] Among them, in order to ensure that each aggregation port in the local switching device uses the switching interface that is currently in the open state when forwarding the target message, it is necessary to detect the port status of each member port included in each aggregation port in the inbound traffic aggregation port list in real time, and update the member ports included in each aggregation port in the outbound traffic aggregation port list based on the port status of the above-mentioned member ports.

[0097] Specific application scenarios

[0098] In order to more clearly describe the technical solution provided by the embodiment of the present invention, this embodiment provides a specific application scenario. Figure 2c 2 shows a structural diagram of message forwarding implementation between multiple switching devices to which the method according to an embodiment of the present invention is applicable.

[0099] like Figure 2c As shown, switch port 1, switch port 2, and switch port 3 of switch device 1 are configured as aggregate port 1. At the same time, switch port 1, switch port 2, and switch port 3 of switch device 1 are respectively connected to switch port 1', switch port 2', and switch port 3' of switch device 2. At the same time, switch port 1', switch port 2', and switch port 3' of switch device 2 are synchronously configured as aggregate port 1'. At this point, switch port 1, switch port 2, and switch port 3 are member ports of aggregate port 1, and switch port 1', switch port 2', and switch port 3' are member ports of aggregate port 1'.

[0100] Correspondingly, the switching device 1 includes an inbound traffic aggregation member list and an outbound traffic aggregation member list adapted to the aggregation port 1 .

[0101] Similarly, the switch port 4', switch port 5' and switch port 6' of the switching device 2 are configured as the aggregate port 2'. At the same time, the switch port 4', switch port 5' and switch port 6' of the switching device 2 are respectively connected to the switch port 4", switch port 5", and switch port 6" of the switching device 3. At the same time, the switch port 4", switch port 5", and switch port 6" of the switching device 3 are synchronously configured as the aggregate port 2" (not shown in the figure). At this time, the switch port 4', switch port 5' and switch port 6' are member ports of the aggregate port 2', and the switch port 4", switch port 5", and switch port 6" are member ports of the aggregate port 2".

[0102] Correspondingly, the switching device 2 includes an inbound traffic aggregation member list and an outbound traffic aggregation member list adapted to the aggregation port 1 ′ and the aggregation port 2 ′.

[0103] In a specific example, switching device 1 sends a broadcast type target message to switching device 2 through aggregation port 1, and then aggregation port 1' of switching device 2 will receive the target message accordingly. By querying the inbound traffic aggregation member list of switching device 2, it can be determined that all member variables in aggregation port 1' are switching port 1', switching port 2' and switching port 3'. In addition, after switching device 2 determines that all its switch ports (switch port 1', switch port 2', switch port 3', switch port 4', switch port 5' and switch port 6') can be used as alternative forwarding ports according to the broadcast type of the target message, it can determine that the target forwarding ports are switching port 4', switch port 5' and switch port 6', that is, aggregation port 2', by filtering out switch port 1', switch port 2' and switch port 3'.

[0104] Afterwards, by querying the outbound traffic aggregation member list in the switching device 2, it can be determined that the switch ports currently in the aggregation port 2' that are in the open state are the switch port 4' and the switch port 5'. Then, a member port can be determined from the switch port 4' and the switch port 5' to forward the target message by randomly selecting or selecting according to a preset load balancing algorithm, so as to send the target message to the aggregation port 2" of the switching device 3.

[0105] With the above settings, when a member port in an aggregation port switches from the down state to the up state, the two switching devices do not need to coordinate the up state of the member port. Instead, they can wait until the member port is stable and up, for example, after a preset port oscillation suppression time, before adding the member port to the outbound traffic aggregation member list. Because the peer switching device uses a fixed inbound traffic aggregation member list, packets transmitted between the two switching devices can be forwarded accurately and efficiently, achieving zero packet loss after failure recovery. The software is also simple to operate, making it a preferred method for implementing port aggregation.

[0106] Example 3

[0107] Figure 3 This is a structural diagram of a message forwarding device based on aggregated ports provided in the third embodiment of the present invention. Figure 3 As shown, the apparatus includes a first member port determination module 310 and a target forwarding port determination module 320, wherein:

[0108] A first member port determining module 310 is configured to, upon receiving a target message through the first aggregation port, obtain each first member port included in the first aggregation port from the inbound traffic aggregation port list;

[0109] The inbound traffic aggregation port list is fixed with at least one aggregation port pre-configured by the switching device, and the member ports included in each aggregation port do not change with changes in the member port status;

[0110] The target forwarding port determination module 320 is configured to determine at least one target forwarding port among all switch ports according to each first member port, and forward the target message through the at least one target forwarding port.

[0111] The technical solution of the embodiment of the present invention is to add a new inbound traffic aggregation port list to the switching device, and at the same time set the member ports included in the aggregation port of the inbound traffic aggregation port list not to change following the change of the member port status. Accordingly, when the target message is received through the first aggregation port, the first member ports included in the first aggregation port can be obtained in the inbound traffic aggregation port list, and then at least one target forwarding port can be determined among all the switching ports based on the first member ports, and the target message is forwarded through the at least one target forwarding port. The technical solution provides a new form of message forwarding method based on aggregation ports, which can avoid synchronous modification of the STP status of the member ports in the aggregation port when a fault occurs or the fault is recovered, thereby effectively reducing the complexity of software operation while avoiding packet loss.

[0112] Based on the above embodiment, the first member port determining module 310 may include:

[0113] an alternative port determining unit, configured to determine at least one alternative forwarding port from among all switch ports according to the message description information of the target message and the first aggregation port;

[0114] The target forwarding port determining unit is configured to filter out each first member port from at least one candidate forwarding port to obtain at least one target forwarding port.

[0115] Based on the above embodiment, the candidate port determination unit further includes:

[0116] The broadcast determining unit is configured to determine all switch ports as candidate forwarding ports if it is determined that the target message is a broadcast message according to the message description information of the target message.

[0117] Based on the above embodiment, the first member port determination module 310 may further include:

[0118] a second member port acquiring unit configured to, if it is determined that the target forwarding port includes the second aggregation port, query the traffic aggregation port list and acquire all second member ports included in the second aggregation port;

[0119] The member ports included in each aggregation port in the outbound traffic aggregation port list change with the change of the member port status;

[0120] The forwarding unit is configured to determine a target second member port among all the second member ports, and forward the target message through the target second member port.

[0121] Based on the above embodiments, the forwarding unit further includes:

[0122] A hash value matching unit, configured to perform a hash operation on at least one message description item in the message description information of the target message to obtain a message hash value that matches the target message;

[0123] The message description item includes: at least one of a source Internet Protocol address, a destination Internet Protocol address, an Ethernet protocol, and a media access control layer of the target message;

[0124] A port quantity query unit, configured to query the traffic aggregation port list and obtain the total number of member ports included in the second aggregation port;

[0125] The target second member port determining unit is configured to perform a modulo operation on the total number of member ports included in the second aggregate port using the message hash value, and determine a target second member port from all the second member ports according to the modulo operation result.

[0126] Based on the above embodiments, the first member port determination module 310 may further include:

[0127] A port status detection unit, configured to detect in real time the port status of each member port included in each aggregation port in the inbound traffic aggregation port list;

[0128] The port updating unit is configured to update each member port included in each aggregation port in the outgoing traffic aggregation port list according to the port status detection result.

[0129] Based on the above embodiments, the port update unit further includes:

[0130] a port removing unit configured to, if it is determined based on the port state detection result that the first target member port included in the first target aggregation port in the outgoing traffic aggregation port list is switched from the open state to the closed state, remove the first target member port from the first target aggregation port in the outgoing traffic aggregation port list, and update the total number of member ports included in the first target aggregation port;

[0131] The port adding unit is configured to, if it is determined based on the port status detection result that the second target member port that has been historically removed from the second target aggregation port in the outgoing traffic aggregation port list is switched from a closed state to an open state, re-add the second target member port to the second target aggregation port in the outgoing traffic aggregation port list, and update the total number of member ports included in the second target aggregation port.

[0132] The packet forwarding device based on aggregated ports provided in the embodiment of the present invention can execute the packet forwarding method based on aggregated ports provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0133] Example 4

[0134] Figure 4 A schematic diagram of the structure of a switching device 10 that can be used to implement an embodiment of the present invention is shown. The switching device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The switching device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0135] like Figure 4 As shown, switching device 10 includes at least one processor 11 and memory, such as read-only memory (ROM) 12 and random access memory (RAM) 13, communicatively connected to at least one processor 11. The memory stores computer programs executable by the at least one processor. Processor 11 can perform various appropriate actions and processes based on the computer program stored in ROM 12 or loaded from storage unit 18 into RAM 13. RAM 13 can also store various programs and data required for the operation of switching device 10. Processor 11, ROM 12, and RAM 13 are interconnected via bus 14. An input / output (I / O) interface 15 is also connected to bus 14.

[0136] Multiple components in the switching device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, optical disk, etc.; and a communication unit 19, such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the switching device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0137] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, a digital signal processor (DSP), and any other suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the packet forwarding method based on aggregated ports.

[0138] Specifically, the method includes:

[0139] When receiving the target message through the first aggregation port, obtaining each first member port included in the first aggregation port in the inbound traffic aggregation port list;

[0140] The inbound traffic aggregation port list is fixed with at least one aggregation port pre-configured by the switching device, and the member ports included in each aggregation port do not change with changes in the member port status;

[0141] At least one target forwarding port is determined among all the switch ports according to each first member port, and the target message is forwarded through the at least one target forwarding port.

[0142] In some embodiments, the aggregate port-based packet forwarding method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on switching device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the aggregate port-based packet forwarding method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to execute the aggregate port-based packet forwarding method in any other appropriate manner (e.g., via firmware).

[0143] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0144] Computer programs used to implement the processes of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program

[0145] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0146] To provide interaction with a user, the systems and techniques described herein can be implemented on a switching device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the switching device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0147] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0148] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0149] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0150] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A message forwarding method based on aggregated ports, characterized in that: include: When receiving the target message through the first aggregation port, obtaining each first member port included in the first aggregation port in the inbound traffic aggregation port list; The inbound traffic aggregation port list is fixed with at least one aggregation port pre-configured by the switching device, and the member ports included in each aggregation port do not change with changes in the member port status; Determine at least one target forwarding port among all switch ports according to each first member port, and forward the target message through the at least one target forwarding port; Among them, forwarding the target message through at least one target forwarding port includes: if it is determined that the target forwarding port includes a second aggregation port, querying the outbound traffic aggregation port list to obtain all second member ports included in the second aggregation port; wherein the member ports included in each aggregation port in the outbound traffic aggregation port list change with the change of the member port state; determining the target second member port among all the second member ports, and forwarding the target message through the target second member port, wherein the second aggregation port is the aggregation port included in the target forwarding port.

2. The method according to claim 1, characterized in that Determining at least one target forwarding port from all switch ports based on each first member port includes: Determine at least one candidate forwarding port from all switch ports according to the message description information of the target message; In at least one candidate forwarding port, each first member port is filtered out to obtain at least one target forwarding port.

3. The method according to claim 2, characterized in that Determine at least one candidate forwarding port from all switch ports based on the message description information of the target message, including: If the target message is determined to be a broadcast message according to the message description information of the target message, all switch ports are determined as candidate forwarding ports.

4. The method according to claim 1, wherein Determine a target second member port from among all second member ports, including: Performing a hash operation on at least one message description item in the message description information of the target message to obtain a message hash value that matches the target message; The message description item includes: at least one of a source Internet Protocol address, a destination Internet Protocol address, an Ethernet protocol, and a media access control layer of the target message; Query the traffic aggregation port list to obtain the total number of member ports included in the second aggregation port; A modulo operation is performed on the total number of member ports included in the second aggregate port using the message hash value, and a target second member port is determined from all the second member ports according to the modulo operation result.

5. The method according to claim 1, wherein Also includes: Real-time detection of the port status of each member port included in each aggregation port in the inbound traffic aggregation port list; According to the port status detection result, each member port included in each aggregation port in the traffic aggregation port list is updated.

6. The method according to claim 5, characterized in that Based on the port status detection results, the member ports of each aggregation port in the traffic aggregation port list are updated, including: If, according to the port state detection result, it is determined that the first target member port included in the first target aggregation port in the outbound traffic aggregation port list is switched from the open state to the closed state, then the first target member port is removed from the first target aggregation port in the outbound traffic aggregation port list, and the total number of member ports included in the first target aggregation port is updated; If, according to the port status detection result, it is determined that the second target member port that has been historically removed from the second target aggregation port in the outgoing traffic aggregation port list is switched from a closed state to an open state, the second target member port is re-added to the second target aggregation port in the outgoing traffic aggregation port list, and the total number of member ports included in the second target aggregation port is updated.

7. A packet forwarding device based on aggregated ports, characterized in that: include: a first member port determining module configured to, upon receiving a target message through the first aggregation port, obtain, from the inbound traffic aggregation port list, each first member port included in the first aggregation port; The inbound traffic aggregation port list is fixed with at least one aggregation port pre-configured by the switching device, and the member ports included in each aggregation port do not change with changes in the member port status; a target forwarding port determining module, configured to determine at least one target forwarding port among all switch ports according to each first member port, and forward the target message through the at least one target forwarding port; Among them, the first member port determination module also includes: a second member port acquisition unit, which is used to query the outbound traffic aggregation port list if it is determined that the target forwarding port includes the second aggregation port, and obtain all second member ports included in the second aggregation port; wherein the member ports included in each aggregation port in the outbound traffic aggregation port list change with the change of the member port state; a forwarding unit, which is used to determine the target second member port among all second member ports, and forward the target message through the target second member port, wherein the second aggregation port is the aggregation port included in the target forwarding port.

8. A switching device, characterized in that: The switching device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the packet forwarding method based on aggregated ports according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the packet forwarding method based on aggregated ports according to any one of claims 1 to 6 when executed.

Citation Information

Patent Citations

  • Routing transmission implementation method based on multi-channel network link aggregation

    CN111800336A