CN109587027B - Message forwarding method and device - Google Patents

Message forwarding method and device Download PDF

Info

Publication number
CN109587027B
CN109587027B CN201811442790.3A CN201811442790A CN109587027B CN 109587027 B CN109587027 B CN 109587027B CN 201811442790 A CN201811442790 A CN 201811442790A CN 109587027 B CN109587027 B CN 109587027B
Authority
CN
China
Prior art keywords
message
member device
vlan value
interface
stacking
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
CN201811442790.3A
Other languages
Chinese (zh)
Other versions
CN109587027A (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.)
New H3C Security Technologies Co Ltd
Original Assignee
New H3C Security 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 New H3C Security Technologies Co Ltd filed Critical New H3C Security Technologies Co Ltd
Priority to CN201811442790.3A priority Critical patent/CN109587027B/en
Publication of CN109587027A publication Critical patent/CN109587027A/en
Application granted granted Critical
Publication of CN109587027B publication Critical patent/CN109587027B/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
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • 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
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/35Switches specially adapted for specific applications
    • H04L49/354Switches specially adapted for specific applications for supporting virtual local area networks [VLAN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/55Prevention, detection or correction of errors
    • H04L49/552Prevention, detection or correction of errors by ensuring the integrity of packets received through redundant connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets

Landscapes

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

Abstract

The embodiment of the application provides a message forwarding method and a message forwarding device, relates to the technical field of communication, and is used for improving message transmission efficiency. The scheme of the embodiment of the application comprises the following steps: the method comprises the steps that first member equipment receives a first message, when it is determined that an outgoing interface of the first message sent by stacking equipment is located on second member equipment, a first VLAN value bound with the outgoing interface and a second VLAN value bound with a stacking port are obtained, the first VLAN value and the second VLAN value are packaged to a message header of the first message to obtain a first packaged message, then according to the second VLAN value, the stacking port used for transmitting the first packaged message is determined, the second VLAN value included in the first packaged message is deleted to obtain a second packaged message, the second packaged message is sent to the second member equipment through the stacking port, the second member equipment determines the interface through the first VLAN value, the first VLAN value included in the second packaged message is deleted to obtain the first message, and the first message is forwarded.

Description

Message forwarding method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for forwarding a packet.
Background
Currently, for a stack device including a plurality of member devices, after each member device receives a message from an uplink switch through an uplink, the member device may transmit the message to a downlink switch through a downlink. The uplink switch is a switch connected to the client, the uplink is a communication link between the uplink switch and the member equipment, the downlink switch is a switch connected to the server, and the downlink is a communication link between the downlink switch and the server.
Taking the networking shown in fig. 1 as an example, the stacking device includes a member device 1 and a member device 2, after receiving a message sent by a client, the uplink switch may forward the message to the member device 1 through a link 1, after the member device 1 processes the message, the member device forwards the message to the downlink switch through a link 3, or the uplink switch forwards the message to the member device 2 through a link 2, and after the member device 2 processes the message, the member device 2 forwards the message to the downlink switch through a link 4. After receiving the message, both the member device 1 and the member device 2 need to analyze the message and determine the destination address of the message.
However, if any one of the links 1 to 4 in fig. 1 fails, for example, the link 1 and the link 4 fail, or the link 2 and the link 3 fail, the transparent transmission message may occur between the member device 1 and the member device 2. Taking the failure of the link 2 and the link 3 as an example, the member device 1 may send a message to the member device 2 through the stack port after receiving the message through the link 1 and processing the message, and the member device 2 may send the message to the downlink switch through the link 4 after processing the message.
It can be seen that a large number of messages need to be transparently transmitted between member devices in the stacking device due to a link failure, and after a first member device (for example, the member device 1 in fig. 1) in the stacking device receives a message sent from the outside of the multi-stacking device and processes the message, a second member device (for example, the member device 2 in fig. 1) that receives the message forwarded by the first member device needs to process the message again, which results in a low transmission efficiency of the message.
Disclosure of Invention
An object of the embodiments of the present application is to provide a message forwarding method and apparatus, so as to improve transmission efficiency of a transparent transmission message. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a message forwarding method, which is applied to a first member device in a stacking device, where the stacking device further includes a second member device connected to the first member device through a stacking port, and the method includes:
the method comprises the steps that first member equipment receives a first message, when an outlet interface of the stacking equipment for sending the first message is determined to be located on second member equipment, a first VLAN value bound with the outlet interface and a second VLAN value bound with the stacking interface are obtained, and the first VLAN value and the second VLAN value are packaged to a message header of the first message to obtain a first packaged message;
determining the stacking port for transmitting the first packaging message according to the second VLAN value;
and deleting a second VLAN value included in the first encapsulation message to obtain a second encapsulation message, sending the second encapsulation message to second member equipment through the stacking port so that the second member equipment determines the outlet port through the first VLAN value, deleting the first VLAN value included in the second encapsulation message to obtain the first message, and forwarding the first message.
In a second aspect, an embodiment of the present application provides a packet forwarding method, which is applied to a second member device in a stacking device, and the method includes:
receiving a second encapsulation message through the stacking port, wherein the second encapsulation message comprises a first VLAN value;
judging whether the VLAN value bound with the stacking port comprises the first VLAN value or not;
if so, determining an interface through the first VLAN value, and deleting the first VLAN value included in the second encapsulation message to obtain a first message;
and forwarding the first message through the output interface.
In a third aspect, an embodiment of the present application provides a packet forwarding method, which is applied to a first member device in a stacking device, and the method includes:
acquiring a first VLAN value bound with the output interface and a second VLAN value bound with a stacking port of each member device for sending messages, and encapsulating the first VLAN value and each second VLAN value to a message header of the first message according to a transmission path to obtain a first encapsulated message;
determining a first stacking port, used by the first member device to be connected with a first second member device in the transmission path, according to a first second VLAN value in the first encapsulation message;
and deleting a first second VLAN value included in the first encapsulation message to obtain a second encapsulation message, and sending the second encapsulation message to the first second member device through the first stack port.
In a fourth aspect, an embodiment of the present application provides a packet forwarding apparatus, which is applied to a second member device in a stacking device, where the method includes:
receiving a third package message through a local first stack port, wherein the third package message comprises a first VLAN value and a second VLAN value bound with the stack port of each member device sending a message in a transmission path, and the first VLAN value is bound with an output interface of the member device which receives the message in the transmission path at last;
determining a second stacking port, used by the second member device to connect with a next member device in a transmission path, according to a first second VLAN value included in the third encapsulation message;
and deleting a first second VLAN value included in the third encapsulated message to obtain a fourth encapsulated message, and sending the fourth encapsulated message to the next member device in the transmission path through the second stacking port, so that the next member device in the transmission path can obtain the first second VLAN value or the first VLAN value according to the fourth encapsulated message.
In a fifth aspect, an embodiment of the present application provides a packet forwarding apparatus, which is applied to a first member device in a stacking device, where the stacking device further includes a second member device connected to the first member device through a stacking port, and the apparatus includes:
the receiving module is used for receiving the first message;
an obtaining module, configured to obtain, when it is determined that an egress interface, to which the first packet is sent by the stacking device, is located in the second member device, a first VLAN value bound to the egress interface and a second VLAN value bound to the stacking interface;
the encapsulation module is used for encapsulating the first VLAN value and the second VLAN value acquired by the acquisition module to a message header of the first message to obtain a first encapsulated message;
a transmission module, configured to determine, according to the second VLAN value, the stacking port for transmitting the first encapsulation packet;
the encapsulation module is further configured to delete a second VLAN value included in the first encapsulation packet, so as to obtain a second encapsulation packet;
the transmission module is further configured to send the second encapsulated packet to a second member device through the stacking port, so that the second member device determines the outgoing interface through the first VLAN value, deletes the first VLAN value included in the second encapsulated packet, obtains the first packet, and forwards the first packet.
In a sixth aspect, an embodiment of the present application provides a packet forwarding apparatus, which is applied to a second member device in a stacking device, and the apparatus includes:
a receiving module, configured to receive a second encapsulated packet through the stack port, where the second encapsulated packet includes a first VLAN value;
the judging module is used for judging whether the VLAN value bound with the stacking port comprises the first VLAN value or not;
a deleting module, configured to determine an interface through the first VLAN value if the determination result of the determining module is yes, and delete the first VLAN value included in the second encapsulated packet to obtain a first packet;
and the transmission module is used for forwarding the first message through the output interface.
In a seventh aspect, an embodiment of the present application provides a packet forwarding apparatus, which is applied to a first member device in a stacking device, and the apparatus includes:
the receiving module is used for receiving the first message;
the determining module is used for determining a transmission path for sending the first message to an outgoing interface when it is determined that the outgoing interface for sending the first message by the stacking equipment is not located in the member equipment, and the transmission path comprises second member equipment which sequentially passes through the transmission path;
the acquisition module is used for acquiring a first VLAN value bound with the output interface and a second VLAN value bound with a stacking port of each member device for sending messages;
the encapsulation module is used for encapsulating the first VLAN value and each second VLAN value to a message header of the first message according to a transmission path to obtain a first encapsulated message;
the determining module is further configured to determine, according to a first second VLAN value in the first encapsulation message, a first stacking port, which is used by the first component device to connect to a first second component device in the transmission path;
the encapsulation module is further configured to delete a first second VLAN value included in the first encapsulation packet, so as to obtain a second encapsulation packet;
and the sending module is used for sending the second packaging message to the first second member device through the first stacking port.
In an eighth aspect, an embodiment of the present application provides a packet forwarding apparatus, which is applied to a second member device in a stacking device, and the apparatus includes:
the receiving module is used for receiving a third encapsulated message through a local first stacking port, wherein the third encapsulated message comprises a first VLAN value and a second VLAN value bound with the stacking port of each member device sending the message in the transmission path, and the first VLAN value is bound with the output interface of the member device which receives the message in the transmission path at last;
a determining module, configured to determine, according to a first second VLAN value included in the third encapsulation packet, a second stacking port, where the second component device is used for connecting with a next component device in a transmission path;
the encapsulation module is used for deleting a first second VLAN value included in the third encapsulation message to obtain a fourth encapsulation message;
and the sending module is used for sending the fourth encapsulated message to the next member device in the transmission path through the second stacking port so that the next member device in the transmission path transmits the fourth encapsulated message according to the first second VLAN value or the first VLAN value in the fourth encapsulated message.
In a ninth aspect, an embodiment of the present application provides an electronic device, including: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: the message forwarding method in the first aspect, the second aspect, the third aspect, or the fourth aspect is implemented.
In a tenth aspect, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements the packet forwarding method in the first aspect, the second aspect, the third aspect, or the fourth aspect.
In an eleventh aspect, an embodiment of the present application further provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the message forwarding method described in the first aspect, the second aspect, the third aspect, or the fourth aspect.
In the message forwarding method provided in this embodiment of the present application, after a first member device receives a first message, if it is determined that an egress interface of a stacking device, which sends the first message, is located in a second member device, a first VLAN value bound to the egress interface and a second VLAN value bound to a stacking port may be obtained, and the first VLAN value and the second VLAN value are encapsulated to a message header of the first message to obtain a first encapsulated message, so that the first member device may transmit a second encapsulated message through the stacking port corresponding to the second VLAN value, after the second member device receives the second encapsulated message carrying the first VLAN value, a switch chip of the second member device may directly determine an interface according to the first VLAN value, and forward the first message through the egress interface, thereby implementing that the second member device directly forwards the message through a hardware layer corresponding to the switch chip, without identifying specific content of the message and processing the message, the transmission efficiency of the message can be improved.
Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of a networking architecture according to an embodiment of the present application;
fig. 2 is a flowchart of a message forwarding method according to an embodiment of the present application;
fig. 3 is a flowchart of another message forwarding method provided in the embodiment of the present application;
fig. 4 is an exemplary schematic diagram of an application scenario provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of a message forwarding apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another packet forwarding device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of another packet forwarding device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of another packet forwarding device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The inventor discovers that when studying the prior art: in the prior art, when a large number of messages need to be transparently transmitted between member devices in a stacking device due to a link failure, and a first member device in the stacking device receives and processes a message sent from the outside of a multi-stacking device, a second member device that receives the message forwarded by the first member device needs to process again to transmit the message to a downlink switch, which may result in low message transmission efficiency.
In order to improve the message transmission efficiency, each member device in the stacking device in the embodiment of the present application configures a VLAN value for identifying an interface for each of its own interfaces, which is different from a case where a plurality of interfaces may be divided into the same service VLAN (that is, a plurality of interfaces have the same VLAN value) in the prior art, where the VLAN value related to the present application is used to distinguish the interfaces, and different interfaces have different VLAN values. In the embodiment of the present application, when each member device enables a stacking port, each member device may bind the stacking port itself to a VLAN value used for identifying each local interface, for example: when a stacking port between a first member device and a second member device is enabled, the first member device may bind the stacking port to a VLAN value for identifying each interface of the first member device, and the second member device may bind the stacking port to a VLAN value for identifying each interface of the second member device.
Based on the forwarding principle of the switching chip, after a message is received through a certain interface, the message can be forwarded to other interfaces with the same VLAN value as the interface, and the configuration can realize that when one member device receives the message carrying the VLAN value through the stacking port, the VLAN value is bound with the stacking port necessarily, so that the switching chip can forward the message to the outgoing interface corresponding to the VLAN value, and further forward the message through the outgoing interface.
Based on the above configuration, in the embodiment of the present application, after a first member device receives a first message, when it is determined that an egress interface for sending the message is located in a second member device, a first VLAN value bound to the egress interface and a second VLAN value bound to a stack port may be obtained, the first VLAN value and the second VLAN value are encapsulated to a message header of the first message to obtain a first encapsulated message, then the first encapsulated message is transmitted to the stack port according to the second VLAN value, a second VLAN value included in the first encapsulated message is deleted to obtain a second encapsulated message, the second encapsulated message is sent to the member device through the stack port, and then the second member device may determine an interface through the first VLAN value included in the second encapsulated message, that is, the first VLAN value may be deleted, the first message is forwarded through the egress interface, because the second encapsulated message received by the second member device includes the first VLAN value, the second member device can directly transmit the message through the output interface corresponding to the first VLAN value of the exchange chip, and the exchange chip is hardware-transmitted, so that the message is not transmitted to the CPU of the device, the second member device does not need to process the message, but directly transmits the message, and the transmission efficiency of the message can be improved.
The following describes a method for forwarding a packet according to an embodiment of the present application with a specific embodiment.
The embodiment of the application can be applied to a networking environment with stacked equipment, and messages can be transmitted between member equipment of the stacked equipment through the stacked port.
Each member device in the stacking device is a device having a message transparent transmission function, and may be, for example, a firewall, a switch, or a router.
Taking the application scenario shown in fig. 1 as an example, when a link in a stacking device fails, the transmission conditions of a packet at least include the following two conditions:
the first condition is as follows: when the link 2 fails, or the link 3 fails, or both the link 2 and the link 3 fail, the uplink switch sends the message to the member device 1 through the link 1, the member device 1 transparently transmits the message to the member device 2, and the member device 2 sends the message to the downlink switch through the link 4.
Case two: when the link 1 fails or the link 4 fails or both the link 1 and the link 4 fail, the uplink switch sends the message to the member device 2 through the link 2, the member device 2 transparently transmits the message to the member device 1, and the member device 1 sends the message to the downlink switch through the link 3.
With reference to fig. 1, an embodiment of the present application provides a method for forwarding a packet, where the method is applied to a first member device in a stacking device, and the stacking device further includes a second member device connected to the first member device through a stacking port, where the first member device may be a member device 1 or a member device 2 in fig. 1, and correspondingly, the second member device is a member device 2 or a member device 1 in fig. 1. The following description will be given taking an example in which the member device 1 is a first member device and the member device 2 is a second member device. As shown in fig. 2, the method is specifically as follows.
S201, receiving a first message by a first member device, when an outlet interface of the first message sent by a stacking device is determined to be located in a second member device, obtaining a first VLAN value bound with the outlet interface and a second VLAN value bound with the stacking interface, and packaging the first VLAN value and the second VLAN value to a message header of the first message to obtain a first packaged message.
In the system initialization process, the first member device configures a VLAN value for identifying each interface, and similarly, the second member device configures a VLAN value for identifying each interface.
Illustratively, if there are 8 interfaces on the switch chip of the first member device, the VLAN values of the 8 interfaces may be configured to be 1 to 8, respectively. Similarly, if there are 8 interfaces on the switch chip of the second member device, the VLAN values of the 8 interfaces may be configured to be 1 to 8, respectively. The above configuration is merely an example, and in practical implementation, the configuration of the VLAN value of each interface is not limited thereto, and the configuration principle is that each member device configures a different VLAN value for each interface of itself. In addition, when the system is initialized, a logical index value can be configured for the interface of each member device, so that the corresponding interface can be conveniently found through the logical index value.
The first member device comprises a hardware layer, a driving layer and a platform layer, wherein the hardware layer is a switching chip of the first member device, the switching chip can send the first message to the driving layer after receiving the first message, the driving layer sends the first message to the platform layer, a service module in the platform layer can identify and process the first message, and when the service module determines that an outgoing interface of the first message is located in the second member device, the first member device can obtain a first VLAN value bound with the outgoing interface and a second VLAN value bound with the stacking interface.
Since the information of the interface state, the interface identifier (for example, a logical index value of the interface), the forwarding table, and the routing table of each member device in the stacking device are synchronized with each other, it can be implemented that the first member device can determine which member device the outgoing interface of the first packet is on according to the stored information. Optionally, the service module may determine, according to the forwarding table entry, an interface number of an egress interface used for sending the first packet, or determine, according to the load balancing policy, an interface number of an egress interface used for sending the first packet, and the application is not limited to the manner of determining the egress interface of the first packet.
Specifically, when the stacking port between the first member device and the second member device is enabled, the first member device and the second member device may synchronize interface information of each interface thereof with each other, where the interface information includes an interface state, an interface number, and a logical index value corresponding to the interface number.
The first member device may calculate the VLAN value of each interface of the second member device according to the interface number of the second member device, and a method of calculating the VLAN value of each interface of the second member device by the first member device is the same as a method of configuring the VLAN value of each interface of the second member device by the second member device.
As an example, an interface number may be composed of a slot (slot number), a subslot (subslot number), and a port (interface number), and a VLAN value corresponding to the interface number may be:
VLAN=slot*28+subslot*24+port+stratIndex
wherein, the StartIndex is a preset starting index value.
Of course, the VLAN value calculation method in this embodiment is not limited to this, and other methods that can generate different VLAN values for different interfaces may also be applied to this embodiment.
Through the above calculation, the first member device may determine the correspondence between the interface number of the second member device-the VLAN value or the interface number-the logical index value-the VLAN value.
Therefore, the first member device may obtain a target logical index value corresponding to the interface number of the interface according to the correspondence between the interface number of each interface of the second member device and the logical index value, and search for the first VLAN value for identifying the interface corresponding to the target logical index value.
After the service module of the platform layer of the first member device determines the interface number of the interface, a target logical index value corresponding to the interface number of the interface can be determined according to the corresponding relationship between the interface number and the logical index value, and then the target logical index value is issued to the driving layer, and the driving layer can search a first VLAN value which is used for identifying the interface and corresponds to the target logical index value according to the corresponding relationship between the logical index value and the VLAN value.
In addition, the driver layer may also determine a target interface on the first member device as a stacking port, and obtain a second VLAN value for identifying the target interface.
For example, if the egress interface is interface 1 of the second member device, the first VLAN value may be determined to be 1, and if the target interface on the first member device that is the stacking port is interface 3, the second VLAN value may be determined to be 3.
The driving layer of the first member device can package the first VLAN value and the second VLAN value in the two-layer message header of the first message, and the format of the first packaged message obtained after packaging can be 'destination MAC address', 'source MAC address', 'second VLAN value', 'first VLAN value', 'protocol type', 'data part').
Optionally, if the first member device determines that the first packet needs to be transmitted via the local device, the first packet is forwarded to the downlink switch.
S202, the first member device determines a stacking port for transmitting the first packaging message according to the second VLAN value.
After the first package message is obtained at the driver layer of the first member device, the first package message can be transmitted to the switch chip, the switch chip can identify the outermost VLAN value in the first package message, that is, the second VLAN value, and the switch chip can determine that the second VLAN value is the VLAN value of its own stack port, and then determine that the first package message can be transmitted through the stack port.
S203, the first member device deletes a second VLAN value included in the first packaging message to obtain a second packaging message, the second packaging message is sent to the second member device through the stacking port, so that the second member device determines an interface through the first VLAN value, the first VLAN value included in the second packaging message is deleted to obtain a first message, and the first message is forwarded.
Specifically, after the switching chip of the first member device determines that the first encapsulation message can be transmitted through the stacking port, the second VLAN value in the first encapsulation message may be deleted, and the format of the obtained second encapsulation message may be "[ destination MAC address ] [ source MAC address ] [ first VLAN value ] [ protocol type ] [ data portion ]".
And then the switching chip of the first member device can send the second encapsulated message to the second member device through the stacking port, and after receiving the second encapsulated message through the stacking port, the switching chip of the second member device can identify a first VLAN value included in the second encapsulated message.
It should be noted that, since the switch chip of the second member device determines that the first VLAN value carried in the second encapsulation message is bound to the stack port, the switch chip may forward the first message through the output interface corresponding to the first VLAN value, and the second encapsulation message does not need to be sent to the driver layer and the platform layer of the second member device, but only needs to be forwarded on the hardware layer of the switch chip.
When the first member device enables the stacking port, the stacking port may be bound with a VLAN value identifying each interface of the first member device. Therefore, if the first member device receives the message carrying the VLAN value through the stacking port, if the switching chip of the first member device determines that the VLAN value is bound with the stacking port, the message can be forwarded through the interface corresponding to the VLAN value.
Accordingly, when the first member device deletes the stack port, the first member device may release the binding relationship between the VLAN values of the interfaces of the stack port and the second member device.
Similarly, when the second member device enables a stacking port, the stacking port may be bound with a VLAN value identifying each interface of the second member device. When the second member device deletes the stack port, the binding relationship between the stack port and the VLAN value for identifying each interface of the first member device may be released.
In the message forwarding method provided in this embodiment of the present application, after a first member device receives a first message, if it is determined that an egress interface of a stacking device, which sends the first message, is located in a second member device, a first VLAN value bound to the egress interface and a second VLAN value bound to a stacking port may be obtained, and the first VLAN value and the second VLAN value are encapsulated to a message header of the first message to obtain a first encapsulated message, so that the first member device may transmit a second encapsulated message through the stacking port corresponding to the second VLAN value, after the second member device receives the second encapsulated message carrying the first VLAN value, a switch chip of the second member device may directly determine an interface according to the first VLAN value, and forward the first message through the egress interface, thereby implementing that the second member device directly forwards the message through a hardware layer corresponding to the switch chip, without identifying specific content of the message and processing the message, the transmission efficiency of the message can be improved.
It can be understood that, if the second member device receives the second message and determines that the egress interface of the stacking device, which sends the second message, is located in the first member device, the third VLAN value bound to the egress interface and the fourth VLAN value bound to the stacking interface may also be obtained, and the third VLAN value and the fourth VLAN value are encapsulated to the message header of the second message, so as to obtain a third encapsulated message.
For example, the third encapsulated packet may be in the format "[ destination MAC address ] [ source MAC address ] [ fourth VLAN value ] [ third VLAN value ] [ protocol type ] [ data part ])"
The second member device may then determine a stacking port for transmitting the third encapsulated message based on the fourth VLAN value.
And then deleting a fourth VLAN value included in the third encapsulation message to obtain a fourth encapsulation message.
For example, the fourth encapsulating packet may be in the format "[ destination MAC address ] [ source MAC address ] [ third VLAN value ] [ protocol type ] [ data part ])"
And the second member equipment can send the fourth encapsulated message to the first member equipment through the stacking port, so that the first member equipment determines an interface through a third VLAN value, deletes the third VLAN value included in the fourth encapsulated message, obtains a second message, and forwards the second message.
Corresponding to the embodiment shown in fig. 2, an embodiment of the present application further provides a message forwarding method, where the method is applied to a second member device in a stacking device, where the stacking device further includes a first member device connected to the second stacking device through a stacking port, where the first member device may be the member device 1 or the member device 2 in fig. 1, and correspondingly, the second member device is the member device 2 or the member device 1 in fig. 1. The following description will be given taking an example in which the member device 1 is a first member device and the member device 2 is a second member device. As shown in fig. 3, the method is specifically as follows.
S301, the second member device receives a second encapsulation message sent by the first member device through the stacking port, wherein the second encapsulation message comprises a first VLAN value.
Optionally, the second member device may configure a VLAN value for each interface of the second member device to identify the interface. The first VLAN value included in the second encapsulation message received by the second component device is a VLAN value used to identify one of the interfaces of the second component device.
S302, the second member device judges whether the VLAN value bound with the stacking port comprises a first VLAN value.
When the stacking port is enabled, the second member device will bind the stacking port to the VLAN value used to identify each interface of the second member device. Accordingly, when the stack port is deleted, the second member device releases the binding relationship between the stack port and the VLAN value for identifying each interface of the second member device.
Therefore, if the first VLAN value is a VLAN value for identifying an interface of the second member device, the second member device may determine that the VLAN value bound to the stack port includes the first VLAN value.
S303, if the VLAN value bound with the stacking port comprises the first VLAN value, determining the interface through the first VLAN value, and deleting the first VLAN value included in the second packaging message to obtain the first message.
The second member device can determine the output interface corresponding to the first VLAN value according to the corresponding relation between the interface number and the VLAN value, and the first VLAN value in the second encapsulated message can be deleted after the second member device determines the output interface used for transmitting the message on the switching chip of the second member device.
S304, the second member device forwards the first message through the output interface.
It can be understood that the switching chip of the second member device may forward the first message through its own outgoing interface.
By adopting the message forwarding method provided by the embodiment of the application, after the second member device receives the second encapsulated message sent by the first member device through the stacking port, if the first VLAN value is determined to exist in the VLAN value bound to the stacking port, the outgoing interface corresponding to the first VLAN value can be determined, the first VLAN value included in the second encapsulated message is deleted, the first message is obtained, and the first message is forwarded through the outgoing interface.
Optionally, the embodiment of the present application may also be applied to a scenario in which the stacking device includes two or more member devices, and the stacking device may include a first member device and at least one second member device, where the first member device is a device for receiving a message sent by an external device, and the second member device is a device for sending a message to the external device, or the second member device is a member device except for the first member device and the device for sending a message to the external device. Here, the external device here refers to a device other than the member devices constituting the stacked device. Taking fig. 4 as an example, assuming that the member device 1 is a device for sending a message to an external device, and the member device 3 is a device for sending a message to an external device, the member device 1 is a first member device, and both the member devices 2 and 3 are second member devices.
Based on the foregoing scenario, an embodiment of the present application further provides a message forwarding method, which is applied to a first member device in a stacking device, and the method specifically includes the following steps:
step one, receiving a first message, and when determining that an output interface of the stacking equipment for sending the first message is not located in the member equipment, determining a transmission path for sending the first message to the output interface, wherein the transmission path comprises second member equipment passing through in sequence.
After the first member device receives the first message, if the link failure for forwarding the first message to the external device is determined, the state of the output interface used for connecting the external device by other member devices in the stacking device can be determined. After the stacking technology is adopted, each member device in the stacking device is used as one device, and the first member device can acquire the interface information and the interface state of each other member device in the stacking device.
If the first component device determines that the output interface of the second component device connected via its own stack port is available, the transmission path may be determined to be the first component device — the second component device connected to the first component device. Taking fig. 4 as an example, assuming that an interface (i.e., an outgoing interface) for connecting the member device 2 with the downstream switch is available, the member device 1 may determine that the transmission path is member device 1 → member device 2 → the downstream switch.
If it is determined that an egress interface of a second member device connected to the stacking port of the first member device is not available, it may be determined whether an egress interface of another second member device connected to the second member device through the stacking port is available. If available, the transmission path may be determined to be a first member device-a first second member device coupled to the first member device-a second member device coupled to the first second member device. Taking fig. 4 as an example, assuming that the interface (i.e., the outgoing interface) of the member device 2 connected to the downstream switch is not available and the interface (i.e., the outgoing interface) of the member device 3 connected to the afternoon switch is available, the member device 1 may determine that the transmission path is member device 1 → member device 2 → member device 3 → the downstream switch.
And step two, acquiring a first VLAN value bound with the output interface and a second VLAN value bound with a stacking port of each member device for sending messages, and packaging the first VLAN value and each second VLAN value to a message header of the first message according to a transmission path to obtain a first packaged message.
The first VLAN value is a VLAN value of an outgoing interface of the last member device connected to the external device in the transmission path.
And after the first VLAN value and each second VLAN value are encapsulated to the message header of the first message according to the transmission path, the outermost VLAN value in the first encapsulated message is the second VLAN value of the stacking port of the first member equipment, and the innermost VLAN value is the first VLAN value.
For example, if the transmission path is a first member device-a first second member device connected to the first member device-a second member device connected to the first second member device. The VLAN values of the first encapsulation packet encapsulated from outside to inside are sequentially: the second VLAN value of the stacking port of the first member device, the second VLAN value of the stacking port of the first second member device, which is used for connecting the second member device, and the first VLAN value of the outgoing interface of the second member device.
Taking fig. 4 as an example, assuming that the interface (i.e., the outgoing interface) of the member device 2 connected to the downstream switch is not available, and the interface (i.e., the outgoing interface) of the member device 3 connected to the afternoon switch is available, the member device 1 may determine that the transmission path is the member device 1 → the member device 2 → the member device 3 → the downstream switch, and then the first VLAN value is the VLAN value 1 of the outgoing interface of the member device 3, and each of the second VLAN values is the VLAN value 3 of the stacking port 1 of the member device 1 and the VLAN value 2 of the stacking port 2 of the member device 2, respectively. Assuming that the format of the first message is ' destination MAC address ', ' source MAC address ', ' protocol type ', ' data part ', ' each VLAN value is encapsulated to the message header of the first message according to the transmission path, and the format of the obtained first encapsulated message is ' destination MAC address ', ' source MAC address ', ' VLAN value 3 ', ' VLAN value 2 ', ' VLAN value 1 ', ' protocol type ', ' data part '.
And step three, determining a first stacking port, which is used by the first member device to be connected with the first second member device in the transmission path, according to the first second VLAN value in the first encapsulation message.
And the first second VLAN value is the VLAN value of the outermost layer of the first encapsulation message.
And fourthly, deleting a first second VLAN value included in the first encapsulation message to obtain a second encapsulation message, and sending the second encapsulation message to a first second member device in the transmission path through the first stack port.
After receiving the second encapsulation message, the first second member device may determine an interface for transmitting the message according to the outermost VLAN value in the second encapsulation message, delete the outermost VLAN value in the second encapsulation message, and transmit the message through the determined interface.
It can be understood that, if the first second component device is not the last component device in the transmission path, the determined interface for transmitting the message is a stacking port connected to the second component device, and after the VLAN value at the outermost layer in the second encapsulated message is deleted, the message can be transmitted to the second component device through the stacking port. And if the first second member device is the last member device in the transmission path, determining that the interface for transmitting the message is an outgoing interface.
In a scenario where the stacking device includes more than two member devices, corresponding to the previous embodiment, an embodiment of the present application further provides a packet forwarding method, which is applied to a second member device in the stacking device, and the method specifically includes the following steps:
step one, receiving a third encapsulation message through a local first stack port. The third encapsulated message comprises a first VLAN value and a second VLAN value bound with a stacking port of each member device in the transmission path for sending the message, and the first VLAN value is bound with an outgoing interface of the member device in the transmission path for finally receiving the message. The output interface may be connected to an external device.
And the VLAN value of the outermost layer in the third encapsulation message is the VLAN value of the stacking port on the second member device and used for connecting the next member device. The innermost VLAN value in the third encapsulation message is the first VLAN value. The local first stacking port is connected to a member device on the transmission path. Taking the networking shown in fig. 4 as an example, assuming that the second member device is the member device 2, the local first stacking port is the stacking port on the member device 2 connected to the stacking port 1 on the member device 1.
And step two, determining a second stacking port used by the second member device to be connected with the next member device in the transmission path according to the first second VLAN value included in the third encapsulation message. Taking the networking shown in fig. 4 as an example, assuming that the second member device is the member device 2, the second stacking port is the stacking port 2 of the member device 2 connected to the stacking port of the member device 3.
The first second VLAN value is an outermost second VLAN value in the third encapsulation message.
And step three, deleting a first second VLAN value included in the third encapsulation message to obtain a fourth encapsulation message, and sending the fourth encapsulation message to the next member device in the transmission path through the second stacking port, so that the next member device in the transmission path transmits the fourth encapsulation message according to the first second VLAN value or the first VLAN value in the fourth encapsulation message.
If the next member device in the transmission path is the last member device in the transmission path, the fourth encapsulated message only includes the first VLAN value, and after receiving the fourth encapsulated message, the member device can determine the interface according to the first VLAN value, delete the first VLAN value in the fourth encapsulated message, obtain the first message, and forward the first message through the outgoing interface. This process can be explained with particular reference to the related embodiment referred to in fig. 3.
If the next member device in the transmission path is not the last member device in the transmission path, the member device may determine the stacking port according to the second VLAN value at the outermost layer in the fourth encapsulation message, delete the second VLAN value at the outermost layer in the fourth encapsulation message, obtain the fifth encapsulation message, and transmit the fifth encapsulation message to the next member device connected to the member device through the stacking port.
After each member device in the subsequent transmission path receives the encapsulation message, if the member device is not the last member device in the transmission path, the message can be transmitted according to the VLAN value at the outermost layer in the encapsulation message by the above method until the message is transmitted to the external device through the egress interface of the last member device in the transmission path. If the member device is the last member device in the transmission path, the message processing process may be specifically described with reference to the related embodiment shown in fig. 3.
It should be noted that, in a scenario where the stacking device includes more than two member devices, each member device in the stacking device configures a VLAN value for identifying an interface for each interface of the member device, and the first VLAN value and the second VLAN value in the above embodiment are both VLAN values for identifying interfaces.
When the stacking ports of the member devices are enabled, each member device binds the stacking port of the member device with the VLAN value used for identifying each interface of the member device. Correspondingly, if a member device deletes its own stacking port, the binding relationship between its own stacking port and the VLAN value for identifying each interface of the member device is released.
In the following description with reference to a specific example, as shown in fig. 4, taking the stacking device including three member devices as an example, if a link between the member device 1 and the downlink switch fails, links between the member device 2 and the uplink switch and links between the member device and the downlink switch both fail, in this scenario, after receiving a message (taking the message 1 as an example) sent by the uplink switch, the member device 1 may send the message 1 to the member device 2 through the stacking port 1, and then the member device 2 sends the message 1 to the member device 3 through the stacking port 2, and then the member device 3 sends the message to the downlink switch.
In order to avoid that the member device 2 and the member device 3 do not perform service level processing on the packet 1 after receiving the packet 1, the following method may be adopted in the embodiment of the present application to transmit the packet 1.
First, the member device 1, the member device 2, and the member device 3 configure each interface thereof with a VLAN value for identifying the interface. When the member devices 1 and 2 enable the stacking port 1 and the member devices 2 and 3 enable the stacking port 2, the member device 1 binds the VLAN value corresponding to each interface thereof to the stacking port 1, the member device 2 binds the VLAN value corresponding to each interface thereof to the stacking port 1 and the stacking port 2, and the member device 3 binds the VLAN value corresponding to each interface thereof to the stacking port 2. And the member device 1, the member device 2 and the member device 3 synchronize the corresponding relationship among the interface numbers and the logical index values with each other. And because the VLAN value calculation mode of each member device according to the interface number is the same, each member device can calculate the VLAN value of each interface in other member devices except the member device according to the synchronous interface number, and each member device can determine the corresponding relation between the interface number-VLAN value or the interface number-logical index value-VLAN value of other member devices except the member device.
Under the condition that both the stacking port 1 and the stacking port 2 are enabled, if the member device 1 receives the message 1 sent by the uplink switch, if the output interface of the message 1 sent by the stacking device is located at the member device 3, the VLAN value 1 bound with the output interface located at the member device 3, the VLAN value 2 bound with the stacking port 2 of the member device 2 and the VLAN value 3 bound with the stacking port 1 of the member device 1 are obtained, then the VLAN value 1, the VLAN value 2 and the VLAN value 3 are packaged to the message header of the message 1, and a packaged message A is obtained, wherein the format of the packaged message A is' destination MAC address ] [ source MAC address ] [ VLAN value 3] [ VLAN value 2] [ VLAN value 1] [ protocol type ] [ data part ] ".
The switching chip of the member device 1 can transmit the packaging message A to the stacking port 1 according to the VLAN value 3 in the packaging message A, and delete the VLAN value 3 in the packaging message A to obtain a packaging message B, wherein the format of the packaging message B is [ destination MAC address ] [ source MAC address ] [ VLAN value 1] [ protocol type ] [ data part ] ".
Then the switch chip of the member device 1 can send the package message B to the member device 2 through the stack port 1, after the switch chip of the member device 2 receives the package message B through the stack port 1, the switch chip can determine that the VLAN value bound with the stack port 1 includes the VLAN value 2 in the package message B, further determine the interface (i.e. the stack port 2) corresponding to the VLAN value 2, delete the VLAN value 2 in the package message B, and obtain a package message C, wherein the format of the package message C is [ destination MAC address ] [ source MAC address ] [ VLAN value ] [ 1] [ protocol type ] [ data part ] ".
Then the switching chip of the member device 2 can transparently transmit the encapsulated message C to the member device 3 through the stacking port 2, after the switching chip of the member device 3 receives the encapsulated message C through the stacking port 2, the VLAN value bound with the stacking port 2 can be determined to include the VLAN value 1 in the encapsulated message C, the output interface corresponding to the VLAN value 1 is determined to be the output interface connected to the downlink switch, the VLAN value 1 in the encapsulated message C is deleted, the message 1 can be obtained, and the message 1 is forwarded to the downlink switch through the output interface corresponding to the VLAN value 1.
In the above message transmission process, the member device 2 and the member device 3 only transmit the message through their respective switch chips, that is, only the transmission on the hardware layer is involved, and the member device 2 and the member device 3 do not process the message on the service layer, so that the message transmission efficiency can be improved.
Corresponding to the foregoing method embodiment, an embodiment of the present application further provides a message forwarding apparatus, which is applied to a first member device in a stacking device, where the stacking device further includes a second member device connected to the first member device through a stacking port, and as shown in fig. 5, the apparatus includes: a receiving module 501, an obtaining module 502, an encapsulating module 503, and a transmitting module 504.
A receiving module 501, configured to receive a first message;
an obtaining module 502, configured to obtain a first VLAN value bound to an egress interface and a second VLAN value bound to a stack interface when it is determined that the egress interface, through which the stack device sends the first packet, is located in the second member device;
an encapsulating module 503, configured to encapsulate the first VLAN value and the second VLAN value obtained by the obtaining module 502 to a packet header of the first packet, so as to obtain a first encapsulated packet;
a transmission module 504, configured to determine, according to a second VLAN value, the stacking port for transmitting the first encapsulation packet;
the encapsulating module 503 is further configured to delete the second VLAN value included in the first encapsulated packet, so as to obtain a second encapsulated packet;
the transmission module 504 is further configured to send the second encapsulated packet to the second member device through the stack port, so that the second member device determines the interface through the first VLAN value, deletes the first VLAN value included in the second encapsulated packet, obtains the first packet, and forwards the first packet.
Optionally, the apparatus further comprises: and configuring the module.
A configuration module, configured to configure a VLAN value for identifying an interface for each interface of the member device.
Optionally, the apparatus further comprises: and a binding module.
The binding module is used for binding the stacking port with the VLAN value used for identifying each interface of the member device when the stacking port is enabled; and/or
When deleting the stack port, the binding relationship between the stack port and the VLAN value used for identifying each interface of the member device is released.
Optionally, the obtaining module 502 is specifically configured to:
acquiring a target logical index value corresponding to the interface number of the interface according to the stored corresponding relation between the interface number of each interface of the second member device and the logical index value, and searching a first VLAN value which is corresponding to the target logical index value and is used for identifying the interface;
and determining a target interface serving as a stacking port on the first member device or serving as the first stacking port on the second member device, and acquiring a second VLAN value for identifying the target interface.
Corresponding to the foregoing method embodiment, an embodiment of the present application further provides another packet forwarding apparatus, which is applied to a second member device in a stacking device, and as shown in fig. 6, the apparatus includes: a receiving module 601, a judging module 602, a deleting module 603 and a transmitting module 604.
A receiving module 601, configured to receive a second encapsulated packet through the stack port, where the second encapsulated packet includes a first VLAN value;
a determining module 602, configured to determine whether a VLAN value bound to a stack port includes a first VLAN value;
a deleting module 603, configured to determine an interface through the first VLAN value if the determination result of the determining module 602 is yes, and delete the first VLAN value included in the second encapsulation packet to obtain a first packet;
the transmission module 604 is configured to forward the first packet through the egress interface.
Optionally, the apparatus further comprises: and configuring the module.
And the configuration module is used for configuring a VLAN value for identifying the interface for each interface of the member device.
Optionally, the apparatus further comprises: and a binding module.
The binding module is used for binding the stacking port with a VLAN value used for identifying each interface of the member equipment when the stacking port is enabled;
when deleting the stack port, removing the binding relation between the stack port and the VLAN value used for identifying each interface of the member device.
In a scenario where the stacking device includes more than two member devices, an embodiment of the present application further provides another packet forwarding apparatus, which is applied to a first member device in the stacking device, and as shown in fig. 7, the apparatus includes: a receiving module 701, a determining module 702, an obtaining module 703, an encapsulating module 704, and a sending module 705.
A receiving module 701, configured to receive a first packet;
a determining module 702, configured to determine, when it is determined that an egress interface, through which the stacking device sends the first packet, is not located in the member device, a transmission path, through which the first packet is sent to the egress interface, where the transmission path includes second member devices that pass through in sequence;
an obtaining module 703, configured to obtain a first VLAN value bound to an egress interface and a second VLAN value bound to a stacking port through which each member device sends a packet;
an encapsulating module 704, configured to encapsulate the first VLAN value and each second VLAN value to a packet header of the first packet according to a transmission path, so as to obtain a first encapsulated packet;
a determining module 702, configured to determine, according to a first second VLAN value in the first encapsulation message, a first stacking port, where the first component device is used to connect to a first second component device in the transmission path;
the encapsulating module 704 is further configured to delete a first second VLAN value included in the first encapsulated packet, so as to obtain a second encapsulated packet;
a sending module 705, configured to send the second encapsulation packet to the first second member device through the first stack port.
In a scenario where the stacking device includes more than two member devices, an embodiment of the present application further provides another packet forwarding apparatus, which is applied to a second member device in the stacking device, where as shown in fig. 8, the apparatus includes: a receiving module 801, a determining module 802, an encapsulating module 803, and a sending module 804.
A receiving module 801, configured to receive a third encapsulated packet through a local first stacking port, where the third encapsulated packet includes a first VLAN value and a second VLAN value bound to a stacking port of each member device in a transmission path, where the first VLAN value is bound to an egress interface of a member device in the transmission path that last receives the packet;
a determining module 802, configured to determine, according to a first second VLAN value included in the third encapsulation packet, a second stacking port, which is used by the second component device to connect to a next component device in the transmission path;
the encapsulating module 803 is configured to delete the first second VLAN value included in the third encapsulating packet, so as to obtain a fourth encapsulating packet;
the sending module 804 is configured to send the fourth encapsulated packet to the next member device in the transmission path through the second stacking port, so that the next member device in the transmission path transmits the fourth encapsulated packet according to the first second VLAN value or the first VLAN value in the fourth encapsulated packet.
The embodiment of the present application further provides an electronic device, which may be the first member device or the second member device in the foregoing embodiments, as shown in fig. 9, including a processor 901, a communication interface 902, a memory 903, and a communication bus 904, where the processor 901, the communication interface 902, and the memory 903 complete mutual communication through the communication bus 904,
a memory 903 for storing computer programs;
the processor 901 is configured to implement the steps executed by the first component device or the second component device in the above method embodiment when executing the program stored in the memory 903.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment provided by the present application, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the message forwarding methods described above.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the message forwarding methods in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (13)

1. A message forwarding method is applied to a first member device in a stacking device, wherein the stacking device further comprises a second member device connected with the first member device through a stacking port, and the method comprises the following steps:
the method comprises the steps that first member equipment receives a first message, when an outlet interface of the stacking equipment for sending the first message is determined to be located on second member equipment, a first VLAN value bound with the outlet interface and a second VLAN value bound with the stacking interface are obtained, and the first VLAN value and the second VLAN value are packaged to a message header of the first message to obtain a first packaged message;
determining the stacking port for transmitting the first packaging message according to the second VLAN value;
deleting a second VLAN value included in the first encapsulation message to obtain a second encapsulation message, sending the second encapsulation message to the second member device through the stacking port so that the second member device determines the outlet port through the first VLAN value, deleting the first VLAN value included in the second encapsulation message to obtain the first message, and forwarding the first message.
2. A message forwarding method is applied to a first member device in a stacking device, and the method comprises the following steps:
receiving a first message, and when determining that an outgoing interface of the stacking equipment for sending the first message is not located in the member equipment, determining a transmission path for sending the first message to the outgoing interface, wherein the transmission path comprises second member equipment which sequentially passes through the transmission path;
acquiring a first VLAN value bound with the output interface and a second VLAN value bound with a stacking port of each member device for sending messages, and encapsulating the first VLAN value and each second VLAN value to a message header of the first message according to a transmission path to obtain a first encapsulated message;
determining a first stacking port, used by the first member device to be connected with a first second member device in the transmission path, according to a first second VLAN value in the first encapsulation message;
and deleting a first second VLAN value included in the first encapsulation message to obtain a second encapsulation message, and sending the second encapsulation message to the first second member device through the first stack port.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
and the first member equipment configures a VLAN value for identifying the interface for each interface of the first member equipment.
4. The method of claim 1, wherein the first VLAN value and the second VLAN value are obtained by:
when the stack port of the member device is enabled, the stack port of the member device is bound with a VLAN value used for identifying each interface of the member device; and/or
When deleting the stack port of the member device, removing the binding relationship between the stack port of the member device and the VLAN value for identifying each interface of the member device;
acquiring a target logical index value corresponding to the interface number of the outgoing interface according to the stored corresponding relation between the interface number of each interface of the second member device and the logical index value, and searching a first VLAN value which is corresponding to the target logical index value and is used for identifying the outgoing interface;
and determining a target interface serving as the stacking port on the first member device or serving as the stacking port on the second member device, and acquiring a second VLAN value for identifying the target interface.
5. The method of claim 2, wherein the first VLAN value and the second VLAN value are obtained by:
when the stack port of the member device is enabled, the stack port of the member device is bound with a VLAN value used for identifying each interface of the member device; and/or
When deleting the stack port of the member device, removing the binding relationship between the stack port of the member device and the VLAN value for identifying each interface of the member device;
acquiring a target logical index value corresponding to the interface number of the outgoing interface according to the stored corresponding relation between the interface number of each interface of the second member device and the logical index value, and searching a first VLAN value which is corresponding to the target logical index value and is used for identifying the outgoing interface;
and determining a target interface serving as the first stacking port on the first member device or serving as the first stacking port on the second member device, and acquiring a second VLAN value for identifying the target interface.
6. A message forwarding method is applied to a second member device in a stacking device, and the method comprises the following steps:
receiving a second encapsulation message through a stacking port, wherein the second encapsulation message comprises a first VLAN value;
judging whether the VLAN value bound with the stacking port comprises the first VLAN value or not;
if so, determining an interface through the first VLAN value, and deleting the first VLAN value included in the second encapsulation message to obtain a first message;
and forwarding the first message through the output interface.
7. A message forwarding method is applied to a second member device in a stacking device, and the method comprises the following steps:
receiving a third package message through a local first stack port, wherein the third package message comprises a first VLAN value and a second VLAN value bound with the stack port of each member device sending a message in a transmission path, and the first VLAN value is bound with an output interface of the member device which receives the message in the transmission path at last;
determining a second stacking port, used by the second member device to connect with a next member device in a transmission path, according to a first second VLAN value included in the third encapsulation message;
and deleting a first second VLAN value included in the third encapsulated message to obtain a fourth encapsulated message, and sending the fourth encapsulated message to the next member device in the transmission path through the second stacking port, so that the next member device in the transmission path transmits the fourth encapsulated message according to the first second VLAN value or the first VLAN value in the fourth encapsulated message.
8. The method according to claim 6 or 7, characterized in that the method further comprises:
and the second member equipment configures a VLAN value for identifying the interface for each interface of the second member equipment.
9. The method according to claim 6 or 7, characterized in that the method further comprises:
when the stack port of the member device is enabled, the stack port of the member device is bound with a VLAN value used for identifying each interface of the member device;
and when the stack port of the member device is deleted, removing the binding relationship between the stack port of the member device and the VLAN value for identifying each interface of the member device.
10. A message forwarding apparatus is applied to a first member device in a stacking device, the stacking device further includes a second member device connected to the first member device through a stacking port, the apparatus includes:
the receiving module is used for receiving the first message;
an obtaining module, configured to obtain, when it is determined that an egress interface, to which the first packet is sent by the stacking device, is located in the second member device, a first VLAN value bound to the egress interface and a second VLAN value bound to the stacking interface;
the encapsulation module is used for encapsulating the first VLAN value and the second VLAN value acquired by the acquisition module to a message header of the first message to obtain a first encapsulated message;
a transmission module, configured to determine, according to the second VLAN value, the stacking port for transmitting the first encapsulation packet;
the encapsulation module is further configured to delete a second VLAN value included in the first encapsulation packet, so as to obtain a second encapsulation packet;
the transmission module is further configured to send the second encapsulated packet to a second member device through the stacking port, so that the second member device determines the outgoing interface through the first VLAN value, deletes the first VLAN value included in the second encapsulated packet, obtains the first packet, and forwards the first packet.
11. A message forwarding apparatus, applied to a second member device in a stacking device, the apparatus comprising:
the receiving module is used for receiving a second packaging message through the stacking port, wherein the second packaging message comprises a first VLAN value;
the judging module is used for judging whether the VLAN value bound with the stacking port comprises the first VLAN value or not;
a deleting module, configured to determine an interface through the first VLAN value if the determination result of the determining module is yes, and delete the first VLAN value included in the second encapsulated packet to obtain a first packet;
and the transmission module is used for forwarding the first message through the output interface.
12. A message forwarding apparatus, applied to a first member device in a stacking device, the apparatus comprising:
the receiving module is used for receiving the first message;
the determining module is used for determining a transmission path for sending the first message to an outgoing interface when it is determined that the outgoing interface for sending the first message by the stacking equipment is not located in the member equipment, and the transmission path comprises second member equipment which sequentially passes through the transmission path;
the acquisition module is used for acquiring a first VLAN value bound with the output interface and a second VLAN value bound with a stacking port of each member device for sending messages;
the encapsulation module is used for encapsulating the first VLAN value and each second VLAN value to a message header of the first message according to a transmission path to obtain a first encapsulated message;
the determining module is further configured to determine, according to a first second VLAN value in the first encapsulation message, a first stacking port, which is used by the first component device to connect to a first second component device in the transmission path;
the encapsulation module is further configured to delete a first second VLAN value included in the first encapsulation packet, so as to obtain a second encapsulation packet;
and the sending module is used for sending the second packaging message to the first second member device through the first stacking port.
13. A message forwarding apparatus, applied to a second member device in a stacking device, the apparatus comprising:
the receiving module is used for receiving a third encapsulated message through a local first stacking port, wherein the third encapsulated message comprises a first VLAN value and a second VLAN value bound with the stacking port of each member device sending the message in the transmission path, and the first VLAN value is bound with the output interface of the member device which receives the message in the transmission path at last;
a determining module, configured to determine, according to a first second VLAN value included in the third encapsulation packet, a second stacking port, where the second component device is used for connecting with a next component device in a transmission path;
the encapsulation module is used for deleting a first second VLAN value included in the third encapsulation message to obtain a fourth encapsulation message;
and the sending module is used for sending the fourth encapsulated message to the next member device in the transmission path through the second stacking port so that the next member device in the transmission path transmits the fourth encapsulated message according to the first second VLAN value or the first VLAN value in the fourth encapsulated message.
CN201811442790.3A 2018-11-29 2018-11-29 Message forwarding method and device Active CN109587027B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811442790.3A CN109587027B (en) 2018-11-29 2018-11-29 Message forwarding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811442790.3A CN109587027B (en) 2018-11-29 2018-11-29 Message forwarding method and device

Publications (2)

Publication Number Publication Date
CN109587027A CN109587027A (en) 2019-04-05
CN109587027B true CN109587027B (en) 2021-05-25

Family

ID=65925250

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811442790.3A Active CN109587027B (en) 2018-11-29 2018-11-29 Message forwarding method and device

Country Status (1)

Country Link
CN (1) CN109587027B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6934292B1 (en) * 1999-11-09 2005-08-23 Intel Corporation Method and system for emulating a single router in a switch stack
US7093027B1 (en) * 2002-07-23 2006-08-15 Atrica Israel Ltd. Fast connection protection in a virtual local area network based stack environment
CN1866919A (en) * 2005-12-06 2006-11-22 华为技术有限公司 Service switching method based on VLAN stack
CN1925456A (en) * 2005-09-01 2007-03-07 中兴通讯股份有限公司 System and method for realizing multi-service stack virtual local area network and method of use thereof
CN103581274A (en) * 2012-08-09 2014-02-12 杭州华三通信技术有限公司 Message forwarding method and device in stacking system
CN106850385A (en) * 2017-01-18 2017-06-13 盛科网络(苏州)有限公司 The synchronous detection method of two-layer retransmitting table and device in pile system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6934292B1 (en) * 1999-11-09 2005-08-23 Intel Corporation Method and system for emulating a single router in a switch stack
US7093027B1 (en) * 2002-07-23 2006-08-15 Atrica Israel Ltd. Fast connection protection in a virtual local area network based stack environment
CN1925456A (en) * 2005-09-01 2007-03-07 中兴通讯股份有限公司 System and method for realizing multi-service stack virtual local area network and method of use thereof
CN1866919A (en) * 2005-12-06 2006-11-22 华为技术有限公司 Service switching method based on VLAN stack
CN103581274A (en) * 2012-08-09 2014-02-12 杭州华三通信技术有限公司 Message forwarding method and device in stacking system
CN106850385A (en) * 2017-01-18 2017-06-13 盛科网络(苏州)有限公司 The synchronous detection method of two-layer retransmitting table and device in pile system

Also Published As

Publication number Publication date
CN109587027A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
KR102579059B1 (en) Packet processing methods and devices, devices, and systems
EP3154227B1 (en) Packet transmission method, node, path management server and storage medium
CN105207873B (en) A kind of message processing method and device
US10439931B2 (en) Data packet processing method, service node, and delivery node
CN110022264B (en) Method for controlling network congestion, access device and computer readable storage medium
CN110999265B (en) Managing network connectivity between cloud computing service endpoints and virtual machines
CN110061914B (en) Message forwarding method and device
US10461958B2 (en) Packet transmission method and apparatus
CN112039796B (en) Data packet transmission method and device, storage medium and electronic equipment
CN112491701B (en) Message forwarding method and device
CN107948077B (en) Method and device for forwarding data message
CN111371634B (en) Communication method, device and system
CN110177010B (en) Link switching method and device
CN112788060A (en) Data packet transmission method and device, storage medium and electronic equipment
EP2880550A1 (en) Connection mesh in mirroring asymmetric clustered multiprocessor systems
US11166188B2 (en) Method for transmitting information, method for receiving information, PDCP entity, and computer storage medium
CN109600248B (en) Method and device for determining quality of service and storage medium
CN112187584B (en) Path fault detection method, system, server and storage medium
CN109587027B (en) Message forwarding method and device
CN111464443A (en) Message forwarding method, device, equipment and storage medium based on service function chain
CN108337182B (en) Report load sharing method and network equipment
US20180107504A1 (en) Setting method for server apparatus and server apparatus
CN113709016B (en) Communication system, communication method, communication apparatus, communication device, and storage medium
CN112840623A (en) Data message transmission method and node
CN115361337B (en) Communication method and system based on communication route and star network

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