CN108259329B - Message forwarding method and device - Google Patents

Message forwarding method and device Download PDF

Info

Publication number
CN108259329B
CN108259329B CN201710764755.2A CN201710764755A CN108259329B CN 108259329 B CN108259329 B CN 108259329B CN 201710764755 A CN201710764755 A CN 201710764755A CN 108259329 B CN108259329 B CN 108259329B
Authority
CN
China
Prior art keywords
source
member device
multicast
stack
port
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201710764755.2A
Other languages
Chinese (zh)
Other versions
CN108259329A (en
Inventor
梁学伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201710764755.2A priority Critical patent/CN108259329B/en
Publication of CN108259329A publication Critical patent/CN108259329A/en
Application granted granted Critical
Publication of CN108259329B publication Critical patent/CN108259329B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/58Association of routers
    • H04L45/583Stackable routers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/16Multipoint routing
    • 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

Abstract

The invention provides a message forwarding method and a device, wherein the method comprises the following steps: when receiving multicast messages from non-stacking ports, selecting a source ID to distribute to the multicast messages according to a load sharing principle, respectively carrying the source ID in stacking heads added for the multicast messages and the multicast message replication messages, and respectively forwarding the multicast messages with the added stacking heads and the multicast message replication messages through two stacking ports of the source ID; when a multicast message is received from a stacking port and member equipment connected with another stacking port is member equipment corresponding to source member equipment of the multicast message, inquiring a pre-configured source filtering rule according to a source ID carried in a stacking head of the multicast message to judge whether the multicast message is allowed to be forwarded through the other stacking port; if yes, forwarding the multicast message through the other stacking port; otherwise, refusing to forward the multicast message through the other stacking port. By applying the embodiment of the invention, multicast load sharing can be realized.

Description

Message forwarding method and device
Technical Field
The present invention relates to the field of network communication technologies, and in particular, to a method and an apparatus for forwarding a packet.
Background
Stacking refers to connecting a plurality of devices together, performing necessary configuration, and virtualizing the devices into one device. The virtualization technology can be used for integrating hardware resources and software processing capacity of a plurality of devices, and realizing cooperative work, unified management and uninterrupted maintenance of the plurality of devices. Each device in the stack is referred to as a member device and has its own unique identifier.
The stacked connection topology may include chain connections and ring connections, and the corresponding stacked system may be referred to as chain stacking and ring stacking.
In a ring stack with an even number of member devices greater than 2, there must be one corresponding member device for each member device, and there are two equal shortest paths between the two member devices to reach the other.
Taking the ring stack shown in fig. 1 as an example, in the ring stack, the number of member devices is 4 ( member devices 110, 120, 130, and 140, respectively), the member device corresponding to the member device 110 is the member device 130, the member device 110 can reach the member device 130 through the member device 120 or the member device 140, respectively, and the hop counts are equal.
In the annular stack with the number of the member devices being more than 2 and even number, in order to ensure that only one multicast message sent by the member devices reaches the corresponding member devices, daisy chain connection is needed among the member devices, namely the stacking port a of the adjacent member device is connected with the stacking port b of the member device at the opposite end; the multicast message sent by any member device is allowed to reach the corresponding member device through the multicast message sent by the stacking port a, and the multicast message on the other shortest path (i.e. the multicast message sent by the stacking port b) needs to perform multicast source filtering blocking on the last hop.
Still taking the ring stack shown in fig. 1 as an example, for the multicast message sent by the member device 110, only the multicast message sent by the stack port a is allowed to reach the member device 130, but the multicast message sent by the stack port b is not allowed to reach the member device 130, that is, when the member device 120 receives the multicast message, since the multicast message is sent by the stack port a of the member device 110, the member device 120 will further forward to the member device 130; when the member device 140 receives the multicast packet, because the multicast packet is sent by the stack port b of the member device 110, the member device 120 needs to perform multicast source filtering blocking, and does not forward the multicast packet to the member device 130, thereby ensuring that only one multicast packet sent by the member device 110 reaches the member device 130.
However, practice finds that, in the above-mentioned message forwarding scheme, a multicast message sent by any member device can only reach the corresponding member device through one shortest path, so that another shortest path between the member device and the corresponding member device cannot perform multicast load sharing.
Disclosure of Invention
The invention provides a message forwarding method and a message forwarding device, which are used for solving the problem that multicast load sharing cannot be realized between member equipment and corresponding member equipment in an even number annular stack with the member equipment larger than 2.
According to a first aspect of the embodiments of the present invention, a packet forwarding method is provided, which is applied to a target member device in an annular stack, where the number of the member devices in the annular stack is an even number greater than 2, each member device is configured with two corresponding source IDs, a first member device and a second member device adjacent to the target member device are configured with a first source filtering rule and a second source filtering rule, respectively, the first source filtering rule is used to instruct the first member device to reject forwarding a first type of multicast packet to the target member device, the second source filtering rule is used to instruct the second member device to reject forwarding a second type of multicast packet to the target member device, the first type of multicast packet is a multicast packet whose source member device is a member device corresponding to the target member device and whose carried source ID is the first type of source ID, the second type multicast packet is a multicast packet in which a source member device is a member device corresponding to the target member device and a source ID carried by the multicast packet is a second type source ID, the first type source ID includes one of two source IDs configured on the member device corresponding to the target member device, and the second type source ID includes the other of the two source IDs configured on the member device corresponding to the target member device, and the method includes:
when receiving a multicast message from a non-stack port, selecting a source ID from two source IDs of the target member equipment according to a load sharing principle to distribute the source ID to the multicast message, respectively carrying the source ID in a stack head added for the multicast message and a copy message of the multicast message, and respectively forwarding the multicast message with the added stack head and the copy message of the multicast message through two stack ports of the source ID;
when a multicast message is received from a stacking port and member equipment connected with another stacking port is member equipment corresponding to source member equipment of the multicast message, inquiring a pre-configured source filtering rule according to a source ID carried in a stacking head of the multicast message to judge whether the multicast message is allowed to be forwarded through the other stacking port;
if yes, forwarding the multicast message through the other stacking port;
otherwise, refusing to forward the multicast message through the other stacking port.
According to a first aspect of the embodiments of the present invention, there is provided a packet forwarding apparatus, which is applied to a target member device in an annular stack, where the number of the member devices in the annular stack is an even number greater than 2, each member device is configured with two corresponding source IDs, a first member device and a second member device adjacent to the target member device are configured with a first source filtering rule and a second source filtering rule, respectively, the first source filtering rule is used to instruct the first member device to reject to forward a first type of multicast packet to the target member device, the second source filtering rule is used to instruct the second member device to reject to forward a second type of multicast packet to the target member device, the first type of multicast packet is a multicast packet whose source member device is a member device corresponding to the target member device and whose carried source ID is a first type of source ID, the second type multicast packet is a multicast packet in which a source member device is a member device corresponding to the target member device and a source ID carried by the multicast packet is a second type source ID, the first type source ID includes one of two source IDs configured on the member device corresponding to the target member device, and the second type source ID includes the other of the two source IDs configured on the member device corresponding to the target member device, and the apparatus includes:
a receiving unit, configured to receive a packet;
the distribution unit is used for selecting one source ID from the two source IDs of the target member equipment to distribute the source ID to the multicast message according to the load sharing principle when the receiving unit receives the multicast message from the non-stacking port;
a message processing unit, configured to carry the source ID in a stack header added to the multicast message and a duplicate message of the multicast message, respectively;
a sending unit, configured to forward the multicast packet with the added stack header and a duplicate packet of the multicast packet through two stack ports of the sending unit;
the judging unit is further configured to, when the receiving unit receives a multicast packet from a stack port and a member device connected to another stack port is a member device corresponding to a source member device of the multicast packet, query a pre-configured source filtering rule according to a source ID carried in a stack header of the multicast packet to judge whether the multicast packet is allowed to be forwarded through the another stack port;
the sending unit is further configured to forward the multicast packet through the other stacking port if the determining unit determines that the multicast packet is allowed to be forwarded through the other stacking port; otherwise, refusing to forward the multicast message through the other stacking port.
By applying the embodiment of the invention, in the annular stack with the number of member devices being more than 2 and even number, two source IDs are configured on each member device, and the corresponding source filtering rule is configured on the member device adjacent to each member device, when the member device receives the multicast message from the non-stack port, the member device distributes the source ID for the multicast message from the two pre-configured source IDs according to the load sharing principle, carries the source ID in the stack head added for the multicast message and the copy message of the multicast message, and forwards the multicast message with the stack head added and the copy message of the multicast message through the two stack ports of the member device; when member equipment receives a multicast message from a stack port and member equipment connected with another stack port is member equipment corresponding to source member equipment of the multicast message, inquiring a pre-configured source filtering rule according to a source ID carried in a stack head of the multicast message to judge whether the multicast message is allowed to be forwarded through the other stack port, and if so, forwarding the multicast message through the other stack port; otherwise, the multicast message is refused to be forwarded through the other stacking port, and on the premise that only one multicast message sent by any member equipment reaches the corresponding member equipment, two equivalent paths between the member equipment and the corresponding member equipment can be used for forwarding the multicast message, so that multicast load sharing is realized.
Drawings
FIG. 1 is a schematic diagram of a typical annular stack;
fig. 2 is a schematic flowchart of a message forwarding method according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a ring stack according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a message forwarding apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions in the embodiments of the present invention better understood and make the above objects, features and advantages of the embodiments of the present invention more comprehensible, the technical solutions in the embodiments of the present invention are described in further detail below with reference to the accompanying drawings.
Referring to fig. 2, a flow chart of a message forwarding method according to an embodiment of the present invention is shown, where the message forwarding method can be applied to any member device (referred to as a target member device herein) in an even ring stack with a number of member devices greater than 2.
It should be noted that, in the embodiment of the present invention, each member device in the ring stack is configured with 2 source IDs; two member devices (referred to as a first member device and a second member device herein) adjacent to the target member device are respectively configured with corresponding source filtering rules (referred to as a first source filtering rule and a second source filtering rule herein), where the first source filtering rule is used to instruct the first member device to refuse to forward the first type of multicast packet to the target member device, and the second source filtering rule is used to instruct the second member device to refuse to forward the second type of multicast packet to the target member device; the first type multicast message is a multicast message with a source ID of a first type source ID, the second type multicast message is a multicast message with a source ID of a second type source ID, the first type source ID comprises one source ID of two source IDs configured on member equipment corresponding to the target member equipment, and the second type source ID comprises the other source ID of the two source IDs configured on the member equipment corresponding to the target member equipment.
Taking the ring stack shown in fig. 1 as an example, assuming that the member device 130 is a target member device, the first member device and the second member device are the member device 120 and the member device 140, respectively (taking the first member device as the member device 120 and the second member device as the member device 140 as an example), and the member device corresponding to the target member device is the member device 110, the member device 120 needs to be configured to instruct the member device 120 to refuse to forward the first type multicast packet to the member device 130; the member device 140 needs to be configured to instruct the member device 140 to refuse to forward the second type multicast packet to the member device 130; wherein, the first type multicast packet is that the source member device is the member device 110, and the carried source ID includes one source ID of two source IDs configured on the member device 110; the second type multicast packet is that the source member device is the member device 110, and the carried source ID includes another source ID of the two source IDs configured on the member device 110.
For example, assuming that the source IDs configured on the member device 110 are ID1 and ID2, the first type source ID may be ID1 and the second type source ID may be ID 2; alternatively, the first-type source ID is ID2 and the second-type source ID is ID 1.
As shown in fig. 2, the message forwarding method may include the following steps:
step 201, when receiving a multicast packet from a non-stack port, selecting a source ID from two source IDs of a target member device according to a load sharing principle to allocate to the multicast packet, respectively carrying the source ID in a stack header added for the multicast packet and a duplicate packet of the multicast packet, and respectively forwarding the multicast packet and the duplicate packet of the multicast packet with the added stack header through two stack ports of the multicast packet.
In the embodiment of the present invention, when the target member device receives the multicast packet from the non-stack port, on one hand, the target member device may select one source ID from two pre-configured source IDs according to a load sharing principle to allocate to the multicast packet.
For convenience of description, the two source IDs configured on the target member device are hereinafter taken as a first source ID and a second source ID, respectively.
Accordingly, in this embodiment, the target member device may assign a first source ID to a portion of multicast packets received from non-stacking ports and a second source ID to the remaining multicast packets received from non-stacking ports.
On the other hand, the target member device may also copy the multicast packet received from the non-stack port, and add a stack header to the multicast packet and the copied packet of the multicast packet, respectively.
Furthermore, the target member device can carry the source ID assigned to the multicast packet in the stack headers of the multicast packet and the duplicate packet of the multicast packet, and forward the multicast packet with the stack header and the duplicate packet of the multicast packet through its two stack ports.
The specific implementation of adding the stack header to the multicast packet received from the non-stack port by the target member device may refer to related implementation in the existing flow, and details of the embodiment of the present invention are not described herein.
In an embodiment of the present invention, the selecting one source ID from two source IDs of the target member device according to the load sharing principle to allocate to the multicast packet may include:
one of the two source IDs is assigned to multicast messages received from a part of non-stacking ports of the target member device, and the other of the two source IDs is assigned to multicast messages received from the remaining non-stacking ports of the target member device except the part of non-stacking ports.
In this embodiment, the non-stacking port on the target member device may be divided into two parts, and one of the two source IDs of the target member device (e.g., the first source ID) may be assigned to the multicast packet received from one of the two parts of non-stacking ports, and the other of the two source IDs of the target member device (e.g., the second source ID) may be assigned to the multicast packet received from the other part of non-stacking ports.
In an implementation manner of this embodiment, the assigning one of the two source IDs for the multicast packet received from part of the non-stack ports of the target member device, and assigning the other of the two source IDs for the multicast packet received from the rest of the non-stack ports of the target member device except for the part of the non-stack ports may include:
one of the two source IDs is allocated to the multicast message received from the non-stack port with the odd port number on the target member device, and the other of the two source IDs is allocated to the multicast message received from the non-stack port with the even port number on the target member device.
In this embodiment, the non-stacking ports of the target member device may be divided into two parts according to the parity of the port numbers of the non-stacking ports on the target member device, that is, one part is a non-stacking port with an odd port number, and the other part is a non-stacking port with an even port number.
Accordingly, when a target member device receives a multicast packet from a non-stacking port, a source ID may be assigned to the multicast packet according to the parity of the port number of the non-stacking port that received the multicast packet.
For example, when a target member device receives a multicast packet from a non-stack port with an odd number of port numbers, the target member device may assign a first source ID to the multicast packet; when the target member device receives the multicast message from the non-stack port with the even port number, the target member device may allocate a second source ID to the multicast message; and vice versa.
In another implementation manner of this embodiment, when the target member device has a dual-chip structure, assigning one of the two source IDs to multicast packets received from part of non-stack ports of the target member device, and assigning the other of the two source IDs to multicast packets received from the other non-stack ports of the target member device except for the part of non-stack ports includes:
one of the two source IDs is assigned to multicast messages received from a non-stack port on one of the forwarding chips on the target member device, and the other of the two source IDs is assigned to multicast messages received from a non-stack port on the other forwarding chip on the target member device.
In this embodiment, when the target member device has a dual-chip structure (assuming that the target member device has a first forwarding chip and a second forwarding chip, respectively), the non-stacking port on the target member device may be divided into two parts according to the forwarding chip where each non-stacking port on the target member device is located, where one part is the non-stacking port on the first forwarding chip, and the other part is the non-stacking port on the second forwarding chip.
Correspondingly, when the target member device receives the multicast message from the non-stack port, the source ID may be assigned to the multicast message according to the forwarding chip where the non-stack port that receives the multicast message is located.
For example, when a target member device receives a multicast packet from a non-stack port on a first forwarding chip, the target member device may assign a first source ID to the multicast packet; when the target member device receives the multicast message from the non-stack port on the second forwarding chip, the target member device may assign a second source ID to the multicast message; and vice versa.
It should be appreciated that the specific implementation of the non-stack port division and source ID assignment on the target member device described in the foregoing embodiments is only some specific examples in the embodiments of the present invention, and is not a limitation to the scope of the present invention, that is, in the embodiments of the present invention, the non-stack port division and source ID assignment on the target member device may also be performed in other manners, for example, a plurality of non-stack ports with smaller port numbers of the target member device may be divided into one part, and the remaining non-stack ports may be divided into another part; alternatively, a plurality of non-stacking ports of the target member device may be randomly divided into one part, and the rest of the non-stacking ports may be divided into another part, and the specific implementation thereof is not described herein again.
Step 202, when a multicast packet is received from a stack port and a member device connected to another stack port is a member device corresponding to a source member device of the multicast packet, querying a pre-configured source filtering rule according to a source ID carried in a stack header of the multicast packet to determine whether to allow the multicast packet to be forwarded through the another stack port. If yes, go to step 203; otherwise, go to step 204.
In the embodiment of the present invention, when a target member device receives a multicast packet from a stack port, the target member device may determine whether a member device connected to another stack port of the target member device is a member device corresponding to a source member device of the multicast packet.
Taking the ring stack shown in fig. 1 as an example, when a multicast packet sent by a member device 110 reaches the member device 120 (or the member device 140), the member device 120 (or the member device 140) may determine whether a member device (i.e., the member device 130) connected to another stack port of the member device is a member device corresponding to a source member device (the member device 110) of the multicast packet. In this example, member device 130 is the member device to which member device 110 corresponds.
In the embodiment of the present invention, when a target member device receives a multicast packet from a stack port and determines that a member device connected to another stack port of the target member device is a member device corresponding to a source member device of the multicast packet, the target member device may query a pre-configured source filtering rule according to a source ID carried in a stack header of the multicast packet to determine whether to allow the multicast packet to be forwarded through the another stack port.
In one embodiment of the present invention, when a source filtering rule configured by a target member device indicates that the target member device rejects to forward a multicast packet with a source ID carried by another stacking port as a first source ID, querying a pre-configured source filtering rule according to the source ID carried by the stacking port of the multicast packet to determine whether to allow the multicast packet to be forwarded through the another stacking port includes:
when the source ID carried in the stack header of the multicast message is the first source ID, judging that the multicast message is not allowed to be forwarded through the other stack port;
and when the source ID carried in the stack head of the multicast message is not the first source ID, judging that the multicast message is allowed to be forwarded through the other stack port.
In this embodiment, when a target member device receives a multicast packet from a stack port and determines that a member device connected to another stack port is a member device corresponding to a source member device of the multicast packet, the target member device may determine whether a source ID carried in the multicast packet is a first source ID, and when the source ID is the first source ID, determine that the multicast packet is not allowed to be forwarded through the another stack port; when the source ID is not the source ID, the multicast message is allowed to be forwarded through the other stack port.
It should be noted that, in the embodiment of the present invention, when the target member device receives the multicast packet from the stack port and the member device connected to another stack port is not the member device corresponding to the source member device, the target member device may directly forward the multicast packet through the another stack port without querying the source filtering rule.
Step 203, forwarding the multicast packet through the other stack port.
And step 204, refusing to forward the multicast message through the other stacking port.
In the embodiment of the present invention, when the target member device determines to allow the multicast packet received from the stack port to be forwarded through the other stack port, the target member device may forward the multicast packet through the other stack port.
When the target member device determines that the multicast message received from the stack port is not allowed to be forwarded through the other stack port, the target member device may refuse to forward the multicast message through the other stack port.
As can be seen, in the method flow shown in fig. 2, for any member device, both the two equal-cost paths between the member device and the corresponding member device can be used for multicast packet forwarding, thereby realizing multicast load sharing.
In order to enable those skilled in the art to better understand the technical solution provided by the embodiment of the present invention, the following specific application scenarios illustrate the technical solution provided by the embodiment of the present invention.
Example one
Taking the ring stack shown in fig. 1 as an example, in this embodiment, it is assumed that the source ID configured for the non-stack port with the odd port number on the member device 110 is 1, and the source ID configured for the non-stack port with the even port number is 2, and the member device 120 is configured with a first source filtering rule for instructing the member device 120 to reject the source member device as the member device 110, and the multicast packet with the source ID of 1 is forwarded to the member device 130; the member device 130 is configured with a second source filtering rule for instructing the member device 120 to reject the multicast packet whose source ID is 2 as the member device 110, and forwarding the multicast packet to the member device 130.
In this embodiment, the implementation flow of the packet forwarding scheme is as follows:
1. when the member device 110 receives a multicast packet from a physical port 1 (non-stack port), the member device 110 assigns a source ID to the multicast packet (the source ID corresponding to the physical port 1 is 1), carries the source ID in the stack headers of the multicast packet and a duplicate packet of the multicast packet, and forwards the multicast packet through a stack port a and a stack port b, respectively;
2. when the member device 120 receives the multicast packet sent by the member device 110 from the stack port b, it finds that the member device (i.e., the member device 130) connected to another stack port (stack port a) is a member device corresponding to the source member device (i.e., the member device 110) of the multicast packet, at this time, the member device 120 may query the source filtering rule according to the source ID (1) of the multicast packet, and find that the source filtering rule is matched with the first source filtering rule, so the member device 120 rejects to forward the multicast packet to the member device 130 through the stack port a;
3. when the member device 140 receives the multicast packet sent by the member device 110 from the stack port a, it finds that the member device (i.e., the member device 130) connected to another stack port (stack port b) is a member device corresponding to the source member device (i.e., the member device 110) of the multicast packet, at this time, the member device 140 may query the source filtering rule according to the source ID (1) of the multicast packet, and find that there is no matching source filtering rule, at this time, the member device 140 may forward the multicast packet to the member device 130 through the stack port b;
4. when the member device 110 receives a multicast packet from a physical port 2 (non-stack port), the member device 110 assigns a source ID to the multicast packet (the source ID corresponding to the physical port 2 is 2), carries the source ID in a stack header, and forwards the multicast packet through a stack port a and a stack port b, respectively;
5. when the member device 120 receives the multicast packet sent by the member device 110 from the stack port b, it finds that the member device (i.e., the member device 130) connected to another stack port (stack port a) is a member device corresponding to the source member device (i.e., the member device 110) of the multicast packet, at this time, the member device 120 may query the source filtering rule according to the source ID (2) of the multicast packet, and find that there is no matching source filtering rule match, and therefore, the member device 120 forwards the multicast packet to the member device 130 through the stack port a;
6. when the member device 140 receives the multicast packet sent by the member device 110 from the stack port a, it finds that the member device (i.e., the member device 130) connected to another stack port (stack port b) is a member device corresponding to the source member device (i.e., the member device 110) of the multicast packet, at this time, the member device 140 may query the source filtering rule according to the source ID (2) of the multicast packet, find that the multicast packet matches the second source filtering rule, and at this time, the member device 140 rejects to forward the multicast packet to the member device 130 through the stack port b.
As can be seen, for the multicast packets sent by the member device 110, on the premise of ensuring that only one multicast packet is forwarded to the member device 130, the two equal paths "member device 110-member device 120-member device 130" and "member device 110-member device 140-member device 130" between the member device 110 and the member device 130 are both utilized, thereby realizing multicast load sharing.
Example two
Referring to fig. 3, which is a schematic diagram of a ring stack according to an embodiment of the present invention, as shown in fig. 3, the number of member devices in the ring stack is 6 (member devices 310 to 360, respectively), and daisy-chain connections are performed between the member devices.
In this embodiment, it is assumed that the member device 310 has a dual-chip structure (assuming that two chips are a first chip and a second chip, respectively), the source ID pre-assigned to the first chip of the member device is 100, and the source ID assigned to the second chip is 200; the member device 330 is configured with a first source filtering rule for instructing the member device 330 to reject the source member device as the member device 310, and forwarding the multicast packet with the source ID of 100 to the member device 340; the member device 350 is configured with a second source filtering rule for instructing the member device 350 to reject the multicast packet whose source ID is 200 as the member device 310, and forward the multicast packet to the member device 340.
In this embodiment, the implementation flow of the packet forwarding scheme is as follows:
1. when the member device 310 receives a multicast packet from a non-stack port and an ingress port of the packet is located on a first chip, the member device 310 assigns a source ID (i.e. 100) corresponding to the first chip to the multicast packet, carries the source ID in the stack headers of the multicast packet and a duplicate packet of the multicast packet, and forwards the multicast packet through a stack port a and a stack port b, respectively;
2. the member device 320 receives the multicast packet sent by the member device 310 from the stack port b, and since the member device (i.e., the member device 330) connected to another stack port (stack port a) of the member device 320 is not a member device corresponding to the source member device (i.e., the member device 310) of the multicast packet, at this time, the member device 320 directly forwards the multicast packet to the member device 330 through another stack port;
the process of the member device 360 receiving the multicast packet is similar to the process of the member device 320, which is not described herein again, and the member device 360 forwards the multicast packet to the member device 350;
3. when the member device 330 receives the multicast packet sent by the member device 320 from the stack port b, it finds that the member device (i.e., the member device 340) connected to another stack port (stack port a) is a member device corresponding to the source member device (i.e., the member device 310) of the multicast packet, at this time, the member device 330 may query the source filtering rule according to the source ID (100) of the multicast packet, and find that the source filtering rule is matched with the first source filtering rule, and therefore, the member device 330 rejects to forward the multicast packet to the member device 340 through the stack port a;
4. when the member device 350 receives the multicast packet sent by the member device 360 from the stack port a, it finds that the member device (i.e., the member device 340) connected to another stack port (stack port b) is a member device corresponding to the source member device (i.e., the member device 310) of the multicast packet, at this time, the member device 350 may query the source filtering rule according to the source ID (100) of the multicast packet, and find that there is no matched source filtering rule, at this time, the member device 350 may forward the multicast packet to the member device 340 through the stack port b;
5. when the member device 310 receives a multicast packet from a non-stack port and an ingress port of the packet is located on a second chip, the member device 310 assigns a source ID (i.e. 200) corresponding to the second chip to the multicast packet, carries the source ID in the stack headers of the multicast packet and a duplicate packet of the multicast packet, and forwards the multicast packet through the stack port a and the stack port b, respectively;
6. the member device 320 receives the multicast packet sent by the member device 310 from the stack port b, and since the member device (i.e., the member device 330) connected to another stack port (stack port a) of the member device 320 is not a member device corresponding to the source member device (i.e., the member device 310) of the multicast packet, at this time, the member device 320 directly forwards the multicast packet to the member device 330 through another stack port;
the process of the member device 360 receiving the multicast packet is similar to the process of the member device 320, which is not described herein again, and the member device 360 forwards the multicast packet to the member device 350;
7. when the member device 330 receives the multicast packet sent by the member device 320 from the stack port b, it finds that the member device (i.e., the member device 340) connected to another stack port (stack port a) is a member device corresponding to the source member device (i.e., the member device 310) of the multicast packet, at this time, the member device 330 may query the source filtering rule according to the source ID (200) of the multicast packet, and find that there is no matching source filtering rule, and therefore, the member device 330 forwards the multicast packet to the member device 340 through the stack port a;
8. when the member device 350 receives the multicast packet sent by the member device 360 from the stack port a, it finds that the member device (i.e., the member device 340) connected to another stack port (stack port b) is a member device corresponding to the source member device (i.e., the member device 310) of the multicast packet, at this time, the member device 350 may query the source filtering rule according to the source ID (200) of the multicast packet, find that the source filtering rule matches the second source filtering rule, at this time, the member device 350 refuses to forward the multicast packet to the member device 340 through the stack port b.
As can be seen from the above description, in the technical solution provided in the embodiment of the present invention, in an even number of ring stacks where the number of member devices is greater than 2, by configuring two source IDs on each member device and configuring corresponding source filtering rules on the member devices adjacent to each member device, when a member device receives a multicast packet from a non-stack port, a source ID is allocated to the multicast packet from two pre-configured source IDs in a load sharing principle, the source ID is carried in a stack header added to the multicast packet and a duplicate packet of the multicast packet, and the multicast packet and the duplicate packet of the multicast packet to which the stack header is added are forwarded through its own two stack ports; when member equipment receives a multicast message from a stack port and member equipment connected with another stack port is member equipment corresponding to source member equipment of the multicast message, inquiring a pre-configured source filtering rule according to a source ID carried in a stack head of the multicast message to judge whether the multicast message is allowed to be forwarded through the other stack port, and if so, forwarding the multicast message through the other stack port; otherwise, the multicast message is refused to be forwarded through the other stacking port, and on the premise that only one multicast message sent by any member equipment reaches the corresponding member equipment, two equivalent paths between the member equipment and the corresponding member equipment can be used for forwarding the multicast message, so that multicast load sharing is realized.
Referring to fig. 4, a schematic structural diagram of a message forwarding apparatus according to an embodiment of the present invention is provided, where the apparatus may be applied to a target member device in the foregoing method embodiment, and as shown in fig. 4, the apparatus may include:
a receiving unit 410, configured to receive a message;
an allocating unit 420, configured to select one source ID from two source IDs of the target member device to allocate to the multicast packet according to a load sharing principle when the receiving unit 410 receives the multicast packet from the non-stack port;
a message processing unit 430, configured to carry the source ID in the stacking headers added to the multicast message and the duplicate message of the multicast message, respectively;
a sending unit 440, configured to forward the multicast packet with the added stack header and a duplicate packet of the multicast packet through two stack ports of the sending unit;
the determining unit 450 is further configured to, when the receiving unit 410 receives the multicast packet from the stack port and a member device connected to another stack port is a member device corresponding to a source member device of the multicast packet, query a pre-configured source filtering rule according to a source ID carried in a stack header of the multicast packet to determine whether to allow the multicast packet to be forwarded through the another stack port;
the sending unit 440 is further configured to forward the multicast packet through the another stacking port if the determining unit 450 determines that the multicast packet is allowed to be forwarded through the another stacking port; otherwise, refusing to forward the multicast message through the other stacking port.
In an alternative embodiment, the allocating unit 420 is specifically configured to allocate one of the two source IDs to the multicast packet received from part of the non-stacking ports of the target member device, and allocate the other of the two source IDs to the multicast packet received from the other non-stacking ports of the target member device except for the part of the non-stacking ports.
In an optional embodiment, the allocating unit 420 is specifically configured to allocate one of the two source IDs to a multicast packet received from a non-stack port with an odd port number on the target member device, and allocate the other of the two source IDs to a multicast packet received from a non-stack port with an even port number on the target member device.
In an optional embodiment, the allocating unit 420 is specifically configured to, when the target member device is in a dual-chip structure, allocate one of the two source IDs to a multicast packet received from a non-stack port on one forwarding chip of the target member device, and allocate the other of the two source IDs to a multicast packet received from a non-stack port on the other forwarding chip of the target member device.
In an optional embodiment, the preconfigured source filtering rule indicates that the target member device rejects to forward the multicast packet with the source ID as the first source ID through the other stacking port; the first source ID is one of two source IDs configured on member equipment corresponding to the target member equipment;
correspondingly, the determining unit 450 is configured to determine that the multicast packet is not allowed to be forwarded through the other stacking port when the source ID carried in the stacking header of the multicast packet is the first source ID; and when the source ID carried in the stack head of the multicast message is not the first source ID, judging that the multicast message is allowed to be forwarded through another stack port.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.
As can be seen from the above embodiment, in an even number of ring stacks where the number of member devices is greater than 2, by configuring two source IDs on each member device and configuring corresponding source filtering rules on the member devices adjacent to each member device, when a member device receives a multicast packet from a non-stack port, a source ID is assigned to the multicast packet from the two pre-configured source IDs in a load sharing principle, the source ID is carried in a stack header added to the multicast packet and a duplicate packet of the multicast packet, and the multicast packet and the duplicate packet of the multicast packet to which the stack header is added are forwarded through its own two stack ports; when member equipment receives a multicast message from a stack port and member equipment connected with another stack port is member equipment corresponding to source member equipment of the multicast message, inquiring a pre-configured source filtering rule according to a source ID carried in a stack head of the multicast message to judge whether the multicast message is allowed to be forwarded through the other stack port, and if so, forwarding the multicast message through the other stack port; otherwise, the multicast message is refused to be forwarded through the other stacking port, and on the premise that only one multicast message sent by any member equipment reaches the corresponding member equipment, two equivalent paths between the member equipment and the corresponding member equipment can be used for forwarding the multicast message, so that multicast load sharing is realized.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A message forwarding method is applied to target member devices in an annular stack, and is characterized in that the number of the member devices in the annular stack is an even number greater than 2, each member device is configured with two corresponding source IDs, a first member device and a second member device adjacent to the target member device are respectively configured with a first source filtering rule and a second source filtering rule, the first source filtering rule is used for indicating the first member device to refuse to forward a first type of multicast message to the target member device, the second source filtering rule is used for indicating the second member device to refuse to forward a second type of multicast message to the target member device, the first type of multicast message is a multicast message in which a source member device is a member device corresponding to the target member device and a carried source ID is the first type of source ID, the second type multicast packet is a multicast packet in which a source member device is a member device corresponding to the target member device and a source ID carried by the multicast packet is a second type source ID, the first type source ID includes one of two source IDs configured on the member device corresponding to the target member device, and the second type source ID includes the other of the two source IDs configured on the member device corresponding to the target member device, and the method includes:
when receiving a multicast message from a non-stack port, selecting a source ID from two source IDs of the target member equipment according to a load sharing principle to distribute the source ID to the multicast message, respectively carrying the source ID in a stack head added for the multicast message and a copy message of the multicast message, and respectively forwarding the multicast message with the added stack head and the copy message of the multicast message through two stack ports of the source ID;
when a multicast message is received from a stacking port and member equipment connected with another stacking port is member equipment corresponding to source member equipment of the multicast message, inquiring a pre-configured source filtering rule according to a source ID carried in a stacking head of the multicast message to judge whether the multicast message is allowed to be forwarded through the other stacking port;
if yes, forwarding the multicast message through the other stacking port;
otherwise, refusing to forward the multicast message through the other stacking port.
2. The method of claim 1, wherein the selecting one of the two source IDs of the target member device on a load sharing basis to be allocated to the multicast packet comprises:
one of the two source IDs is assigned to multicast messages received from a part of non-stacking ports of the target member device, and the other of the two source IDs is assigned to multicast messages received from the remaining non-stacking ports of the target member device except the part of non-stacking ports.
3. The method of claim 2, wherein assigning one of the two source IDs for multicast packets received from a portion of non-stacking ports of the target member device and assigning the other of the two source IDs for multicast packets received from the remaining non-stacking ports of the target member device except for the portion of non-stacking ports comprises:
one of the two source IDs is allocated to the multicast message received from the non-stack port with the odd port number on the target member device, and the other of the two source IDs is allocated to the multicast message received from the non-stack port with the even port number on the target member device.
4. The method of claim 2, wherein when the target member device is in a dual-chip configuration, the assigning one of the two source IDs to multicast packets received from some non-stack ports of the target member device, and assigning the other of the two source IDs to multicast packets received from other non-stack ports of the target member device except for the some non-stack ports comprises:
one of the two source IDs is assigned to multicast messages received from a non-stack port on one of the forwarding chips on the target member device, and the other of the two source IDs is assigned to multicast messages received from a non-stack port on the other forwarding chip on the target member device.
5. The method according to claim 1, wherein the preconfigured source filtering rule indicates that the target member device rejects forwarding the multicast packet carrying the source ID as the first source ID through the another stacking port; wherein the first source ID is one of two source IDs configured on the member device corresponding to the member device connected to the other stacking port of the target member device;
the querying a pre-configured source filtering rule according to the source ID carried in the stacking port of the multicast packet to determine whether to allow the multicast packet to be forwarded through the other stacking port includes:
when the source ID carried in the stack header of the multicast message is the first source ID, judging that the multicast message is not allowed to be forwarded through the other stack port;
and when the source ID carried in the stack head of the multicast message is not the first source ID, judging that the multicast message is allowed to be forwarded through the other stack port.
6. A message forwarding device is applied to target member devices in an annular stack, and is characterized in that the number of the member devices in the annular stack is an even number greater than 2, each member device is configured with two corresponding source IDs, a first member device and a second member device adjacent to the target member device are respectively configured with a first source filtering rule and a second source filtering rule, the first source filtering rule is used for indicating the first member device to refuse to forward a first type of multicast message to the target member device, the second source filtering rule is used for indicating the second member device to refuse to forward a second type of multicast message to the target member device, the first type of multicast message is a multicast message in which a source member device is a member device corresponding to the target member device and a carried source ID is the first type of source ID, the second type multicast packet is a multicast packet in which a source member device is a member device corresponding to the target member device and a source ID carried by the multicast packet is a second type source ID, the first type source ID includes one of two source IDs configured on the member device corresponding to the target member device, and the second type source ID includes the other of the two source IDs configured on the member device corresponding to the target member device, and the apparatus includes:
a receiving unit, configured to receive a packet;
the distribution unit is used for selecting one source ID from the two source IDs of the target member equipment to distribute the source ID to the multicast message according to the load sharing principle when the receiving unit receives the multicast message from the non-stacking port;
a message processing unit, configured to carry the source ID in a stack header added to the multicast message and a duplicate message of the multicast message, respectively;
a sending unit, configured to forward the multicast packet with the added stack header and a duplicate packet of the multicast packet through two stack ports of the sending unit;
the judging unit is further configured to, when the receiving unit receives a multicast packet from a stack port and a member device connected to another stack port is a member device corresponding to a source member device of the multicast packet, query a pre-configured source filtering rule according to a source ID carried in a stack header of the multicast packet to judge whether the multicast packet is allowed to be forwarded through the another stack port;
the sending unit is further configured to forward the multicast packet through the other stacking port if the determining unit determines that the multicast packet is allowed to be forwarded through the other stacking port; otherwise, refusing to forward the multicast message through the other stacking port.
7. The apparatus of claim 6,
the allocating unit is specifically configured to allocate one of the two source IDs to a multicast packet received from a part of non-stacking ports of the target member device, and allocate the other of the two source IDs to a multicast packet received from the other non-stacking ports of the target member device except the part of non-stacking ports.
8. The apparatus of claim 7,
the allocating unit is specifically configured to allocate one of the two source IDs to a multicast packet received from a non-stack port with an odd port number on the target member device, and allocate the other of the two source IDs to a multicast packet received from a non-stack port with an even port number on the target member device.
9. The apparatus of claim 7,
the allocating unit is specifically configured to, when the target member device has a dual-chip structure, allocate one of the two source IDs to a multicast packet received from a non-stack port on one forwarding chip of the target member device, and allocate the other of the two source IDs to a multicast packet received from a non-stack port on the other forwarding chip of the target member device.
10. The apparatus according to claim 6, wherein the preconfigured source filtering rule indicates that the target member device rejects forwarding the multicast packet with the source ID being the first source ID through the another stacking port; wherein, the first source ID is one of two source IDs configured on the member device corresponding to the member device connected to the other stacking port of the target member device;
the judging unit is configured to judge that the multicast packet is not allowed to be forwarded through the other stacking port when the source ID carried in the stacking header of the multicast packet is the first source ID; and when the source ID carried in the stack head of the multicast message is not the first source ID, judging that the multicast message is allowed to be forwarded through the other stack port.
CN201710764755.2A 2017-08-30 2017-08-30 Message forwarding method and device Active CN108259329B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710764755.2A CN108259329B (en) 2017-08-30 2017-08-30 Message forwarding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710764755.2A CN108259329B (en) 2017-08-30 2017-08-30 Message forwarding method and device

Publications (2)

Publication Number Publication Date
CN108259329A CN108259329A (en) 2018-07-06
CN108259329B true CN108259329B (en) 2020-12-04

Family

ID=62722282

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710764755.2A Active CN108259329B (en) 2017-08-30 2017-08-30 Message forwarding method and device

Country Status (1)

Country Link
CN (1) CN108259329B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108900440B (en) * 2018-06-27 2021-02-26 新华三技术有限公司 Message forwarding method and device
CN110830393B (en) * 2019-10-22 2021-07-30 苏州盛科科技有限公司 Method and device for realizing MACsec in chip stacking mode

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101018180A (en) * 2007-03-12 2007-08-15 中兴通讯股份有限公司 A method for implementing the forward table in the stack system
CN102118294A (en) * 2009-12-31 2011-07-06 杭州华三通信技术有限公司 Load sharing method and equipment for stacked ring topology
CN103763196A (en) * 2014-01-27 2014-04-30 杭州华三通信技术有限公司 Method and device for processing multicast source filtering entry
CN104601461A (en) * 2013-10-30 2015-05-06 杭州华三通信技术有限公司 Message forwarding method and device in vertical intelligent resilient framework system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9853889B2 (en) * 2013-05-20 2017-12-26 Brocade Communications Systems, Inc. Broadcast and multicast traffic reduction in stacking systems

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101018180A (en) * 2007-03-12 2007-08-15 中兴通讯股份有限公司 A method for implementing the forward table in the stack system
CN102118294A (en) * 2009-12-31 2011-07-06 杭州华三通信技术有限公司 Load sharing method and equipment for stacked ring topology
CN104601461A (en) * 2013-10-30 2015-05-06 杭州华三通信技术有限公司 Message forwarding method and device in vertical intelligent resilient framework system
CN103763196A (en) * 2014-01-27 2014-04-30 杭州华三通信技术有限公司 Method and device for processing multicast source filtering entry

Also Published As

Publication number Publication date
CN108259329A (en) 2018-07-06

Similar Documents

Publication Publication Date Title
CN107547372B (en) Source filtering implementation method and device
JP6490205B2 (en) Method, apparatus and system for flow entry configuration
US8855116B2 (en) Virtual local area network state processing in a layer 2 ethernet switch
EP3119047B1 (en) Load balancing method, apparatus and system
EP3169044B1 (en) Address allocation method, cgn device and cgn double-master system
EP3522451A2 (en) Method for implementing network virtualization and related apparatus and communications system
JP2017518710A (en) Service flow processing method, apparatus, and device
CN109218229B (en) Message processing method, network equipment and storage medium
CN108134744B (en) Load sharing method in IRF stacking and single board
CN110266833B (en) IP address management method and edge cluster
WO2008075336A2 (en) Forwarding multicast traffic over link aggregation ports
CN102158386A (en) Distributed load balance for system management program
JP6618610B2 (en) Routing management
CN113497754B (en) Forwarding path establishing method and device and computer readable storage medium
US9565112B2 (en) Load balancing in a link aggregation
WO2016095758A1 (en) Cross-board forwarding method and apparatus
Cheng et al. Application-aware SDN routing for big data networking
CN108259329B (en) Message forwarding method and device
CN105530179A (en) Data message processing method and network equipment
RU2687215C1 (en) Method and device for transmitting information on openflow switch functions
JP6603312B2 (en) Allocating capacity for network connections to data streams based on type
EP3503484A1 (en) Message transmission method, device and network system
CN104092558A (en) Multi-processor equipment IP configuration method and multi-processor equipment
CN108924066B (en) Message forwarding method and device
CN108259330B (en) Message forwarding method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant