CN109067673B - Method and system for learning MAC address in stacking system - Google Patents

Method and system for learning MAC address in stacking system Download PDF

Info

Publication number
CN109067673B
CN109067673B CN201810911587.XA CN201810911587A CN109067673B CN 109067673 B CN109067673 B CN 109067673B CN 201810911587 A CN201810911587 A CN 201810911587A CN 109067673 B CN109067673 B CN 109067673B
Authority
CN
China
Prior art keywords
message
chip
mac address
mirror image
address learning
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
CN201810911587.XA
Other languages
Chinese (zh)
Other versions
CN109067673A (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.)
Suzhou Centec Communications Co Ltd
Original Assignee
Centec Networks Suzhou 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 Centec Networks Suzhou Co Ltd filed Critical Centec Networks Suzhou Co Ltd
Priority to CN201810911587.XA priority Critical patent/CN109067673B/en
Publication of CN109067673A publication Critical patent/CN109067673A/en
Application granted granted Critical
Publication of CN109067673B publication Critical patent/CN109067673B/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
    • 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
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Landscapes

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

Abstract

The invention provides a method and a device for learning MAC addresses in a stacking system, wherein the method comprises the following steps: when initializing a chip, establishing a multicast forwarding group for the chip in the stacking system, wherein the members of the multicast forwarding group are stacking ports corresponding to each chip; creating mirror image configuration for each chip, wherein the destination of the mirror image configuration of each chip is a multicast forwarding group; after receiving the message, the inlet chip judges whether the current chip needs to carry out MAC address learning or not; if so, after the message is forwarded, the message is subjected to MAC address learning at the current chip, and the received message is subjected to mirror image processing according to the created mirror image configuration, so that the information obtained by the MAC address learning is diffused to all chips in the stacking system. According to the method and the device for learning the MAC address in the stacking system, the whole stacking system does not need the participation of a CPU in the MAC learning process, the MAC address learning is simply realized by multiplexing the functions of the existing chip, and the realization difficulty and the cost of the chip are reduced.

Description

Method and system for learning MAC address in stacking system
Technical Field
The present invention relates to the field of network communications, and in particular, to a method and system for MAC address learning in a stacking system.
Background
Stacking systems are a class of technologies that use more expansion ports on ethernet switches, and the greatest advantage of stacking systems is to provide simplified local management, managing a group of switches as one object. The stack system needs to perform MAC address learning under specific conditions in application. In the prior art, there are several schemes for implementing MAC address learning in a stacked system. The MAC (Media Access Control) is translated into a Media Access Control, or a physical address or a hardware address, for defining the location of the network device.
In the scheme 1, after an inlet chip finishes MAC address learning and reports to a CPU, the CPU is synchronized to other chips of a stacking system; specifically, as shown in fig. 1, the chip1 is an entry chip, and after a message enters the chip1, a corresponding panel port is not found, so that the request for executing MAC address learning is sent to the CPU, and further, the CPU sends the information of MAC address learning to all chips of the stacking system, so that all chips complete MAC address learning; for scheme 1, during the MAC address learning process, the CPU needs to heavily participate in MAC address learning.
In the scheme 2, after the entry chip finishes MAC address learning, an MAC address learning enabling state is set in a forwarding information header file of the stacking system, when the message is forwarded in the stacking system, other chips obtain MAC address learning enabling from the forwarding information header file and then carry out MAC address learning.
In the scheme 3, as shown in fig. 2, after the entry chip completes MAC address learning, the MAC address, the VLAN, and the port required for MAC address learning are assembled into an MAC address learning message, and the MACDA of the message is set as broadcast MAC, which is performed in the stacking system, so that all chips in the stacking system can learn the MAC address.
Disclosure of Invention
The invention aims to provide a method and a system for learning MAC addresses in a stacking system.
To achieve one of the above objects, an embodiment of the present invention provides a method for MAC address learning in a stacking system, where the method includes:
when initializing a chip, establishing a multicast forwarding group for the chip in the stacking system, wherein the members of the multicast forwarding group are stacking ports corresponding to each chip; creating mirror image configuration for each chip, wherein the destination of the mirror image configuration of each chip is a multicast forwarding group;
after any chip receives the message, judging whether the current chip needs to carry out MAC address learning or not;
if not, only the message needs to be forwarded;
if yes, after the message is forwarded, MAC address learning is carried out in the current chip;
after the current chip performs MAC address learning, the method further includes: judging whether the port of the message entering the current chip is a stacking port or not,
if not, carrying out mirror image processing on the message received by the current chip according to the created mirror image configuration so as to diffuse the information obtained by MAC address learning to all chips in the stacking system;
if yes, directly analyzing the information carried by the message diffused to the current chip in the mirror image processing mode for forwarding so as to diffuse the information obtained by MAC address learning to all chips in the stacking system.
As a further improvement of an embodiment of the present invention, "determining whether the current chip needs to perform MAC address learning" specifically includes:
parsing the packet to obtain a lookup key, the lookup key comprising: MacSa and vlan id;
searching an FDB address table by using a search keyword corresponding to the current message, and judging whether the current chip needs to carry out MAC address learning or not through the obtained srcPort, wherein the srcPort records a panel port when the message enters a stacking system.
As a further improvement of an embodiment of the present invention, "searching the FDB address table by using the lookup keyword corresponding to the current packet, and determining whether the current chip needs to perform MAC address learning by using the obtained srcPort" specifically includes:
after searching the FDB address table by looking up the key,
if the obtained srcPort is consistent with the port of the current chip for the message to enter, MAC address learning is not needed;
if the obtained src port is inconsistent with the port of the message entering the current chip, MAC address learning is required to be performed so as to update the src port;
if srcPort is not obtained, MAC address learning is required.
As a further improvement of an embodiment of the present invention, the "performing mirror processing on a packet received by a current chip according to a created mirror configuration" specifically includes:
analyzing the message, and acquiring a stack header file carried by the message, wherein the stack header file comprises: srcPort, vlan id, destPort and destGroup information;
copying the stack header file to a multicast forwarding group pointed by the mirror image configuration;
the "directly analyzing and forwarding the information carried by the message diffused to the current chip by the mirror image processing mode" specifically includes:
and forwarding according to the destGroup information carried by the stacking header file.
As a further improvement of an embodiment of the present invention, the method further comprises:
and in the process of copying the stack head file to the multicast forwarding group pointed by the mirror image configuration, intercepting the stack head file of the mirror image according to a preset storage space so as to reduce the bandwidth overhead in the process of learning the MAC address.
To achieve the above object, according to another embodiment of the present invention, there is provided an apparatus for MAC address learning in a stack system, the apparatus including:
the initialization module is used for establishing a multicast forwarding group for the chips in the stacking system when the chips are initialized, and the members of the multicast forwarding group are stacking ports corresponding to each chip; creating mirror image configuration for each chip, wherein the destination of the mirror image configuration of each chip is a multicast forwarding group;
the learning module is used for judging whether the current chip needs to carry out MAC address learning or not after any chip receives the message;
if not, only the message needs to be forwarded;
if yes, after the message is forwarded, MAC address learning is carried out in the current chip;
the processing module is used for judging whether the port of the message entering the current chip is a stacking port or not after the current chip performs MAC address learning,
if not, carrying out mirror image processing on the message received by the current chip according to the created mirror image configuration so as to diffuse the information obtained by MAC address learning to all chips in the stacking system;
if yes, directly analyzing the information carried by the message diffused to the current chip in the mirror image processing mode for forwarding so as to diffuse the information obtained by MAC address learning to all chips in the stacking system.
As a further improvement of an embodiment of the present invention, the learning module is specifically configured to:
parsing the packet to obtain a lookup key, the lookup key comprising: MacSa and vlan id;
searching an FDB address table by using a search keyword corresponding to the current message, and judging whether the current chip needs to carry out MAC address learning or not through the obtained srcPort, wherein the srcPort records a panel port when the message enters a stacking system.
As a further improvement of an embodiment of the present invention, the learning module is further configured to:
after searching the FDB address table by looking up the key,
if the obtained srcPort is consistent with the port of the current chip for the message to enter, MAC address learning is not needed;
if the obtained src port is inconsistent with the port of the message entering the current chip, MAC address learning is required to be performed so as to update the src port;
if srcPort is not obtained, MAC address learning is required.
As a further improvement of an embodiment of the present invention, the data processing module is specifically configured to:
analyzing the message, and acquiring a stack header file carried by the message, wherein the stack header file comprises: srcPort, vlan id, destPort and destGroup information;
if the port of the message entering the current chip is judged to be a non-stack port, copying the stack header file to a multicast forwarding group pointed by the mirror image configuration;
and if the port of the message entering the current chip is judged to be a stacking port, forwarding according to destGroup information carried by the stacking header file.
As a further improvement of an embodiment of the present invention, the data processing module is further configured to:
and in the process of copying the stack head file to the multicast forwarding group pointed by the mirror image configuration, intercepting the stack head file of the mirror image according to a preset storage space so as to reduce the bandwidth overhead in the process of learning the MAC address.
Compared with the prior art, the invention has the beneficial effects that: according to the method and the device for learning the MAC address in the stacking system, the whole stacking system does not need the participation of a CPU in the MAC learning process, the MAC address learning is simply realized by multiplexing the functions of the existing chip, and the realization difficulty and the cost of the chip are reduced.
Drawings
FIG. 1 is a schematic diagram of a stacking system shown in scheme 1 in the background of the invention;
FIG. 2 is a schematic diagram of a stacking system shown in scheme 3 in the background of the invention;
FIG. 3 is a flowchart of a method for learning MAC addresses in a stack system according to an embodiment of the invention;
FIG. 4 is a schematic diagram of a stacking system according to an embodiment of the present invention;
FIG. 5 is a flow chart of FIG. 3 interrupting whether MAC address learning is required for the current chip;
fig. 6 is a block diagram of a MAC address learning apparatus in a stacking system according to an embodiment of the invention.
Detailed Description
The present invention will be described in detail below with reference to specific embodiments shown in the drawings. These embodiments are not intended to limit the present invention, and structural, methodological, or functional changes made by those skilled in the art according to these embodiments are included in the scope of the present invention.
As shown in fig. 3, an embodiment of the present invention provides a method for MAC address learning in a stacking system, where the method includes:
when initializing a chip, establishing a multicast forwarding group for the chip in the stacking system, wherein the members of the multicast forwarding group are stacking ports corresponding to each chip; and creating a mirror image configuration for each chip, wherein the destination of the mirror image configuration of each chip is a multicast forwarding group.
Referring to fig. 4, in an embodiment of the present invention, when a stacking system is initialized, a multicast forwarding group is created for chips in the stacking system, where the stacking system includes 4 chips, which are respectively: chip1, Chip2, Chip3 and Chip4, wherein Chip1 represents an entry Chip, the multicast forwarding group is represented by capital letter G, and correspondingly, the multicast forwarding group corresponding to each Chip is represented as:
Chip1:G->{chip1_p1,chip1_p2}
Chip2:G->{chip2_p1,chip2_p2}
Chip3:G->{chip3_p1,chip3_p2}
Chip4:G->{chip4_p1,chip4_p2}
it will be appreciated that multicast replication in a stacked system has a well-established mechanism for putting a ring, and therefore no loops occur.
Further, a mirror configuration is created for each chip, denoted as MirrorG, the destination of which is the multicast forwarding group G.
It should be noted that the created multicast forwarding group and the created mirror configuration are both configured only in a fixed manner during chip initialization, and in the subsequent use process, the specific content of the multicast forwarding group and the created mirror configuration can be infinitely changed according to the specific processing process of the chip.
Further, as shown in fig. 5, the method further includes: after any chip receives the message, judging whether the current chip needs to carry out MAC address learning or not; if not, only the message needs to be forwarded; if yes, after the message is forwarded, MAC address learning is carried out in the current chip.
In the specific embodiment of the present invention, the chip receiving the message may be any chip in the above stacking system, where the first chip corresponding to the message when initially entering the stacking system is an entry chip, and the port interconnecting the chips is a stacking port, and when the message enters the stacking system through the entry chip, the message may be forwarded through the corresponding stacking port and the panel port. As shown in FIG. 4, continuing with the above example, messages enter the stacked system from Chip1, thus, Chip1 represents the ingress Chip.
In a preferred embodiment of the present invention, the determining whether the current chip needs to perform MAC address learning specifically includes: parsing the packet to obtain a lookup key, the lookup key comprising: MacSa and vlan id; searching an FDB address table by using a search keyword corresponding to the current message, and judging whether the current chip needs to carry out MAC address learning or not through the obtained srcPort, wherein the srcPort records a panel port when the message enters a stacking system.
The message carries various information, and corresponding information can be obtained as required by analyzing the message; the message information includes: ethernet information, network layer information, transport layer information, and additional information; the Ethernet information comprises: destination MAC, source MAC, VLanID; the network layer information includes: a target IP, a source IP, a service type ToS, a generation period TTL and a transmission layer type; the transport layer information includes: a source port, a destination port; the additional information includes: data volume, flow starting time, flow ending time, a port of flow entering the network equipment and a port of flow leaving the network equipment; the message information further includes: MacSa, MacDa, IpSA, IpDa, L4Type, L4SrcPort, L4 DestPort; wherein MacSa represents a source device hardware address; MacDa represents a hardware address of the destination device; the ip sa represents a source device internet protocol address; IpDa represents the destination device internet protocol address; l4Type represents an internet protocol Type; l4SrcPort represents the source device internet protocol port number; l4DestPort denotes the destination device internet protocol port number.
Further, searching the FDB address table by using the lookup keyword corresponding to the current packet, and determining whether the current chip needs to perform MAC address learning by using the obtained srcPort specifically includes:
after searching an FDB address table by searching keywords, if the obtained src Port is consistent with the port of the message entering the current chip, MAC address learning is not needed; if the obtained src port is inconsistent with the port of the message entering the current chip, MAC address learning is required to be performed so as to update the src port; if srcPort is not obtained, MAC address learning is required.
Further, after the MAC address learning is performed on the current chip, the method further includes: judging whether a port of a message entering a current chip is a stacking port or not, if not, carrying out mirror image processing on the message received by the current chip according to the created mirror image configuration so as to diffuse information obtained by MAC address learning to all chips in a stacking system; if yes, directly analyzing the information carried by the message diffused to the current chip in the mirror image processing mode for forwarding so as to diffuse the information obtained by MAC address learning to all chips in the stacking system.
In the specific embodiment of the present invention, the first chip corresponding to the first time when the message enters the stacking system is an inlet chip, and for the inlet chip, the port where the message enters the inlet chip is a non-stacking port; when a message enters from one chip to another chip, the message enters through the stacking port, so that in the stacking system, the same message enters through the stacking port except the inlet chip and enters into other non-inlet chips.
Therefore, when the inlet chip receives the message and the current chip is subjected to MAC address learning, the message received by the inlet chip is subjected to mirror image processing according to the created mirror image configuration so as to diffuse the information obtained by the MAC address learning to all chips in the stacking system.
After the non-inlet chip is subjected to MAC address learning, the information carried by the message diffused to the current non-inlet chip by the inlet chip is directly analyzed and forwarded in a mirror image mode, so that the information obtained by the MAC address learning is diffused to all chips in the stacking system.
In a preferred embodiment of the present invention, after the ingress chip learns the MAC address, the ingress chip performs mirror processing on the received packet according to the created mirror configuration, so as to diffuse information obtained by the MAC address learning to all chips in the stack system, and in this process, the ingress chip parses the packet and obtains a stack header file carried by the packet, where the stack header file includes: information such as srcPort, vlan id, destPort, destGroup, and the like; and copying the stack header file to a multicast forwarding group pointed by the mirror image configuration to complete mirror image processing. The srcPort is used for recording a panel port when a message enters a stacking system, and MAC address learning can be used; the vlan Id is used for recording the vlan to which the message belongs, possibly carried by the message, or defaultVlan on a panel port, and MAC address learning is used; the destPort is used for recording a panel port to which the message should be forwarded, the destPort is specified by the entrance chip, and the subsequent chips are directly used without modification; the destGroup is used for recording a multicast forwarding group to which the message should be forwarded, an outlet in the multicast group is designated by an inlet chip, and a subsequent chip is used without modification.
Correspondingly, for a non-entry chip, the destGroup information carried by the stack header file is directly called to be forwarded, and the purpose of forwarding can be achieved.
As shown in fig. 4, continuing with the above example, Chip1 is an ingress Chip, and if it is determined that MAC address learning is needed, after the packet is normally forwarded, it is mirrored to MirrorG, and since the destination of the mirrored MirrorG is a multicast group G, the corresponding egress chips 1_ p1 and 1_ p2 can be obtained by looking up a G table, and further, the packet will be diffused from Chip1_ p1 and Chip1_ p2 to non-ingress chips 2 and Chip3, respectively.
Furthermore, in the preferred embodiment of the present invention, taking the non-ingress chip3 as an example, after the chip3 receives the message, because the chip is a non-ingress chip, that is, the received message comes from the stack port, thus, the message does not need to be mirrored again, and only the information carried by the message diffused to the current chip by the ingress chip through mirroring needs to be directly analyzed for forwarding, so as to meet the requirement, and thus, the MAC address learning message is prevented from being mirrored to multiple chips for multiple times.
In a preferred embodiment of the present invention, the method further comprises: and in the process of copying the stack head file to the multicast forwarding group pointed by the mirror image configuration, intercepting the stack head file of the mirror image according to a preset storage space so as to reduce the bandwidth overhead in the process of learning the MAC address.
Specifically, the truncation function in the multiplexing chip truncates the mirrored message into 128 bytes or 64 bytes, so as to further reduce the bandwidth overhead in the MAC learning process.
Referring to fig. 6, in an embodiment of the present invention, an apparatus for MAC address learning in a stack system includes: an initialization module 100, a learning module 200, and a processing module 300.
The initialization module 100 is configured to create a multicast forwarding group for chips in a stacking system when initializing the chips, where members of the multicast forwarding group are stacking ports corresponding to each chip; and creating a mirror image configuration for each chip, wherein the destination of the mirror image configuration of each chip is a multicast forwarding group.
Referring to fig. 4, in a specific embodiment of the present invention, when a stacking system is initialized, the initialization module 100 creates a multicast forwarding group for chips in the stacking system, where the stacking system includes 4 chips, which are respectively: chip1, Chip2, Chip3 and Chip4, wherein Chip1 represents an entry Chip, the multicast forwarding group is represented by capital letter G, and correspondingly, the multicast forwarding group corresponding to each Chip is represented as:
Chip1:G->{chip1_p1,chip1_p2}
Chip2:G->{chip2_p1,chip2_p2}
Chip3:G->{chip3_p1,chip3_p2}
Chip4:G->{chip4_p1,chip4_p2}
it will be appreciated that multicast replication in a stacked system has a well-established mechanism for putting a ring, and therefore no loops occur.
Further, the initialization module 100 creates a mirror configuration for each chip, which is denoted by MirrorG, the destination of which is a multicast forwarding group G.
It should be noted that the multicast forwarding group created by the initialization module 100 and the created mirror configuration are both configured only in a fixed manner during chip initialization, and in the subsequent use process, the specific content of the multicast forwarding group and the created mirror configuration may be infinitely changed according to the specific processing procedure of the chip.
The learning module 200 is configured to determine whether a current chip needs to perform MAC address learning after any chip receives a message; if not, only the message needs to be forwarded; if yes, after the message is forwarded, MAC address learning is carried out in the current chip.
In the specific embodiment of the present invention, the chip receiving the message may be any chip in the above stacking system, where the first chip corresponding to the message when initially entering the stacking system is an entry chip, and the port interconnecting the chips is a stacking port, and when the message enters the stacking system through the entry chip, the message may be forwarded through the corresponding stacking port and the panel port. As shown in FIG. 4, continuing with the above example, messages enter the stacked system from Chip1, thus, Chip1 represents the ingress Chip.
In a preferred embodiment of the present invention, the learning module 200 is configured to determine whether the current chip needs to perform MAC address learning, and specifically includes: parsing the packet to obtain a lookup key, the lookup key comprising: MacSa and vlan id; searching an FDB address table by using a search keyword corresponding to the current message, and judging whether the current chip needs to carry out MAC address learning or not through the obtained srcPort, wherein the srcPort records a panel port when the message enters a stacking system.
The message itself can carry various information, and the learning module 200 can obtain corresponding information as required by analyzing the message; the message information includes: ethernet information, network layer information, transport layer information, and additional information; the Ethernet information comprises: destination MAC, source MAC, VLanID; the network layer information includes: a target IP, a source IP, a service type ToS, a generation period TTL and a transmission layer type; the transport layer information includes: a source port, a destination port; the additional information includes: data volume, flow starting time, flow ending time, a port of flow entering the network equipment and a port of flow leaving the network equipment; the message information further includes: MacSa, MacDa, IpSA, IpDa, L4Type, L4SrcPort, L4 DestPort; wherein MacSa represents a source device hardware address; MacDa represents a hardware address of the destination device; the ip sa represents a source device internet protocol address; IpDa represents the destination device internet protocol address; l4Type represents an internet protocol Type; l4SrcPort represents the source device internet protocol port number; l4DestPort denotes the destination device internet protocol port number.
Further, the learning module 200 is further configured to search the FDB address table by using the lookup keyword corresponding to the current packet, and determine whether the current chip needs to perform MAC address learning according to the obtained srcPort.
After searching the FDB address table by searching the keywords, the learning module 200 does not need to learn the MAC address if the obtained src port is consistent with the port of the message entering the current chip; if the obtained src port is inconsistent with the port of the message entering the current chip, MAC address learning is required to be performed so as to update the src port; if srcPort is not obtained, MAC address learning is required.
The processing module 300 is configured to determine whether a port where a message enters the current chip is a stacking port after the current chip performs MAC address learning, and if not, perform mirror image processing on the message received by the current chip according to the created mirror image configuration to diffuse information obtained by MAC address learning to all chips in the stacking system; if yes, directly analyzing the information carried by the message diffused to the current chip in the mirror image processing mode for forwarding so as to diffuse the information obtained by MAC address learning to all chips in the stacking system.
In the specific embodiment of the present invention, the first chip corresponding to the first time when the message enters the stacking system is an inlet chip, and for the inlet chip, the port where the message enters the inlet chip is a non-stacking port; when a message enters from one chip to another chip, the message enters through the stacking port, so that in the stacking system, the same message enters through the stacking port except the inlet chip and enters into other non-inlet chips.
Thus, when the ingress chip receives the message and the current chip learns the MAC address, the processing module 300 performs mirror processing on the message received by the ingress chip according to the created mirror configuration, so as to diffuse the information obtained by the MAC address learning to all chips in the stack system.
When the non-ingress chip is learned by the MAC address, the processing module 300 directly analyzes the information carried by the message diffused to the current non-ingress chip by the ingress chip in the mirror image manner, and forwards the information, so as to diffuse the information obtained by the MAC address learning to all chips in the stacking system.
In a preferred embodiment of the present invention, for an ingress chip, after MAC address learning, mirror processing is performed on a received message according to created mirror configuration, so as to diffuse information obtained by MAC address learning to all chips in a stacking system, in the process, the processing module 300 is further configured to analyze the message through the ingress chip, and obtain a stack header file carried by the message, where the stack header file includes: information such as srcPort, vlan id, destPort, destGroup, and the like; and copying the stack header file to a multicast forwarding group pointed by the mirror image configuration to complete mirror image processing. The srcPort is used for recording a panel port when a message enters a stacking system, and MAC address learning can be used; the vlan Id is used for recording the vlan to which the message belongs, possibly carried by the message, or defaultVlan on a panel port, and MAC address learning is used; the destPort is used for recording a panel port to which the message should be forwarded, the destPort is specified by the entrance chip, and the subsequent chips are directly used without modification; the destGroup is used for recording a multicast forwarding group to which the message should be forwarded, an outlet in the multicast group is designated by an inlet chip, and a subsequent chip is used without modification.
Correspondingly, for a non-entry chip, the destGroup information carried by the stack header file is directly called to be forwarded, and the purpose of forwarding can be achieved.
As shown in fig. 4, continuing with the above example, Chip1 is an ingress Chip, if the processing module 300 determines that it needs MAC address learning, after the packet is forwarded normally, it mirrors the packet to MirrorG, and since the destination of the mirrored MirrorG is the multicast group G, the corresponding egress Chip1_ p1 and Chip1_ p2 can be obtained by looking up the G table, and further, the packet will be diffused from Chip1_ p1 and Chip1_ p2 to the non-ingress chips Chip2 and Chip3, respectively.
Furthermore, in the preferred embodiment of the present invention, taking the non-ingress chip3 as an example, after the chip3 receives the message, because the chip is a non-ingress chip, that is, the received message comes from the stack port, thus, the message does not need to be mirrored again, and only the information carried by the message diffused to the current chip by the ingress chip through mirroring needs to be directly analyzed for forwarding, so as to meet the requirement, and thus, the MAC address learning message is prevented from being mirrored to multiple chips for multiple times.
In a preferred embodiment of the present invention, the processing module 300 is further configured to perform a truncation process on the mirrored stack header file according to a predetermined storage space in the process of copying the stack header file to the multicast forwarding group pointed by the mirror configuration, so as to reduce bandwidth overhead in the MAC address learning process.
Specifically, the processing module 300 multiplexes a cut-off function in the chip, and cuts off the mirrored message into 128 bytes or 64 bytes, so as to further reduce the bandwidth overhead in the MAC learning process.
In summary, according to the method and the device for learning the MAC address in the stacking system, the whole stacking system does not need a CPU to participate in the MAC learning process, and the MAC address learning is simply realized by multiplexing the functions of the existing chip, thereby reducing the difficulty and the cost for realizing the chip.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the modules in the system described above may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
The above described system embodiments are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts shown as modules are logic modules, i.e. may be located in one module in the chip logic, or may be distributed to a plurality of data processing modules in the chip. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The application can be used in a plurality of general-purpose or special-purpose communication chips. For example: switch chips, router chips, server chips, and the like.
It should be understood that although the present description refers to embodiments, not every embodiment contains only a single technical solution, and such description is for clarity only, and those skilled in the art should make the description as a whole, and the technical solutions in the embodiments can also be combined appropriately to form other embodiments understood by those skilled in the art.
The above-listed detailed description is only a specific description of a possible embodiment of the present invention, and they are not intended to limit the scope of the present invention, and equivalent embodiments or modifications made without departing from the technical spirit of the present invention should be included in the scope of the present invention.

Claims (6)

1. A method for MAC address learning in a stacked system, the method comprising:
when initializing a chip, establishing a multicast forwarding group for the chip in the stacking system, wherein the members of the multicast forwarding group are stacking ports corresponding to each chip; creating mirror image configuration for each chip, wherein the destination of the mirror image configuration of each chip is a multicast forwarding group;
after any chip receives the message, judging whether the current chip needs to carry out MAC address learning or not;
if not, only the message needs to be forwarded;
if yes, after the message is forwarded, MAC address learning is carried out in the current chip;
after the current chip performs MAC address learning, the method further includes: judging whether the port of the message entering the current chip is a stacking port or not,
if not, carrying out mirror image processing on the message received by the current chip according to the created mirror image configuration so as to diffuse the information obtained by MAC address learning to all chips in the stacking system;
if yes, directly analyzing the information carried by the message diffused to the current chip in the mirror image processing mode for forwarding so as to diffuse the information obtained by MAC address learning to all chips in the stacking system;
the "performing mirror image processing on the message received by the current chip according to the created mirror image configuration" specifically includes:
analyzing the message, and acquiring a stack header file carried by the message, wherein the stack header file comprises: srcPort, vlan id, destPort and destGroup information;
copying the stack header file to a multicast forwarding group pointed by the mirror image configuration;
the srcPort records a panel port when a message enters a stacking system;
the vlan Id is used for recording the vlan to which the message belongs;
the destPort represents a panel port to which the message should be forwarded;
the destGroup is used for recording the multicast forwarding group to which the message should be forwarded.
2. The method for MAC address learning in a stacking system according to claim 1,
the "directly analyzing and forwarding the information carried by the message diffused to the current chip by the mirror image processing mode" specifically includes:
and forwarding according to the destGroup information carried by the stacking header file.
3. The method for MAC address learning in a stacking system of claim 2, wherein the method further comprises:
and in the process of copying the stack header file to a multicast forwarding group pointed by the mirror image configuration, intercepting the message of the mirror image according to a preset storage space so as to reduce the bandwidth overhead in the process of learning the MAC address.
4. An apparatus for MAC address learning in a stacked system, the apparatus comprising:
the initialization module is used for establishing a multicast forwarding group for the chips in the stacking system when the chips are initialized, and the members of the multicast forwarding group are stacking ports corresponding to each chip; creating mirror image configuration for each chip, wherein the destination of the mirror image configuration of each chip is a multicast forwarding group;
the learning module is used for judging whether the current chip needs to carry out MAC address learning or not after any chip receives the message;
if not, only the message needs to be forwarded;
if yes, after the message is forwarded, MAC address learning is carried out in the current chip;
the processing module is used for judging whether the port of the message entering the current chip is a stacking port or not after the current chip performs MAC address learning,
if not, carrying out mirror image processing on the message received by the current chip according to the created mirror image configuration so as to diffuse the information obtained by MAC address learning to all chips in the stacking system;
if yes, directly analyzing the information carried by the message diffused to the current chip in the mirror image processing mode for forwarding so as to diffuse the information obtained by MAC address learning to all chips in the stacking system;
the processing module is specifically configured to, when performing mirror processing on a message received by a current chip according to a created mirror configuration:
analyzing the message, and acquiring a stack header file carried by the message, wherein the stack header file comprises: srcPort, vlan id, destPort and destGroup information;
if the port of the message entering the current chip is judged to be a non-stack port, copying the stack header file to a multicast forwarding group pointed by the mirror image configuration;
the srcPort records a panel port when a message enters a stacking system;
the vlan Id is used for recording the vlan to which the message belongs;
the destPort represents a panel port to which the message should be forwarded;
the destGroup is used for recording the multicast forwarding group to which the message should be forwarded.
5. The apparatus for MAC address learning in a stacking system of claim 4, wherein the processing module is specifically configured to:
and if the port of the message entering the current chip is judged to be a stacking port, forwarding according to destGroup information carried by the stacking header file.
6. The apparatus for MAC address learning in a stacking system of claim 5, wherein the processing module is further configured to:
and in the process of copying the stack header file to a multicast forwarding group pointed by the mirror image configuration, intercepting the message of the mirror image according to a preset storage space so as to reduce the bandwidth overhead in the process of learning the MAC address.
CN201810911587.XA 2018-08-10 2018-08-10 Method and system for learning MAC address in stacking system Active CN109067673B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810911587.XA CN109067673B (en) 2018-08-10 2018-08-10 Method and system for learning MAC address in stacking system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810911587.XA CN109067673B (en) 2018-08-10 2018-08-10 Method and system for learning MAC address in stacking system

Publications (2)

Publication Number Publication Date
CN109067673A CN109067673A (en) 2018-12-21
CN109067673B true CN109067673B (en) 2021-03-30

Family

ID=64683510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810911587.XA Active CN109067673B (en) 2018-08-10 2018-08-10 Method and system for learning MAC address in stacking system

Country Status (1)

Country Link
CN (1) CN109067673B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109672618B (en) * 2019-01-18 2021-07-06 新华三技术有限公司合肥分公司 Redundant interface processing method, device, server and storage medium
CN113242481B (en) * 2021-06-29 2022-04-19 烽火通信科技股份有限公司 MAC address synchronization method and device of OLT equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101895471A (en) * 2010-07-15 2010-11-24 中兴通讯股份有限公司 Network equipment and data processing method for same
CN103354529A (en) * 2013-07-10 2013-10-16 杭州华三通信技术有限公司 Path selecting method and device
CN103414773A (en) * 2013-08-12 2013-11-27 杭州华三通信技术有限公司 Stacking system MAC address information synchronizing method and device
CN104410575A (en) * 2014-12-05 2015-03-11 盛科网络(苏州)有限公司 Device and method for MAC address hardware learning in multi-chip stacking mode
EP3316555A1 (en) * 2015-06-29 2018-05-02 ZTE Corporation Mac address synchronization method, device and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101895471A (en) * 2010-07-15 2010-11-24 中兴通讯股份有限公司 Network equipment and data processing method for same
CN103354529A (en) * 2013-07-10 2013-10-16 杭州华三通信技术有限公司 Path selecting method and device
CN103414773A (en) * 2013-08-12 2013-11-27 杭州华三通信技术有限公司 Stacking system MAC address information synchronizing method and device
CN104410575A (en) * 2014-12-05 2015-03-11 盛科网络(苏州)有限公司 Device and method for MAC address hardware learning in multi-chip stacking mode
EP3316555A1 (en) * 2015-06-29 2018-05-02 ZTE Corporation Mac address synchronization method, device and system

Also Published As

Publication number Publication date
CN109067673A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
US7389359B2 (en) Method and system for intelligently forwarding multicast packets
US6147995A (en) Method for establishing restricted broadcast groups in a switched network
US10887119B2 (en) Multicasting within distributed control plane of a switch
US7933268B1 (en) IP multicast forwarding in MAC bridges
US6735201B1 (en) Efficient network multicast switching apparatus and methods
EP2100406B1 (en) Method and apparatus for implementing multicast routing
US7783733B1 (en) Method and apparatus for dynamic configuration management
US7095741B1 (en) Port isolation for restricting traffic flow on layer 2 switches
CN110647698B (en) Page loading method and device, electronic equipment and readable storage medium
US6757279B1 (en) Method for synchronizing databases in stacked network units
EP2369782B1 (en) Multicasting within a distributed control plane of a switch
JP2000156708A (en) Network-switching system
US20120177051A1 (en) Data forwarding method, data processing method, system and relevant devices
CN106685827B (en) Downlink message forwarding method and AP (access point) equipment
US6980547B1 (en) Distributed switch/router silicon engine
CN109067673B (en) Method and system for learning MAC address in stacking system
CN112600752A (en) Chip implementation method of default policy routing, chip processing method and device of data message
US20030142672A1 (en) Data packet transmission method and network switch applying same thereto
CN111107008A (en) Reverse path checking method and device
US9654304B2 (en) Method and apparatus for sending transparent interconnection of lots of links data frame
CN109194777B (en) Method and device for aging MAC address in stacking system
CN114422437A (en) Method and device for forwarding heterogeneous messages
CN110516141B (en) Data query method and device, electronic equipment and readable storage medium
CN110062259B (en) Video acquisition method, system, device and computer readable storage medium
CN110611654B (en) Link generation method and device for conference signaling, electronic equipment and storage medium

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 215000 unit 13 / 16, 4th floor, building B, No.5 Xinghan street, Suzhou Industrial Park, Jiangsu Province

Patentee after: Suzhou Shengke Communication Co.,Ltd.

Address before: Xinghan Street Industrial Park of Suzhou city in Jiangsu province 215021 B No. 5 Building 4 floor 13/16 unit

Patentee before: CENTEC NETWORKS (SU ZHOU) Co.,Ltd.