CN114024902B - Method and device for forwarding stacked messages, electronic equipment and readable storage medium - Google Patents

Method and device for forwarding stacked messages, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN114024902B
CN114024902B CN202210005442.XA CN202210005442A CN114024902B CN 114024902 B CN114024902 B CN 114024902B CN 202210005442 A CN202210005442 A CN 202210005442A CN 114024902 B CN114024902 B CN 114024902B
Authority
CN
China
Prior art keywords
mac address
stack
port
mac
bit
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
CN202210005442.XA
Other languages
Chinese (zh)
Other versions
CN114024902A (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.)
Ziguang Hengyue Technology Co ltd
Original Assignee
Ziguang Hengyue Technology 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 Ziguang Hengyue Technology Co ltd filed Critical Ziguang Hengyue Technology Co ltd
Priority to CN202210005442.XA priority Critical patent/CN114024902B/en
Publication of CN114024902A publication Critical patent/CN114024902A/en
Application granted granted Critical
Publication of CN114024902B publication Critical patent/CN114024902B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • 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/24Multipath
    • H04L45/245Link aggregation, e.g. trunking

Abstract

The embodiment of the application provides a forwarding method and device of a stack message, electronic equipment and a readable storage medium, and relates to the technical field of network communication. The method comprises the following steps: receiving a stacked message sent by first equipment; packaging an active mac address and a destination mac address in the stack message; searching a target mac address in a pre-established mac forwarding table, and if the mac forwarding table comprises a reference mac address which is the same as the target mac address, determining a relay port corresponding to the reference mac address as a forwarding port; forwarding the stacked message to a stacked port corresponding to a target mac address in the second device through a forwarding port; each reference mac address and a relay port corresponding to each reference mac address are recorded in the mac forwarding table; the stack port of the first device, the stack port of the second device, and the trunk port are all in the same vlan. According to the embodiment of the application, when the stacked message passes through the two-layer network, the vlan isolation is not needed to be carried out on the two-layer network equipment, so that the network deployment of the two-layer network equipment is more flexible.

Description

Method and device for forwarding stacked messages, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a method and an apparatus for forwarding a stack packet, an electronic device, and a readable storage medium.
Background
Stacking is to logically change a plurality of switches supporting stacking characteristics into one device by connecting a plurality of switches together through a stacking line, and the core idea of the stacking is to connect a plurality of devices together through stacking ports, virtualize the devices into one 'distributed device' after necessary configuration. Stacking generally involves at least two stacking member devices, the stacking member devices form a stacking group, a stacking link is provided between the stacking member devices, what performs data interaction between the stacking member devices is a stacking message, the stacking message is a message generated by encapsulating a data message into an ethernet frame, and the ethernet frame includes a mac address.
In order to simplify the forwarding process of the stack message in the entire stack group, the stack ports of each stack member device in the stack group use the same mac address, that is, the source mac addresses of the data messages sent by each stack port of the same stack member device are the same, so that the forwarding process of the stack message can be simplified.
However, in a real environment, setting a vlan to a port of each stack member device actually sets a vlan to each link, setting a vlan to each link actually sets a vlan to each trunk port of the switch, and setting a vlan to each trunk port of the switch, the trunk port does not allow the vlan to pass stack messages for other vlans, and flexibility of intermediate two-layer network deployment is limited to a large extent.
Disclosure of Invention
The embodiment of the application provides a method and a device for forwarding a stacked message, an electronic device and a readable storage medium, which can solve the problem that the flexibility of deployment of an intermediate two-layer network is limited to a great extent. The technical scheme is as follows:
according to an aspect of the embodiments of the present application, a method for forwarding a stack packet is provided, where the method includes:
receiving a stacked message sent by first equipment; packaging an active mac address and a destination mac address in the stack message;
searching a target mac address in a pre-established mac forwarding table, and if the mac forwarding table comprises a reference mac address which is the same as the target mac address, determining a relay port corresponding to the reference mac address as a forwarding port;
forwarding the stacked message to a stacked port corresponding to a target mac address in the second device through a forwarding port;
each reference mac address and a relay port corresponding to each reference mac address are recorded in the mac forwarding table;
the stack port of the first device, the stack port of the second device, and the trunk port are all in the same vlan.
In a possible implementation manner, before receiving the stack packet sent by the first device, the method further includes:
acquiring the number of links between first equipment and second equipment;
respectively determining a fixed bit and a variable bit of the mac address of each stack port of the first device and the second device according to the number of the links; the fixed bit refers to a bit with the same mac address of different stack ports of the same device; the change bit refers to a bit of the mac address change of different stack ports of the same device;
and respectively configuring the mac address for each stack port of the first device according to the fixed bit and the change bit of the mac address of each stack port of the first device, and respectively configuring the mac address for each stack port of the second device according to the fixed bit and the change bit of the mac address of each stack port of the second device.
In one possible implementation manner, determining the fixed bit and the variable bit of the mac address of each stack port of the first device and the second device according to the number of links includes:
determining the number of mac addresses required to be allocated to the stacking ports of the first device and the second device according to the number of the links;
determining the change bit of the mac address of each stack port of the first device and the second device according to the number of the mac addresses;
and determining fixed bits of the mac addresses of the stack ports of the first device and the second device according to the changed bits of the mac addresses of the stack ports of the first device and the second device.
In one possible implementation manner, configuring, according to the fixed bit and the changed bit of the mac address of each stack port of the first device, the mac address for each stack port of the first device, and configuring, according to the fixed bit and the changed bit of the mac address of each stack port of the second device, the mac address for each stack port of the second device includes:
respectively determining the value of a fixed bit and the value of a variable bit of a mac address of a stack port according to a preset rule for any stack port of first equipment or second equipment;
and combining the value of the fixed bit and the value of the variable bit to generate the mac address of the stack port.
In one possible implementation manner, before searching for the destination mac address in the pre-established mac forwarding table, the method further includes:
and extracting the fixed bit of the source mac address from the source mac address, and if the fixed bit of the source mac address is determined to be the unique identifier of the first device stored in advance, determining to acquire a pre-established mac forwarding table.
In one possible implementation, after searching a destination mac address in a pre-established mac forwarding table, the method includes:
and if the mac forwarding table does not comprise the reference mac address which is the same as the target mac address, broadcasting the stack message through other relay ports except the relay port for receiving the stack message.
In a possible implementation manner, after receiving the stack packet sent by the first device, the method further includes:
searching a source mac address in a pre-established mac forwarding table, and if the mac forwarding table does not comprise a reference mac address which is the same as the source mac address, determining the source mac address as a new reference mac address;
acquiring a relay port for receiving the stacked message, and determining the relay port for receiving the stacked message as a relay port corresponding to the new reference mac address;
and adding the new reference mac address and the relay port corresponding to the new reference mac address to the mac forwarding table.
According to another aspect of the embodiments of the present application, there is provided a forwarding apparatus for stack packets, the apparatus including:
the receiving module is used for receiving the stacking message sent by the first equipment; packaging an active mac address and a destination mac address in the stack message;
the searching module is used for searching a target mac address in a pre-established mac forwarding table, and if the mac forwarding table comprises a reference mac address which is the same as the target mac address, determining a relay port corresponding to the reference mac address as a forwarding port;
the forwarding module is used for forwarding the stacked message to a stacked port of the second device corresponding to the destination mac address through the forwarding port;
each reference mac address and a relay port corresponding to each reference mac address are recorded in the mac forwarding table;
the stack port of the first device, the stack port of the second device, and the trunk port are all in the same vlan.
According to another aspect of embodiments of the present application, there is provided an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method as provided in the first aspect when executing the program.
According to a further aspect of embodiments of the present application, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method as provided by the first aspect.
According to yet another aspect of embodiments of the present application, there is provided a computer program product comprising computer instructions stored in a computer-readable storage medium, which, when read by a processor of a computer device from the computer-readable storage medium, cause the processor to execute the computer instructions, so that the computer device performs the steps of implementing the method as provided by the first aspect.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
the embodiment of the application receives a stack message sent by first equipment; packaging an active mac address and a destination mac address in the stack message; searching a target mac address in a pre-established mac forwarding table, and if the mac forwarding table comprises a reference mac address which is the same as the target mac address, determining a relay port corresponding to the reference mac address as a forwarding port; forwarding the stacked message to a stacked port corresponding to a target mac address in the second device through a forwarding port; each reference mac address and a relay port corresponding to each reference mac address are recorded in the mac forwarding table; the stack port of the first device, the stack port of the second device, and the trunk port are all in the same vlan. According to the embodiment of the application, the relay port corresponding to the reference mac address which is the same as the source mac address can be inquired in the mac forwarding table, and the relay port is determined to be the forwarding port, so that the two-layer network can be effectively passed through, instead of implementing vlan isolation on each port on a stacking link, and the flexibility of deployment of the intermediate two-layer network is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
FIG. 1 is a schematic diagram of a stack according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a method for forwarding a stack packet according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating stacking of a first device and a second device provided in an embodiment of the present application;
fig. 4 is a schematic structural diagram of a forwarding apparatus for stacking packets according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the embodiments set forth below in connection with the drawings are exemplary descriptions for explaining technical solutions of the embodiments of the present application, and do not limit the technical solutions of the embodiments of the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should be further understood that the terms "comprises" and/or "comprising," when used in this specification in connection with embodiments of the present application, specify the presence of stated features, information, data, steps, operations, elements, and/or components, but do not preclude the presence or addition of other features, information, data, steps, operations, elements, components, and/or groups thereof, as embodied in the art. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein indicates at least one of the items defined by the term, e.g., "a and/or B" indicates either an implementation as "a", or an implementation as "a and B".
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Stacking is to logically change a plurality of switches supporting stacking characteristics into one device by connecting a plurality of switches together through a stacking line, and the core idea of the stacking is to connect a plurality of devices together through stacking ports, virtualize the devices into one 'distributed device' after necessary configuration. The virtual switching technology can be used for integrating hardware resources and software processing capacity of a plurality of devices, and realizing cooperative work, unified management and uninterrupted maintenance of the plurality of devices.
The vlan isolation technology divides a physically formed Local Area Network (LAN) into different logical subnets according to a specific strategy, isolates data link layer broadcast messages within the logical subnets to form respective broadcast domains, and each logical subnet is a Virtual Local Area Network (Virtual LAN). Each terminal device of the switch accessing and supporting the vlan belongs to a specific vlan, and the terminal devices in different vlans cannot directly communicate through a data link layer.
As shown in fig. 1, it exemplarily shows a structural diagram of an existing scheme stacking group, the stacking group includes two stacking member devices, which are a stacking member device 1 and a stacking member device 2, and a switch LSW (local area network switch) with a two-layer network in the middle, there are 4 stacking links between the stacking member device 1 and the stacking member device 2, the stacking member device 1 has four stacking ports, port1, port2, port3 and port4, the stacking member device 2 has four stacking ports, port1 'port 2', port3 'and port 4', and the LSW has four relay ports, port1 ", port 2", port3 ", port 4", port5 ", port 6", port7 "and port 8. As shown in fig. 1, port1, port1 ', port 5' and port1 'belong to the same link, port2, port 2', port6 'and port 2' belong to the same link, and other links are not described one by one.
In order to simplify the forwarding flow of the message, in the existing scheme, after receiving the stack message encapsulated with the mac address and the vlan sent by the stack member device 1, the LSW forwards the stack message to the stack port corresponding to the second device according to the mac address and the vlan, after receiving the stack message, the stack port of the second device determines whether the stack message needs to be processed by itself by determining the mac address and the vlan, where in the existing scheme, the mac address encapsulated by each stack member device is fixed, the mac address of each stack port of the stack member device 1 is mac1, the mac address of each stack port of the stack member device 2 is mac2, that is, the source mac addresses of the stack messages sent from the four stack ports of the stack member device 1 are mac1, the destination mac addresses are mac2, and similarly, the source mac addresses of the stack messages sent from the four stack ports of the stack member device 2 are mac2, the destination mac addresses are mac1, so as to simplify the process of forwarding the stack packet, but because there are multiple stack links, in order to avoid forwarding errors, the existing scheme sets different vlans for each link to perform vlan isolation, and sets different vlans for each trunk port of a switch in the two-layer network, so that the switch can accurately forward the stack packet to the stack port of the same vlan of another stack member device, that is, the port1, port1 ", port 5" and port1 'belong to the same link and the same vlan, and the stack packet sent through the port1 can be received by the switch only through the port1 ", and forwarded to the port 1' of the stack member device 2 through the port 5".
However, in a real environment, setting a vlan to a port of each stack member device actually sets a vlan to each link, setting a vlan to each link actually sets a vlan to each trunk port of the switch, and setting a vlan to each trunk port of the switch, the trunk port does not allow the vlan to pass stack messages for other vlans, and flexibility of intermediate two-layer network deployment is limited to a large extent.
The application provides a method and an apparatus for forwarding a stack packet, an electronic device, a switch, a router, a server, a computer-readable storage medium, and a computer program product, which are intended to solve the above technical problems in the prior art.
The technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application will be described below through descriptions of several exemplary embodiments. It should be noted that the following embodiments may be referred to, referred to or combined with each other, and the description of the same terms, similar features, similar implementation steps and the like in different embodiments is not repeated.
An embodiment of the present application provides a method for forwarding a stack packet, and as shown in fig. 2, the method includes:
step S201, receiving a stack message sent by a first device; the stack message encapsulates the source mac address and the destination mac address.
The embodiment of the present application is applied to a stack group formed by at least two stack member devices, and stack packet forwarding is performed in the stack group, where the stack group includes a first device, a second device, and a switch, and an execution main body in the embodiment of the present application may be a device in a two-layer network, and may be a switch or another device having a function of the switch.
In the embodiment of the present application, the first device and the second device are member devices in the stack group, and may be any type of device that can send a stack packet, such as a host, a server, a switch, a router, a server, and the like.
In this embodiment of the present application, ports on the first device and the second device are referred to as stack ports, and ports on the switch are referred to as relay ports, and it should be emphasized that each stack port of the first device, each stack port of the second device, and each relay port of the switch belong to the same vlan, and vlan isolation is not set for the stack port and the relay port.
As shown in fig. 3, which exemplarily shows a schematic diagram of stacking a first device and a second device in the present application, a left-side stacking member device 1 is the first device, a right-side stacking member device 2 is the second device, and the middle is a local area network switch LSW (lan switches), where the LSW may be the middle LSW together with the stacking member device 1 and an execution main body of the forwarding method for a stack packet in the embodiment of the present application.
The stacked message in the embodiment of the application is a stacked message and is obtained by encapsulating any type of data message and an ethernet frame, wherein an active mac address and a destination mac address are encapsulated in the ethernet frame, the active mac address is a mac address of a stacked port of the first device, which sends the stacked message, and the destination mac address is a mac address of a stacked port of the second device, which receives the stacked message.
Step S202, searching a target mac address in a pre-established mac forwarding table, and if the mac forwarding table comprises a reference mac address which is the same as the target mac address, determining a port corresponding to the reference mac address as a forwarding port.
The mac forwarding table records each reference mac address and a relay port corresponding to each reference mac address.
After receiving the stacked message, the embodiment of the application performs preliminary analysis on the stacked message, analyzes the ethernet frame encapsulated in the stacked message, extracts the source mac address and the destination mac address from the ethernet frame, and encapsulates and forwards the ethernet frame and the data message after extracting the source mac address and the destination mac address.
In the mac forwarding table of the embodiment of the present application, each reference mac address and a relay port corresponding to each reference mac address are recorded.
In the embodiment of the application, the relay port is a port on a switch, and each reference mac address in the mac forwarding table and the relay port corresponding to the reference mac address are determined in the following manner:
after receiving a certain stack message, searching whether a reference mac address identical to a source mac address of the stack message exists in a mac forwarding table, if the reference mac address identical to the source mac address does not exist, indicating that the stack message is received for the first time, learning the stack message is required, recording the source mac address of the stack message as a new reference mac address, acquiring a relay port for receiving the stack message, determining that the relay port for receiving the stack message is a relay port corresponding to the new reference mac address, and recording the new reference mac address and the relay port corresponding to the new reference mac address in the mac forwarding table.
In the mac forwarding table of the embodiment of the present application, a relay port corresponding to each reference mac address may represent two layers: one layer means: the mac address of the stack port connected with the relay port is the reference mac address; the other layer means: if the destination mac address of a received stack packet is the same as the reference mac address, the stack packet can be forwarded to the stack port corresponding to the destination mac address through the relay port.
In the embodiment of the application, after receiving the stack message sent by the first device, the destination mac address is searched in a pre-established mac forwarding table, and if the mac forwarding table includes the reference mac address with the same destination mac address, the relay port corresponding to the reference mac address is determined to be the forwarding port.
In addition, it is to be noted that, in the embodiments of the present application, each stack port and each relay port belong to the same vlan, and vlan isolation is not set for the stack port and the relay port.
Step S203, the stack packet is forwarded to the stack port corresponding to the destination mac address in the second device through the forwarding port.
And the stack port of the first device, the stack port of the second device and the relay port are all in the same vlan.
After the forwarding port is determined, the embodiment of the application forwards the stack packet to the stack port corresponding to the destination mac address in the second device through the forwarding port, and after the second device receives the stack packet, the second device strips the encapsulated ethernet frame and sends the ethernet frame to the next module.
According to the embodiment of the application, the relay port corresponding to the reference mac address which is the same as the mac address can be inquired in the mac forwarding table, and the relay port is determined to be the forwarding port, so that the two-layer network can be effectively passed through, instead of implementing vlan isolation on each port on a stacking link, and the flexibility of deployment of the intermediate two-layer network is improved.
The embodiment of the present application provides a possible implementation manner, before receiving a stack message sent by a first wading pen, further including:
acquiring the number of links between first equipment and second equipment;
respectively determining a fixed bit and a variable bit of the mac address of each stack port of the first device and the second device according to the number of the links; the fixed bit refers to a bit with the same mac address of different stack ports of the same device; the change bit refers to a bit of the mac address change of different stack ports of the same device;
and respectively configuring the mac address for each stack port of the first device according to the fixed bit and the change bit of the mac address of each stack port of the first device, and respectively configuring the mac address for each stack port of the second device according to the fixed bit and the change bit of the mac address of each stack port of the second device.
The length of the mac address is 48 bits (6 bytes), a plurality of stacking links exist between the first device and the second device in the embodiment of the present application, the fixed bits and the variable bits of the mac information of each stacking port of the first device and the second device can be determined according to the number of the stacking links, and the mac address is divided into the fixed bits and the variable bits.
In this embodiment, the fixed bits refer to the same bits of the mac addresses of different stack ports of the same device, and the changed bits refer to bits of the mac addresses of different stack ports of the same device that are changed.
Specifically, assume the maximum link number of bits64, i.e. the number of links between the first device and the second device is at most 64, due to 26>=64, and thus it can be determined that the number of bits that need to be changed is 6, that is, the last 6 bits of the mac address are changed bits, and since the length of the mac address is 48 bits, it can be determined that the fixed bits of the mac address are 48-6=42, that is, the first 42 bits of the mac address are fixed bits.
It should be noted that the fixed bit in the embodiment of the present application may be used as an identification mark of the mac addresses of the first device and the second device, that is, the stack ports of the first device have the same fixed bit, the stack ports of the second device have the same fixed bit, and the first device or the second device may be determined by identifying the fixed bit of the mac address.
The fixed bit in the embodiment of the application can be used as the identifier of the mac address of the first device and the second device, and the specific numerical values of the fixed bit of the first device and the second device are different.
The change bit can be used as the unique identifier of each stack port, the stack ports of the same device can be distinguished by setting different change bits for each stack port, so that the mac address formed by the fixed bit and the change bit can be distinguished from each stack port, the mac address of each stack port in network transmission is different, and normal forwarding of stack messages can be guaranteed in the same vlan.
After the fixed bit and the change bit of the mac address of each stack port of the first device are determined, the mac address is configured for each stack port of the first device.
Specifically, the mac address is usually expressed by 12 16 bits, and assuming that the maximum number of links between the first device and the second device is 16, the change bit is determined to be 4 bits, and the 4 binary bits are 1 16 bits, so that it can be determined that only the last 16 bits are required to be changed, i.e., the fixed bit is the last 16 bits, and the fixed bit is changed from 0 of 16 bits to f of 16 bits, and if the fixed bit of the mac address of the first device is 00-01-00-02-10-0, the mac addresses that can be configured for the 16 stack ports of the first device are respectively 00-01-00-02-10-01, 00-01-00-02-10-02, …, 00-01-00-02-10-0f, and each stack port has the same fixed bit and different change bits, the mac address composed of the fixed bit and the variable bit is unique, and the mac address of each stack port can be distinguished.
The mac addresses of the stack ports of the second device may be configured in the same manner, and are not described herein again in this embodiment of the application.
The mac address of each stack port in the embodiment of the application is composed of the fixed bit and the change bit, the fixed bit can be used as the identification mark of the first device or the second device, the change bit can distinguish different stack ports of the same device, the mac addresses composed of the fixed bit and the change bit are different, and the stack message can be guaranteed to be normally forwarded in the same vlan.
The embodiment of the present application provides a possible implementation manner, in which the determining the fixed bit and the variable bit of the mac address of each stack port of the first device and the second device according to the number of links includes:
determining the number of mac addresses required to be allocated to the stacking ports of the first device and the second device according to the number of the links;
determining the change bit of the mac address of each stack port of the first device and the second device according to the number of the mac addresses;
and determining fixed bits of the mac addresses of the stack ports of the first device and the second device according to the changed bits of the mac addresses of the stack ports of the first device and the second device.
After the number of links between the first device and the second device is obtained, the number of mac addresses required to be allocated to the stacking ports of the first device and the second device is determined according to the number of links.
Specifically, assuming that the number of links between the first device and the second device is 16, it can be determined that the first device and the second device have 16 stack ports, respectively, that is, 16 mac addresses need to be allocated to the stack ports of the first device, and 16 mac addresses need to be allocated to the stack ports of the second device.
After determining the number of mac addresses, the changed bits of the mac addresses of the respective stack ports of the first device and the second device are determined according to the number of mac addresses. Specifically, continuing with the above example, the number of mac addresses allocated to the first device is determined to be 16, and if the mac addresses are expressed in 16-ary bits, only the last bit is required to be changed, i.e., the fixed bit is the last 16-ary number.
The mac address comprises 12 16-ary numbers in 16-ary expression, the last 16-ary number is a change bit, and the first 11 16-ary numbers of the fixed bit can be determined.
Similarly, the mac address is expressed as a 48-bit binary number, and the last 4-bit 2-ary number is a change bit, which determines that the first 44 bits of the fixed bit are binary numbers.
The embodiment of the present application provides a possible implementation manner, where the configuring of the mac address for each stack port of a first device is performed according to a fixed bit and a changed bit of the mac address of each stack port of the first device, and the configuring of the mac address for each stack port of a second device is performed according to a fixed bit and a changed bit of the mac address of each stack port of the second device, including:
respectively determining the value of a fixed bit and the value of a variable bit of a mac address of a stack port according to a preset rule for any stack port of first equipment or second equipment;
and combining the value of the fixed bit and the value of the variable bit to generate the mac address of the stack port.
In the embodiment of the application, for any stack port of the first device or the second device, the value of the fixed bit and the value of the changed bit of the mac address of each stack port are determined according to the preset rule, and the fixed value and the value of the changed bit are combined to generate the mac address of the stack port.
Specifically, if the mac address is expressed in a 16-system, the change bit is the last 16-system number, the fixed bit is the first 11-bit binary number, the fixed bit of each stack port of the first device is set to be 00-01-00-02-10-0 according to a preset rule, the fixed bit of each stack port of the second device is set to be 00-01-00-03-10-0, the fixed bits of the two are changed from 0 in the 16-system to f in the 16-system, the mac address of each stack port of the first device can be determined to be 00-01-00-02-10-01, 00-01-00-02-10-02, …, 00-01-00-02-10-0f by combining the fixed bits and the change bits, and the mac address of each stack port of the second device is 00-01-00-03-10-01, 00-01-00-03-10-02, …, 00-01-00-03-10-0 f.
The embodiment of the present application provides a possible implementation manner, before searching a target mac address in a pre-established mac forwarding table, the method further includes:
and extracting the fixed bit of the source mac address from the source mac address, and if the fixed bit of the source mac address is determined to be the unique identifier of the pre-stored first device, determining to acquire a pre-established mac forwarding table.
After receiving a stack message, the embodiment of the application extracts a source mac address and a destination mac address encapsulated in the stack message, extracts a fixed bit of the source mac address, where the fixed bit is an identification identifier of a mac address of a first device and may be regarded as a unique identifier of the first device, and if it is determined that the fixed bit of the source mac address is a pre-stored fixed bit of the source mac address and is a pre-stored unique identifier of the first device, it may be determined that the stack message can be forwarded and is a message meeting requirements, and it may be determined to call a pre-established forwarding table.
The embodiment of the present application provides a possible implementation manner, and after searching a target mac address in a pre-established mac forwarding table, the method further includes:
and if the mac forwarding table does not comprise the reference mac address with the same destination mac address, broadcasting the stack message through other relay ports except the relay port for receiving the stack message.
In the embodiment of the present application, a reference mac address and a relay port corresponding to the reference mac address are stored in a mac forwarding table, and if the mac forwarding table does not include the reference mac address that is the same as a destination mac address of the stacked packet, it cannot be determined that the stacked packet can be forwarded to a stack port corresponding to the destination mac address through that port, at this time, the stacked packet is broadcasted through other relay ports except a relay port that receives the stacked packet, so that the stack port corresponding to the destination mac address receives the stacked packet, after receiving the stacked packet, the stack port corresponding to the destination mac address corresponds to the stacked packet, and after receiving the stacked packet, other stack ports determine that the stacked packet is not their own, and discard the stacked packet.
The embodiment of the present application provides a possible implementation manner, and after receiving a stack packet sent by a first device, the embodiment of the present application further includes:
searching a source mac address in a pre-established mac forwarding table, and if the mac forwarding table does not comprise a reference mac address which is the same as the source mac address, determining the source mac address as a new reference mac address;
acquiring a relay port for receiving the stacked message, and determining the relay port for receiving the stacked message as a relay port corresponding to the new reference mac address;
and adding the new reference mac address and the relay port corresponding to the new reference mac address to the mac forwarding table.
After receiving the stack message and extracting the source mac address and the destination mac address of the stack message, the embodiment of the application searches not only the destination mac address but also the source mac address in a pre-established mac forwarding table, and queries whether a reference mac address identical to the source mac address exists.
The searching of the destination mac address is to determine a relay port for forwarding the stack packet, and the searching of the source mac address is to determine whether the stack packet is received for the first time, and if a reference mac address corresponding to the source mac address is not found, it indicates that the stack packet sent by the stack port corresponding to the source mac address is not received in the mac forwarding table.
If the mac forwarding table does not include the reference mac address with the same source mac address, the source mac address is determined to be the new reference mac address.
And acquiring a relay port for receiving the stack message, determining that the relay port for receiving the stack message is a relay port corresponding to the new mac address, and adding the new reference mac address and the relay port corresponding to the new reference mac address to a mac forwarding table, so that when the stack message with the new reference mac address as a destination mac address is received next time, the relay port corresponding to the new reference mac address can be directly determined as the forwarding port.
The following will describe the embodiments of the present application by taking a specific scenario as an example, as shown in fig. 2, there are a first device stack member device 1, a switch LSW, and a second device stack member device 2, assuming that there are 16 links between the stack member device 1 and the stack member device 2, it can be determined that the mac address of each stack port of the first device is 00-01-00-02-10-01, 00-01-00-02-10-02, …, 00-01-00-02-10-0f, and the mac address of each stack port of the second device is 00-01-00-03-10-01, 00-01-00-03-10-02, …, 00-01-00-03-10-0f, respectively.
The process of establishing a stack and forwarding a stack packet will be described below by taking two stack links as an example, the stack ports of the stack member device 1 are port1 and port2, the stack ports of the stack member device 2 are port1 'and port 2', the relay ports of the LSW are port1 ", port 2", port3 "and port 4", and the above-mentioned port1, port2, port1 ', port 2', port1 ", port 2", port3 "and port 4" belong to the same vlan, the mac address of port1 of the stack member device 1 is 00-01-00-02-10-01, the mac address of port2 is 00-01-00-02-10-02, the mac address of the stack member device 2 'is 00-01-00-10-03-00-03-29-03', and the mac address of the stack member device 2 is 00-03-00-10-03.
The mac address of the port1 of the stack member device 1 is 00-01-00-02-10-01, the vlan is 10, the stack message is sent to the switch LSW through the port1, the source mac address of the sent stack message is 00-01-00-02-10-01, the destination mac address is 00-01-00-03-10-01, and the vlan is 10.
The LSW switch receives the stack message through port1 ″, and after receiving the stack message, the source mac address 00-01-00-02-10-01 and the destination mac address 00-01-00-03-10-01 of the stack message are analyzed, the current mac forwarding table is empty, the reference mac address corresponding to the source mac address is not searched from the mac forwarding table, determining the source mac address as a new reference mac address, determining the relay port receiving the stack packet as a relay port corresponding to the new reference mac address, and adds the new reference mac address and the new reference mac address to the mac forwarding table, as shown in table 1, table 1 shows the contents of the mac address after the new reference mac address and the new reference mac address are added to the mac forwarding table, and the table further includes the vlan to which the stack port that sends the stack packet belongs.
Figure 955761DEST_PATH_IMAGE001
TABLE 1
Meanwhile, a reference mac address corresponding to the destination mac address is not searched from the mac forwarding table, so that the stack message needs to be broadcasted through other relay ports except the relay port for receiving the stack message, that is, the stack message is broadcasted through the relay ports 2 ' ', 3 ' ', and 4 ' ', and is respectively sent to the stack port2 of the stack member device 1 and the stack ports 1 ' and 2 ' of the stack member device 2, after the stack message is received by the port1 ' of the stack member device 2, the destination mac address of the stack message is detected to be self, the stack message is responded, and meanwhile, after the stack message is detected to meet the condition, the ethernet header is stripped, and the data message is sent to the next module for normal processing; the port1 of stack member device 1 and the port 2' of stack member device 2 interpret that the stack message is not their own, and discard the stack message directly.
The LSW receives the stack message sent by the port1 'of the stack member device 2, the source mac address is 00-01-00-03-10-01, the destination mac address is 00-01-00-02-10-01, the vlan is 10, and after the LSW receives the stack message sent by the port 1', the generated mac forwarding table is as shown in table 2.
Figure 341743DEST_PATH_IMAGE002
TABLE 2
The above-described port1 of stack member device 1 and port 1' of stack member device 2 implement stack link establishment in the manner described above.
Stack member device 1 port2 and stack member device 2 port 1' also complete the establishment of the stack link through the same interaction, so that the intermediate LSWs eventually learn to generate mac forwarding tables as shown in table 3:
Figure 590322DEST_PATH_IMAGE003
TABLE 3
After the stack is established, the forwarding of the stack message in the stack group is also performed in the same manner as the above steps, which is not described in detail in this embodiment of the application.
The problem that the vlan isolation of the intermediate two-layer network equipment is needed when the stack message of the existing scheme passes through the intermediate two-layer network is effectively solved through the processing, so that the network deployment of the intermediate network equipment is more flexible, and the vlan consumption of the stack member equipment is reduced to a certain extent.
An embodiment of the present application provides a forwarding device for stacked messages, as shown in fig. 4, the forwarding device 40 for stacked messages may include:
a receiving module 410, configured to receive a stack packet sent by a first device; packaging an active mac address and a destination mac address in the stack message;
the searching module 420 is configured to search a target mac address in a pre-established mac forwarding table, and if the mac forwarding table includes a reference mac address that is the same as the target mac address, determine a relay port corresponding to the reference mac address as a forwarding port;
a forwarding module 430, configured to forward the stack packet to a stack port of the second device corresponding to the destination mac address through the forwarding port;
each reference mac address and a relay port corresponding to each reference mac address are recorded in the mac forwarding table;
the stack port of the first device, the stack port of the second device, and the trunk port are all in the same vlan.
The embodiment of the present application provides a possible implementation manner, and the apparatus further includes a mac address determining module, where the mac address determining module includes:
the obtaining submodule is used for obtaining the number of links between the first equipment and the second equipment;
a mac address fixed bit and change bit determining submodule for determining the fixed bit and change bit of the mac address of each stack port of the first device and the second device respectively according to the link number; the fixed bit refers to a bit with the same mac address of different stack ports of the same device; the change bit refers to a bit of the mac address change of different stack ports of the same device;
and the mac address configuration submodule is used for respectively configuring the mac addresses for the stack ports of the first equipment according to the fixed bits and the change bits of the mac addresses of the stack ports of the first equipment, and respectively configuring the mac addresses for the stack ports of the second equipment according to the fixed bits and the change bits of the mac addresses of the stack ports of the second equipment.
The embodiment of the application provides a possible implementation manner, and the mac address fixed bit and change bit determination submodule comprises
The number determining unit of the mac addresses is used for determining the number of the mac addresses which need to be allocated to the stacking ports of the first equipment and the second equipment according to the number of the links;
a change bit determination unit of the mac address, configured to determine change bits of the mac address of each stack port of the first device and the second device according to the number of the mac addresses;
and the fixed bit determining unit of the mac address is used for determining the fixed bits of the mac addresses of the stack ports of the first device and the second device according to the changed bits of the mac addresses of the stack ports of the first device and the second device.
The embodiment of the application provides a possible implementation manner, wherein the mac address configuration submodule is specifically configured to respectively determine, according to a preset rule, a value of a fixed bit and a value of a variable bit of a mac address of a stack port for any stack port of first equipment or second equipment; and combining the value of the fixed bit and the value of the variable bit to generate the mac address of the stack port.
The embodiment of the present application provides a possible implementation manner, and the apparatus further includes:
and the mac forwarding table acquisition module is used for extracting the fixed bit of the source mac address from the source mac address, and if the fixed bit of the source mac address is determined to be the unique identifier of the pre-stored first device, the mac forwarding table which is pre-established is determined to be acquired.
The embodiment of the present application provides a possible implementation manner, and the apparatus further includes:
and the broadcasting module is used for broadcasting the stack message through other relay ports except the relay port for receiving the stack message if the mac forwarding table does not include the reference mac address with the same destination mac address.
The embodiment of the present application provides a possible implementation manner, and the apparatus further includes: the mac forwarding table building module comprises:
the new reference mac address determining submodule is used for searching a source mac address in a pre-established mac forwarding table, and if the mac forwarding table does not include a reference mac address which is the same as the source mac address, determining the source mac address as the new reference mac address;
the relay port determining submodule corresponding to the new reference mac address is used for acquiring a relay port for receiving the stack message and determining the relay port for receiving the stack message as the relay port corresponding to the new reference mac address;
and the adding submodule is used for adding the new reference mac address and the relay port corresponding to the new reference mac address to the mac forwarding table.
The apparatus of the embodiment of the present application may execute the method provided by the embodiment of the present application, and the implementation principle is similar, the actions executed by the modules in the apparatus of the embodiments of the present application correspond to the steps in the method of the embodiments of the present application, and for the detailed functional description of the modules of the apparatus, reference may be specifically made to the description in the corresponding method shown in the foregoing, and details are not repeated here.
The embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory, where the processor executes the computer program to implement the steps of the method for forwarding a stack packet, and compared with the prior art, the method can implement: receiving a stacked message sent by first equipment; packaging an active mac address and a destination mac address in the stack message; searching a target mac address in a pre-established mac forwarding table, and if the mac forwarding table comprises a reference mac address which is the same as the target mac address, determining a relay port corresponding to the reference mac address as a forwarding port; forwarding the stacked message to a stacked port corresponding to a target mac address in the second device through a forwarding port; each reference mac address and a relay port corresponding to each reference mac address are recorded in the mac forwarding table; the stack port of the first device, the stack port of the second device, and the trunk port are all in the same vlan. According to the embodiment of the application, the relay port corresponding to the reference mac address which is the same as the mac address can be inquired in the mac forwarding table, and the relay port is determined to be the forwarding port, so that the two-layer network can be effectively passed through, instead of implementing vlan isolation on each port on a stacking link, and the flexibility of deployment of the intermediate two-layer network is improved.
In an alternative embodiment, an electronic device is provided, as shown in fig. 5, the electronic device 5000 shown in fig. 5 includes: a processor 5001 and a memory 5003. The processor 5001 and the memory 5003 are coupled, such as via a bus 5002. Optionally, the electronic device 5000 may further include a transceiver 5004, and the transceiver 5004 may be used for data interaction between the electronic device and other electronic devices, such as transmission of data and/or reception of data. It should be noted that the transceiver 5004 is not limited to one in practical application, and the structure of the electronic device 5000 is not limited to the embodiment of the present application.
The Processor 5001 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 5001 may also be a combination of processors implementing computing functionality, e.g., a combination comprising one or more microprocessors, a combination of DSPs and microprocessors, or the like.
Bus 5002 can include a path that conveys information between the aforementioned components. The bus 5002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 5002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
The Memory 5003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium, other magnetic storage devices, or any other medium that can be used to carry or store a computer program and that can be Read by a computer, without limitation.
The memory 5003 is used for storing computer programs for executing the embodiments of the present application, and is controlled by the processor 5001 for execution. The processor 5001 is configured to execute computer programs stored in the memory 5003 to implement the steps shown in the foregoing method embodiments.
The electronic device package may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (e.g., a car navigation terminal), etc., and a stationary terminal such as a digital TV, a desktop computer, etc., among others.
The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
Embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and when being executed by a processor, the computer program may implement the steps and corresponding contents of the foregoing method embodiments. Compared with the prior art, the method can realize that: receiving a stacked message sent by first equipment; packaging an active mac address and a destination mac address in the stack message; searching a target mac address in a pre-established mac forwarding table, and if the mac forwarding table comprises a reference mac address which is the same as the target mac address, determining a relay port corresponding to the reference mac address as a forwarding port; forwarding the stacked message to a stacked port corresponding to a target mac address in the second device through a forwarding port; each reference mac address and a relay port corresponding to each reference mac address are recorded in the mac forwarding table; the stack port of the first device, the stack port of the second device, and the trunk port are all in the same vlan. According to the embodiment of the application, the relay port corresponding to the reference mac address which is the same as the mac address can be inquired in the mac forwarding table, and the relay port is determined to be the forwarding port, so that the two-layer network can be effectively passed through, instead of implementing vlan isolation on each port on a stacking link, and the flexibility of deployment of the intermediate two-layer network is improved.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
Embodiments of the present application further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps and corresponding contents of the foregoing method embodiments can be implemented. Compared with the prior art, the method can realize that: receiving a stacked message sent by first equipment; packaging an active mac address and a destination mac address in the stack message; searching a target mac address in a pre-established mac forwarding table, and if the mac forwarding table comprises a reference mac address which is the same as the target mac address, determining a relay port corresponding to the reference mac address as a forwarding port; forwarding the stacked message to a stacked port corresponding to a target mac address in the second device through a forwarding port; each reference mac address and a relay port corresponding to each reference mac address are recorded in the mac forwarding table; the stack port of the first device, the stack port of the second device, and the trunk port are all in the same vlan. According to the embodiment of the application, the relay port corresponding to the reference mac address which is the same as the mac address can be inquired in the mac forwarding table, and the relay port is determined to be the forwarding port, so that the two-layer network can be effectively passed through, instead of implementing vlan isolation on each port on a stacking link, and the flexibility of deployment of the intermediate two-layer network is improved.
It should be understood that, although each operation step is indicated by an arrow in the flowchart of the embodiment of the present application, the implementation order of the steps is not limited to the order indicated by the arrow. In some implementation scenarios of the embodiments of the present application, the implementation steps in the flowcharts may be performed in other sequences as desired, unless explicitly stated otherwise herein. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on an actual implementation scenario. Some or all of these sub-steps or stages may be performed at the same time, or each of these sub-steps or stages may be performed at different times, respectively. In a scenario where execution times are different, an execution sequence of the sub-steps or the phases may be flexibly configured according to requirements, which is not limited in the embodiment of the present application.
The above are only optional embodiments of partial implementation scenarios in the present application, and it should be noted that, for those skilled in the art, other similar implementation means based on the technical idea of the present application are also within the scope of protection of the embodiments of the present application without departing from the technical idea of the present application.

Claims (9)

1. A method for forwarding a stack packet is characterized by comprising the following steps:
acquiring the number of links between first equipment and second equipment;
respectively determining a fixed bit and a variable bit of the mac address of each stack port of the first device and the second device according to the link number; the fixed bit refers to a bit with the same mac address of different stack ports of the same device; the change bit refers to a bit for changing the mac address of different stack ports of the same device;
respectively configuring a mac address for each stack port of the first device according to a fixed bit and a change bit of the mac address of each stack port of the first device, and respectively configuring a mac address for each stack port of the second device according to a fixed bit and a change bit of the mac address of each stack port of the second device;
receiving a stacked message sent by first equipment; packaging an active mac address and a destination mac address in the stack message;
searching the target mac address in a pre-established mac forwarding table, and if the mac forwarding table comprises a reference mac address which is the same as the target mac address, determining a relay port corresponding to the reference mac address as a forwarding port;
forwarding the stacked message to a stacked port corresponding to the destination mac address in the second device through the forwarding port;
each reference mac address and a relay port corresponding to each reference mac address are recorded in the mac forwarding table;
the stack port of the first device, the stack port of the second device, and the trunk port are all in the same vlan.
2. The method of claim 1, wherein the determining the fixed bit and the variable bit of the mac address of each stack port of the first device and the second device according to the link number comprises:
determining the number of mac addresses required to be allocated to the stacking ports of the first device and the second device according to the number of the links;
determining the change bit of the mac address of each stack port of the first device and the second device according to the number of the mac addresses;
and determining fixed bits of the mac addresses of the stack ports of the first device and the second device according to the changed bits of the mac addresses of the stack ports of the first device and the second device.
3. The method of claim 1, wherein the configuring the mac address for each stack port of the first device according to the fixed bits and the changed bits of the mac address of each stack port of the first device, and the configuring the mac address for each stack port of the second device according to the fixed bits and the changed bits of the mac address of each stack port of the second device comprises:
respectively determining the value of a fixed bit and the value of a variable bit of a mac address of the stack port according to a preset rule for any stack port of the first device or the second device;
and combining the numerical value of the fixed bit and the numerical value of the variable bit to generate the mac address of the stack port.
4. The method of claim 1, wherein before searching the pre-established mac forwarding table for the destination mac address, the method further comprises:
and extracting the fixed bit of the source mac address from the source mac address, and if the fixed bit of the source mac address is determined to be the unique identifier of the first device stored in advance, determining to acquire a pre-established mac forwarding table.
5. The method of claim 1, wherein after searching the pre-established mac forwarding table for the destination mac address, the method comprises:
and if the mac forwarding table does not comprise a reference mac address which is the same as the target mac address, broadcasting the stack message through other relay ports except the relay port for receiving the stack message.
6. The method of claim 1, wherein the receiving the stack message sent by the first device further comprises:
searching the source mac address in a pre-established mac forwarding table, and if the mac forwarding table does not comprise a reference mac address which is the same as the source mac address, determining that the source mac address is a new reference mac address;
acquiring a relay port for receiving the stack message, and determining that the relay port for receiving the stack message is a relay port corresponding to the new reference mac address;
and adding the new reference mac address and the relay port corresponding to the new reference mac address to the mac forwarding table.
7. A forwarding apparatus for stack packets, comprising:
the obtaining submodule is used for obtaining the number of links between the first equipment and the second equipment;
a mac address fixed bit and changed bit determining submodule, configured to determine a fixed bit and a changed bit of a mac address of each stack port of the first device and the second device, respectively, according to the link number; the fixed bit refers to a bit with the same mac address of different stack ports of the same device; the change bit refers to a bit for changing the mac address of different stack ports of the same device;
a mac address configuration submodule, configured to configure a mac address for each stack port of the first device according to a fixed bit and a change bit of the mac address of each stack port of the first device, and configure a mac address for each stack port of the second device according to a fixed bit and a change bit of the mac address of each stack port of the second device;
the receiving module is used for receiving the stacking message sent by the first equipment; packaging an active mac address and a destination mac address in the stack message;
the searching module is used for searching the target mac address in a pre-established mac forwarding table, and if the mac forwarding table comprises a reference mac address which is the same as the target mac address, determining a relay port corresponding to the reference mac address as a forwarding port;
a forwarding module, configured to forward the stack packet to a stack port of a second device corresponding to the destination mac address through the forwarding port;
each reference mac address and a relay port corresponding to each reference mac address are recorded in the mac forwarding table;
the stack port of the first device, the stack port of the second device, and the trunk port are all in the same vlan.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1 to 6 are implemented when the processor executes the program.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
CN202210005442.XA 2022-01-05 2022-01-05 Method and device for forwarding stacked messages, electronic equipment and readable storage medium Active CN114024902B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210005442.XA CN114024902B (en) 2022-01-05 2022-01-05 Method and device for forwarding stacked messages, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210005442.XA CN114024902B (en) 2022-01-05 2022-01-05 Method and device for forwarding stacked messages, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN114024902A CN114024902A (en) 2022-02-08
CN114024902B true CN114024902B (en) 2022-04-08

Family

ID=80069516

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210005442.XA Active CN114024902B (en) 2022-01-05 2022-01-05 Method and device for forwarding stacked messages, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114024902B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103607351A (en) * 2013-10-31 2014-02-26 杭州华三通信技术有限公司 Chip forwarding item generation method and equipment thereof
CN104104570A (en) * 2013-04-07 2014-10-15 杭州华三通信技术有限公司 Aggregation processing method in IRF (Intelligent Resilient Framework) system and device
WO2017181757A1 (en) * 2016-04-18 2017-10-26 中兴通讯股份有限公司 Packet forwarding method and device
CN110519079A (en) * 2019-08-01 2019-11-29 新华三大数据技术有限公司 A kind of data forwarding method, device, web plate, the network equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104639440B (en) * 2015-02-02 2017-11-14 新华三技术有限公司 A kind of method and apparatus for realizing three layers of forwarding and tunneling information in a network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104104570A (en) * 2013-04-07 2014-10-15 杭州华三通信技术有限公司 Aggregation processing method in IRF (Intelligent Resilient Framework) system and device
CN103607351A (en) * 2013-10-31 2014-02-26 杭州华三通信技术有限公司 Chip forwarding item generation method and equipment thereof
WO2017181757A1 (en) * 2016-04-18 2017-10-26 中兴通讯股份有限公司 Packet forwarding method and device
CN110519079A (en) * 2019-08-01 2019-11-29 新华三大数据技术有限公司 A kind of data forwarding method, device, web plate, the network equipment and storage medium

Also Published As

Publication number Publication date
CN114024902A (en) 2022-02-08

Similar Documents

Publication Publication Date Title
CN103200069B (en) A kind of method and apparatus of Message processing
CN106998286B (en) VX L AN message forwarding method and device
CN108718278B (en) Message transmission method and device
US10333845B2 (en) Forwarding data packets
CN107579900B (en) Method, device and system for accessing VX L AN network from V L AN network
CN102624611B (en) Method, device, processor and network equipment for message dispersion
CN110460684B (en) Broadcast domain isolation method and device for VXLAN (virtual extensible local area network) in same network segment
CN107317752B (en) Method and device for forwarding data message
CN104243302A (en) Service routing message processing method and device and network system
CN104145458A (en) Packet forwarding method, device and data center network
CN109639552B (en) Three-layer forwarding method and device
CN105827495A (en) Message forwarding method and device for VXLAN gateway
CN107493222B (en) VXLAN message forwarding method and device
CN113132202B (en) Message transmission method and related equipment
CN111132170A (en) Communication method and device of virtual firewall, virtual firewall and topological structure
CN106330719A (en) VXLAN message forwarding method and device
CN114143257A (en) Method for generating table entry, method, device and system for sending message
CN105187311A (en) Message forwarding method and message forwarding device
CN108718276A (en) A kind of message forwarding method and device
US20180337827A1 (en) Method and Device for Reporting OpenFlow Switch Capability
CN114024902B (en) Method and device for forwarding stacked messages, electronic equipment and readable storage medium
CN106209554A (en) Message forwarding method and equipment across virtual expansible LAN
CN114760165A (en) Message transmission method, device and system
CN112583736A (en) Signaling message distribution method, device, equipment and medium
CN114760243A (en) Message transmission method, device and system

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