CN110995621B - Method and switch for selecting uplink port to communicate - Google Patents

Method and switch for selecting uplink port to communicate Download PDF

Info

Publication number
CN110995621B
CN110995621B CN201911143103.2A CN201911143103A CN110995621B CN 110995621 B CN110995621 B CN 110995621B CN 201911143103 A CN201911143103 A CN 201911143103A CN 110995621 B CN110995621 B CN 110995621B
Authority
CN
China
Prior art keywords
port
uplink
ports
aggregation group
cascade
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
CN201911143103.2A
Other languages
Chinese (zh)
Other versions
CN110995621A (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.)
Ruijie Networks Co Ltd
Original Assignee
Ruijie Networks 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 Ruijie Networks Co Ltd filed Critical Ruijie Networks Co Ltd
Priority to CN201911143103.2A priority Critical patent/CN110995621B/en
Publication of CN110995621A publication Critical patent/CN110995621A/en
Application granted granted Critical
Publication of CN110995621B publication Critical patent/CN110995621B/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/70Virtual switches
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/15Interconnection of switching modules
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports

Abstract

The invention provides a method and a switch for selecting an uplink port to communicate, wherein the method is applied to a first switch connected with a superior switch through the uplink port and comprises the following steps: the n uplink ports respectively receive protocol messages respectively sent by the m cascade ports of the superior switch, the protocol messages comprise MAC addresses of the cascade ports and port index information of the cascade ports, the MAC addresses of the cascade ports are global MAC addresses of the superior switch, and m and n are natural numbers greater than or equal to 2; when the MAC address, the port index information and the priority of the cascade port in the protocol message respectively received by the n uplink ports are the same, adding the n uplink ports into the same first aggregation group; and taking the first aggregation group as a specific uplink port, and selecting the uplink port for transmitting the data message from the specific uplink port and other uplink ports which are not in the first aggregation group, so that the number of MAC addresses required to be allocated when each switch leaves a factory is reduced.

Description

Method and switch for selecting uplink port to communicate
Technical Field
The invention relates to the field of data communication, in particular to a method and a switch for selecting an uplink port to communicate.
Background
802.1BR is a standard protocol defined by the IEEE standardization organization, also known as BPE (Bridge Port Extension), and is a device-level vertical virtualization technology capable of improving the access capability and management efficiency of the network access layer.
An 802.1BR network consists of Parent devices (Parent devices) and PE (Port extender) devices. The 802.1BR connects a plurality of low-cost box-type PE devices to a father device, virtualizes each PE device into a remote service board card of the father device, and the father device manages the PE devices in a unified way, so that the network topology is simplified, and the network maintenance cost is reduced.
The parent device: the virtual switch equipment is independent switch equipment, and can also be single virtual switch equipment consisting of a plurality of switches.
PE equipment: typically low cost box switch devices.
Cascade Port: also called a cascade interface, is an interface on a parent device connected to a PE device.
Upstream Port: also called an upstream port, is an interface on a PE device for connecting a parent device, and the PE device may have a plurality of upstream ports.
Extended Port: the PE device is also called an extension port, and is an interface for connecting a terminal device such as a PC to the PE device.
It is possible that a PE device is connected to the same parent device through multiple ports.
It is also possible that one PE device is connected to multiple different parent devices through multiple ports.
In the case of a PE device with multiple upstream ports, the 802.1BR standard specifies that only one of the upstream ports can be selected as the actual upstream port. For the selection mechanism of the upstream port, the convention of the standard is as follows:
the assignment may be manually configured or may be automatically selected, with manual configuration being preferred over automatic selection.
For automatic selection, which cascade interface has high priority, the corresponding uplink interface is selected as the real uplink interface; and if the priorities are the same, selecting the uplink port corresponding to the cascade port with the small MAC address as the real uplink port.
As described above, the rules for PE to automatically select an upstream port are: "which cascade interface has high priority, then select the corresponding uplink interface as the real uplink interface; and if the priority is the same, selecting the uplink port corresponding to the cascade port with the small MAC address as the real uplink port. Because the priorities of the cascade ports are generally the same in a default situation, MAC addresses of different cascade ports must be different (otherwise, a standard uplink port automatic selection mechanism will not work normally), which results in that when each switch leaves the factory, more MAC addresses need to be allocated (similar to network card MAC addresses, the switch MAC addresses are generally fixed in the firmware of the switch when the switch leaves the factory, and the range of MAC addresses that can be used by each manufacturer is allocated by a standardization organization and is limited).
Disclosure of Invention
In order to solve the technical problem, the embodiment of the invention adopts the following technical scheme:
a method for selecting an uplink port to communicate is applied to a first switch connected with a superior switch through the uplink port, and comprises the following steps:
the method comprises the steps that n uplink ports respectively receive protocol messages respectively sent by m cascade ports of a superior switch, wherein the protocol messages comprise MAC addresses of the cascade ports and port index information of the cascade ports, the MAC addresses of the cascade ports are global MAC addresses of the superior switch, and m and n are natural numbers larger than or equal to 2;
when the MAC address, the port index information and the priority of the cascade port in the protocol messages respectively received by the n uplink ports are the same, adding the n uplink ports into the same first aggregation group;
and taking the first aggregation group as a specific uplink port, and selecting an uplink port for transmitting the data message from the specific uplink port and other uplink ports which are not in the first aggregation group.
Alternatively to this, the first and second parts may,
when the superior switch is a virtual switch composed of a plurality of physical switches, the MAC address of a main switch in the virtual switch is the global MAC address of the superior switch;
and when the superior switch is a physical switch, the MAC address of the superior switch is the global MAC address of the superior switch.
Alternatively to this, the first and second parts may,
when the cascade port is a member port of a second aggregation group, the port index information of the cascade port is the port index information of the second aggregation group;
and when the cascade port is not a member port of any aggregation group, the port index information of the cascade port is the port index information of the cascade port.
Optionally, the step of adding the n uplink ports to the same first aggregation group when the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the n uplink ports respectively are the same includes:
when the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information, and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port is not added to the first aggregation group, and the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the other uplink ports are the same, the first uplink port is added to the first aggregation group until n uplink ports are added to the same first aggregation group according to the method of adding the first uplink port to the first aggregation group.
Optionally, the step of adding the n uplink ports to the same first aggregation group when the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the n uplink ports respectively are the same includes:
when the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information, and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port has been added to the third aggregation group, grouping the member ports in the third aggregation group, setting the uplink ports having the same priority of the cascade port, the MAC address, and the port index information of the cascade port in the protocol message received respectively as a group, counting the number of the member ports in each group, selecting the member port of the first group from each group and retaining the member port in the third aggregation group to form the first aggregation group, where the number of the member ports in the first aggregation group is n, and all the member ports of other groups exit the third aggregation group.
Optionally, the step of selecting a member port of the first packet from the packets and reserving the member port in the third aggregation group to form the first aggregation group specifically includes:
preferentially selecting the member port of the group with the largest number of member ports from all the groups to remain in the third aggregation group to form a first aggregation group; if the number of member ports of each group is the same, the member ports of any one group are kept in the third aggregation group to form the first aggregation group.
Optionally, the step of using the first aggregation group as a specific uplink port, and selecting an uplink port for transmitting a data packet from the specific uplink port and other uplink ports not in the first aggregation group specifically includes:
traversing the specific uplink port and other uplink ports which are not in the first aggregation group, comparing the priorities of the specific uplink port and other uplink ports which are not in the first aggregation group, and selecting the uplink port with the higher priority as the uplink port for transmitting the data message.
Optionally, the method further includes:
and when the priority and the bandwidth of the specific uplink port are the same as those of other uplink ports which are not in the first aggregation group, selecting the uplink port which is already transmitting the data message as the uplink port for transmitting the data message.
Another aspect of the embodiments of the present invention is to provide a switch for selecting an uplink port to perform communication, where the switch is connected to a higher-level switch through the uplink port, and the switch includes:
the system comprises n uplink ports and a superior switch, wherein the n uplink ports are used for respectively receiving protocol messages respectively sent by m cascade ports of the superior switch, the protocol messages comprise MAC addresses of the cascade ports and port index information of the cascade ports, the MAC addresses of the cascade ports are global MAC addresses of the superior switch, and m and n are natural numbers more than or equal to 2;
an aggregation group establishing module, configured to add the n uplink ports to a same first aggregation group when the MAC address of the cascade port, the port index information, and the priority of the cascade port in the protocol message received by the n uplink ports, respectively, are the same;
and an uplink port selection module, configured to use the first aggregation group as a specific uplink port, and select an uplink port for transmitting a data packet from the specific uplink port and other uplink ports that are not in the first aggregation group.
Alternatively to this, the first and second parts may,
when the superior switch is a virtual switch composed of a plurality of physical switches, the MAC address of a main switch in the virtual switch is the global MAC address of the superior switch;
and when the superior switch is a physical switch, the MAC address of the superior switch is the global MAC address of the superior switch.
Alternatively to this, the first and second parts may,
when the cascade port is a member port of a second aggregation group, the port index information of the cascade port is the port index information of the second aggregation group;
and when the cascade port is not a member port of any aggregation group, the port index information of the cascade port is the port index information of the cascade port.
Optionally, the aggregation group establishment module is specifically configured to:
when the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information, and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port is not added to the first aggregation group, and the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the other uplink ports are the same, the first uplink port is added to the first aggregation group until n uplink ports are added to the same first aggregation group according to the method of adding the first uplink port to the first aggregation group.
Optionally, the aggregation group establishment module is specifically configured to:
when the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information, and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port has been added to the third aggregation group, grouping the member ports in the third aggregation group, setting the uplink ports having the same priority of the cascade port, the MAC address, and the port index information of the cascade port in the protocol message received respectively as a group, counting the number of the member ports in each group, selecting the member port of the first group from each group and retaining the member port in the third aggregation group to form the first aggregation group, where the number of the member ports in the first aggregation group is n, and all the member ports of other groups exit the third aggregation group.
Alternatively to this, the first and second parts may,
the aggregation group establishment module is specifically configured to: when the MAC address, the port index information and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port is added into a third aggregation group, grouping member ports in the third aggregation group, setting uplink ports with the same priority of the cascade port, the MAC address of the cascade port and the port index information in the protocol message received respectively as a group, counting the number of the member ports in each group, and preferentially selecting the member port of the group with the largest number of the member ports from each group to be kept in the third aggregation group to form the first aggregation group; and if the number of the member ports of each group is the same, the member ports of any one group are kept in the third aggregation group to form a first aggregation group, the number of the member ports in the first aggregation group is n, and the member ports of other groups all exit the third aggregation group.
Optionally, the uplink port selection module is specifically configured to:
traversing the specific uplink port and other uplink ports which are not in the first aggregation group, comparing the priorities of the specific uplink port and other uplink ports which are not in the first aggregation group, and selecting the uplink port with the higher priority as the uplink port for transmitting the data message.
Optionally, the uplink port selecting module is further configured to:
and when the priority and the bandwidth of the specific uplink port are the same as those of other uplink ports which are not in the first aggregation group, selecting the uplink port which is already transmitting the data message as the uplink port for transmitting the data message.
The method has the advantages that the mechanism that the Port Extender automatically selects the uplink Port is optimized, the quantity of the MAC addresses which need to be distributed when each switch leaves the factory can be reduced, the method is better suitable for the scene that the father equipment is a single virtual switch device consisting of a plurality of switches, and the uplink Port with large bandwidth can be preferentially selected as the real uplink Port.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart of a method provided by an embodiment of the present invention;
FIG. 2 is a block diagram of an apparatus according to an embodiment of the present invention;
FIG. 3 is a system block diagram according to an embodiment of the present invention;
FIG. 4 is a system block diagram according to an embodiment of the present invention;
fig. 5 is a system structure diagram according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
An embodiment of the present invention provides a method for selecting an uplink port to perform communication, where the method is applied to a first switch connected to a superior switch through the uplink port, and as shown in fig. 1, the method includes:
s101, n uplink ports respectively receive protocol messages respectively sent by m cascade ports of a superior switch, wherein the protocol messages comprise MAC addresses of the cascade ports and port index information of the cascade ports, the MAC addresses of the cascade ports are global MAC addresses of the superior switch, and m and n are natural numbers greater than or equal to 2;
s103, when the MAC address, the port index information and the priority of the cascade port in the protocol message respectively received by the n uplink ports are the same, adding the n uplink ports into the same first aggregation group;
and S105, taking the first aggregation group as a specific uplink port, and selecting an uplink port for transmitting the data message from the specific uplink port and other uplink ports which are not in the first aggregation group.
Optionally, when the upper level switch is a virtual switch composed of a plurality of physical switches, the MAC address of the master switch in the virtual switch is the global MAC address of the upper level switch;
and when the superior switch is a physical switch, the MAC address of the superior switch is the global MAC address of the superior switch.
Alternatively to this, the first and second parts may,
when the cascade port is a member port of a second aggregation group, the port index information of the cascade port is the port index information of the second aggregation group;
and when the cascade port is not a member port of any aggregation group, the port index information of the cascade port is the port index information of the cascade port.
Optionally, step S103 specifically includes:
when the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information, and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port is not added to the first aggregation group, and the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the other uplink ports are the same, the first uplink port is added to the first aggregation group until n uplink ports are added to the same first aggregation group according to the method of adding the first uplink port to the first aggregation group.
Optionally, step S103 specifically includes:
when the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information, and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port has been added to the third aggregation group, grouping the member ports in the third aggregation group, setting the uplink ports having the same priority of the cascade port, the MAC address, and the port index information of the cascade port in the protocol message received respectively as a group, counting the number of the member ports in each group, selecting the member port of the first group from each group and retaining the member port in the third aggregation group to form the first aggregation group, where the number of the member ports in the first aggregation group is n, and all the member ports of other groups exit the third aggregation group.
Optionally, the step of selecting a member port of the first packet from the packets and reserving the member port in the third aggregation group to form the first aggregation group specifically includes:
preferentially selecting the member port of the group with the largest number of member ports from all the groups to remain in the third aggregation group to form a first aggregation group; if the number of member ports of each group is the same, the member ports of any one group are kept in the third aggregation group to form the first aggregation group.
Optionally, step S105 specifically includes:
traversing the specific uplink port and other uplink ports which are not in the first aggregation group, comparing the priorities of the specific uplink port and other uplink ports which are not in the first aggregation group, and selecting the uplink port with the higher priority as the uplink port for transmitting the data message.
Optionally, the method further includes:
and when the priority and the bandwidth of the specific uplink port are the same as those of other uplink ports which are not in the first aggregation group, selecting the uplink port which is already transmitting the data message as the uplink port for transmitting the data message.
Thus, the variation of the uplink port can be reduced as much as possible, and the stability of the network can be kept.
Optionally, there are several methods for selecting the uplink port (i.e. the uplink port actually used for transmitting data):
A. if the priority of all the uplink ports is the same, comparing the bandwidths of all the uplink ports, and selecting the uplink port with the largest bandwidth as the real uplink port.
B. If the priorities and bandwidths of all the uplink ports are the same and no real uplink port exists, further judging the MAC addresses of the uplink ports, and selecting the uplink port with the small MAC address as the real uplink port.
C. If the priority, bandwidth and MAC address of all the uplink ports are the same and no real uplink port exists, further judging the port index of the corresponding cascade port of the uplink port, and selecting the port with the smaller port index value as the real uplink port.
After selecting the real uplink port, if a new uplink port appears, a mechanism for reselecting the real uplink port needs to be triggered, which includes the following steps:
A. if a certain uplink port originally cannot receive the protocol message and can now receive the protocol message, the port is considered to be changed into a new uplink port.
B. If the uplink port 1 and the uplink port 2 can both receive the protocol message and are automatically aggregated to be the aggregation port a, the aggregation port a is considered to be a new uplink port.
Because the uplink port 1 and the uplink port 2 have already added the aggregation port a, only the aggregation port a participates in the real uplink port election, and the uplink port 1 and the uplink port 2 do not participate in the real uplink port election any more.
C. If the upstream port 1 exits from the aggregation port a on the basis of step B (that is, the upstream port 1 is still an upstream port at the time of exiting), the upstream port 1 is considered as a new upstream port.
D. If the DOWN port is DOWN or the protocol message cannot be received for a long time, the up port is no longer considered as the up port. If the upstream port is automatically added to the aggregation port, the upstream port will be withdrawn from the aggregation port, and the upstream port will not be considered as the upstream port when the upstream port is withdrawn. If the automatically created aggregation port has no member port, the automatically created aggregation port is automatically deleted.
If a true upstream port becomes unavailable, two situations are included:
A. if the port is a non-aggregation port, when the port DOWN is dropped or the protocol message cannot be received for a long time, the uplink port is considered to be unavailable.
B. If it is an aggregation port, when the aggregation port DOWN is dropped or deleted, the upstream port is considered to be unavailable.
At this time, it is necessary to trigger the reselection of the real uplink port, and certainly, if the information such as the priority and the bandwidth of the existing uplink port changes, it is necessary to trigger the reselection of the real uplink port.
The method has the advantages that the mechanism that the Port Extender automatically selects the uplink Port is optimized, the quantity of the MAC addresses which need to be distributed when each switch leaves the factory can be reduced, the method is better suitable for the scene that the father equipment is a single virtual switch device consisting of a plurality of switches, and the uplink Port with large bandwidth can be preferentially selected as the real uplink Port.
Another aspect of the embodiments of the present invention is to provide a switch for selecting an uplink port to perform communication, where the switch is connected to a higher-level switch through the uplink port, as shown in fig. 2, and the switch includes:
n uplink ports 201, configured to receive protocol packets sent by m cascade ports of the upper level switch, respectively, where the protocol packets include an MAC address of the cascade port and port index information of the cascade port, the MAC address of the cascade port is a global MAC address of the upper level switch, and m and n are natural numbers greater than or equal to 2;
an aggregation group establishing module 203, configured to add the n uplink ports to a same first aggregation group when the MAC address of the cascade port, the port index information, and the priority of the cascade port in the protocol message received by the n uplink ports respectively are the same;
an uplink port selecting module 205, configured to use the first aggregation group as a specific uplink port, and select an uplink port for transmitting a data packet from the specific uplink port and other uplink ports that are not in the first aggregation group.
Alternatively to this, the first and second parts may,
when the superior switch is a virtual switch composed of a plurality of physical switches, the MAC address of a main switch in the virtual switch is the global MAC address of the superior switch;
and when the superior switch is a physical switch, the MAC address of the superior switch is the global MAC address of the superior switch.
Alternatively to this, the first and second parts may,
when the cascade port is a member port of a second aggregation group, the port index information of the cascade port is the port index information of the second aggregation group;
and when the cascade port is not a member port of any aggregation group, the port index information of the cascade port is the port index information of the cascade port.
Optionally, the aggregation group establishing module 203 is specifically configured to:
when the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information, and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port is not added to the first aggregation group, and the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the other uplink ports are the same, the first uplink port is added to the first aggregation group until n uplink ports are added to the same first aggregation group according to the method of adding the first uplink port to the first aggregation group.
Optionally, the aggregation group establishing module 203 is specifically configured to:
when the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information, and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port has been added to the third aggregation group, grouping the member ports in the third aggregation group, setting the uplink ports having the same priority of the cascade port, the MAC address, and the port index information of the cascade port in the protocol message received respectively as a group, counting the number of the member ports in each group, selecting the member port of the first group from each group and retaining the member port in the third aggregation group to form the first aggregation group, where the number of the member ports in the first aggregation group is n, and all the member ports of other groups exit the third aggregation group.
Alternatively to this, the first and second parts may,
the aggregation group establishing module 203 is specifically configured to: when the MAC address, the port index information and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port is added into a third aggregation group, grouping member ports in the third aggregation group, setting uplink ports with the same priority of the cascade port, the MAC address of the cascade port and the port index information in the protocol message received respectively as a group, counting the number of the member ports in each group, and preferentially selecting the member port of the group with the largest number of the member ports from each group to be kept in the third aggregation group to form the first aggregation group; and if the number of the member ports of each group is the same, the member ports of any one group are kept in the third aggregation group to form a first aggregation group, the number of the member ports in the first aggregation group is n, and the member ports of other groups all exit the third aggregation group.
Optionally, the uplink port selecting module 205 is specifically configured to:
traversing the specific uplink port and other uplink ports which are not in the first aggregation group, comparing the priorities of the specific uplink port and other uplink ports which are not in the first aggregation group, and selecting the uplink port with the higher priority as the uplink port for transmitting the data message.
Optionally, the uplink port selecting module 205 is further configured to:
and when the priority and the bandwidth of the specific uplink port are the same as those of other uplink ports which are not in the first aggregation group, selecting the uplink port which is already transmitting the data message as the uplink port for transmitting the data message.
The method has the advantages that the mechanism that the Port Extender automatically selects the uplink Port is optimized, the quantity of the MAC addresses which need to be distributed when each switch leaves the factory can be reduced, the method is better suitable for the scene that the father equipment is a single virtual switch device consisting of a plurality of switches, and the uplink Port with large bandwidth can be preferentially selected as the real uplink Port.
The embodiments of the present invention are further described below with reference to several specific application scenarios.
Scene one
First, as shown in fig. 3, the parent device is a virtual switch system composed of device 1 and device 2,
secondly, when the virtual switch is in use, Gi0/1 and Gi0/2 are added into the aggregation port A, and the aggregation port A is configured as a cascade port.
And thirdly, Gi0/1 and Gi0/2 in the figure actively send protocol messages to the PE. The MAC address carried in the protocol packet is the MAC address of the device 1, and the port index carried is the index of the aggregation port a.
And fourthly, Gi0/3 and Gi0/4 of the PE receive the protocol messages with the same priority, wherein the MAC addresses are the MAC addresses of the equipment 1, and the port indexes are the port indexes of the aggregation port A, so that the aggregation port B is automatically created, and Gi0/3 and Gi0/4 are automatically added into the aggregation port B.
And fifthly, because the PE only has the unique upstream port of the aggregation port B, the aggregation port B is elected as the real upstream port of the PE.
Scene two
First, as shown in fig. 4, if, on the basis of scenario one, the device 1 and the device 2 are split into two independent devices, the two devices inherit the configuration of the original virtual switch, and therefore, the protocol packets are still sent to Gi0/1 and Gi 0/2.
Secondly, when Gi0/1 sends a protocol message, the MAC address carried in the message is the MAC address of the equipment 1; when Gi0/2 sends a protocol message, the MAC address carried in the message is the MAC address of device 2. Therefore, the MAC addresses carried by both will be different.
And thirdly, when Gi0/1 and Gi0/2 send protocol messages, the carried port indexes are the indexes of the aggregation port A. Since the two devices inherit the configuration of the original virtual switch, the indexes of the aggregation ports a of the two devices are the same. That is, when both send protocol packets, the carried port index values are still the same.
And fourthly, after receiving the protocol message, the PE side groups the member ports of the aggregation port B, wherein the first group only comprises Gi0/3, and the second group only comprises Gi 0/4. Since both groups contain exactly the same number of member ports, one group of member ports will optionally remain in aggregation port B, and given the choice of the first group, Gi0/3 will remain in aggregation port B and Gi0/4 will exit aggregation port B.
Fifthly, after Gi0/4 exits the aggregation port B, the bandwidth of the new upstream port Gi0/4 and the old upstream aggregation port B is changed, and therefore, the reselection of the real upstream port is triggered.
Sixth, because the priority and bandwidth of the upstream port Gi0/4 are the same as those of the upstream aggregation port B, the original true upstream port will be selected continuously, that is, the aggregation port B will continue to be the true upstream port.
Therefore, the PE can stably belong to the equipment 1 through the aggregation port B, thereby avoiding confusion of PE attribution and keeping the network stable and usable as much as possible.
Scene three
One, as shown in fig. 5, if on the basis of scenario one, if between the device 1 and PE, it is also interconnected through the link between Gi0/5 and Gi0/6, and the bandwidth of the link is equal to the bandwidth between Gi0/1 and Gi 0/3.
Second, the PE will preferentially select aggregation B as the true upstream because the bandwidth of aggregation B is greater than Gi 0/6.
Therefore, the uplink port with large bandwidth is preferentially selected as the real uplink port.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (16)

1. A method for selecting an upstream port for communication, which is applied to a first switch connected with a superior switch through the upstream port, includes:
the method comprises the steps that n uplink ports respectively receive protocol messages respectively sent by m cascade ports of a superior switch, wherein the protocol messages comprise MAC addresses of the cascade ports and port index information of the cascade ports, the MAC addresses of the cascade ports are global MAC addresses of the superior switch, and m and n are natural numbers larger than or equal to 2;
when the MAC address, the port index information and the priority of the cascade port in the protocol messages respectively received by the n uplink ports are the same, adding the n uplink ports into the same first aggregation group;
and taking the first aggregation group as a specific uplink port, and selecting an uplink port for transmitting the data message from the specific uplink port and other uplink ports which are not in the first aggregation group.
2. The method of claim 1,
when the superior switch is a virtual switch composed of a plurality of physical switches, the MAC address of a main switch in the virtual switch is the global MAC address of the superior switch;
and when the superior switch is a physical switch, the MAC address of the superior switch is the global MAC address of the superior switch.
3. The method of claim 1,
when the cascade port is a member port of a second aggregation group, the port index information of the cascade port is the port index information of the second aggregation group;
and when the cascade port is not a member port of any aggregation group, the port index information of the cascade port is the port index information of the cascade port.
4. The method according to claim 1, wherein the step of adding the n uplink ports into the same first aggregation group when the MAC address, the port index information, and the priority of the tandem port in the protocol packet received by the n uplink ports respectively are the same includes:
when the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information, and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port is not added to the first aggregation group, and the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the other uplink ports are the same, the first uplink port is added to the first aggregation group until n uplink ports are added to the same first aggregation group according to the method of adding the first uplink port to the first aggregation group.
5. The method according to claim 1, wherein the step of adding the n uplink ports into the same first aggregation group when the MAC address, the port index information, and the priority of the tandem port in the protocol packet received by the n uplink ports respectively are the same includes:
when the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information, and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port has been added to the third aggregation group, grouping the member ports in the third aggregation group, setting the uplink ports having the same priority of the cascade port, the MAC address, and the port index information of the cascade port in the protocol message received respectively as a group, counting the number of the member ports in each group, selecting the member port of the first group from each group and retaining the member port in the third aggregation group to form the first aggregation group, where the number of the member ports in the first aggregation group is n, and all the member ports of other groups exit the third aggregation group.
6. The method of claim 5, wherein the step of selecting the member port of the first packet from the packets to remain in the third aggregate group to form the first aggregate group specifically comprises:
preferentially selecting the member port of the group with the largest number of member ports from all the groups to remain in the third aggregation group to form a first aggregation group; if the number of member ports of each group is the same, the member ports of any one group are kept in the third aggregation group to form the first aggregation group.
7. The method according to claim 1, wherein the step of selecting the uplink port for transmitting the data packet from the specific uplink port and other uplink ports not in the first aggregation group by using the first aggregation group as the specific uplink port specifically includes:
traversing the specific uplink port and other uplink ports which are not in the first aggregation group, comparing the priorities of the specific uplink port and other uplink ports which are not in the first aggregation group, and selecting the uplink port with the higher priority as the uplink port for transmitting the data message.
8. The method of claim 7, further comprising:
and when the priority and the bandwidth of the specific uplink port are the same as those of other uplink ports which are not in the first aggregation group, selecting the uplink port which is already transmitting the data message as the uplink port for transmitting the data message.
9. A switch for selecting an upstream port for communication, the switch coupled to a superordinate switch via the upstream port, comprising:
the system comprises n uplink ports and a superior switch, wherein the n uplink ports are used for respectively receiving protocol messages respectively sent by m cascade ports of the superior switch, the protocol messages comprise MAC addresses of the cascade ports and port index information of the cascade ports, the MAC addresses of the cascade ports are global MAC addresses of the superior switch, and m and n are natural numbers more than or equal to 2;
an aggregation group establishing module, configured to add the n uplink ports to a same first aggregation group when the MAC address of the cascade port, the port index information, and the priority of the cascade port in the protocol message received by the n uplink ports, respectively, are the same;
and an uplink port selection module, configured to use the first aggregation group as a specific uplink port, and select an uplink port for transmitting a data packet from the specific uplink port and other uplink ports that are not in the first aggregation group.
10. The switch of claim 9,
when the superior switch is a virtual switch composed of a plurality of physical switches, the MAC address of a main switch in the virtual switch is the global MAC address of the superior switch;
and when the superior switch is a physical switch, the MAC address of the superior switch is the global MAC address of the superior switch.
11. The switch of claim 9,
when the cascade port is a member port of a second aggregation group, the port index information of the cascade port is the port index information of the second aggregation group;
and when the cascade port is not a member port of any aggregation group, the port index information of the cascade port is the port index information of the cascade port.
12. The switch of claim 9, wherein the aggregate group establishment module is specifically configured to:
when the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information, and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port is not added to the first aggregation group, and the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the other uplink ports are the same, the first uplink port is added to the first aggregation group until n uplink ports are added to the same first aggregation group according to the method of adding the first uplink port to the first aggregation group.
13. The switch of claim 9, wherein the aggregate group establishment module is specifically configured to:
when the MAC address, the port index information, and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information, and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port has been added to the third aggregation group, grouping the member ports in the third aggregation group, setting the uplink ports having the same priority of the cascade port, the MAC address, and the port index information of the cascade port in the protocol message received respectively as a group, counting the number of the member ports in each group, selecting the member port of the first group from each group and retaining the member port in the third aggregation group to form the first aggregation group, where the number of the member ports in the first aggregation group is n, and all the member ports of other groups exit the third aggregation group.
14. The switch of claim 13, wherein the switch is characterized by
The aggregation group establishment module is specifically configured to: when the MAC address, the port index information and the priority of the cascade port in the protocol message received by the first uplink port are changed from the MAC address, the port index information and the priority of the cascade port in the protocol message received in the previous round, and the first uplink port is added into a third aggregation group, grouping member ports in the third aggregation group, setting uplink ports with the same priority of the cascade port, the MAC address of the cascade port and the port index information in the protocol message received respectively as a group, counting the number of the member ports in each group, and preferentially selecting the member port of the group with the largest number of the member ports from each group to be kept in the third aggregation group to form the first aggregation group; and if the number of the member ports of each group is the same, the member ports of any one group are kept in the third aggregation group to form a first aggregation group, the number of the member ports in the first aggregation group is n, and the member ports of other groups all exit the third aggregation group.
15. The switch of claim 9, wherein the upstream port selection module is specifically configured to:
traversing the specific uplink port and other uplink ports which are not in the first aggregation group, comparing the priorities of the specific uplink port and other uplink ports which are not in the first aggregation group, and selecting the uplink port with the higher priority as the uplink port for transmitting the data message.
16. The switch of claim 15, wherein the upstream port selection module is further to:
and when the priority and the bandwidth of the specific uplink port are the same as those of other uplink ports which are not in the first aggregation group, selecting the uplink port which is already transmitting the data message as the uplink port for transmitting the data message.
CN201911143103.2A 2019-11-20 2019-11-20 Method and switch for selecting uplink port to communicate Active CN110995621B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911143103.2A CN110995621B (en) 2019-11-20 2019-11-20 Method and switch for selecting uplink port to communicate

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911143103.2A CN110995621B (en) 2019-11-20 2019-11-20 Method and switch for selecting uplink port to communicate

Publications (2)

Publication Number Publication Date
CN110995621A CN110995621A (en) 2020-04-10
CN110995621B true CN110995621B (en) 2021-08-17

Family

ID=70085490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911143103.2A Active CN110995621B (en) 2019-11-20 2019-11-20 Method and switch for selecting uplink port to communicate

Country Status (1)

Country Link
CN (1) CN110995621B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103179044A (en) * 2011-12-23 2013-06-26 北京网康科技有限公司 Method, device and system for achieving flow management
CN103905325A (en) * 2012-12-26 2014-07-02 中兴通讯股份有限公司 Two-layer network data transmission method and network node
CN104283756A (en) * 2013-07-02 2015-01-14 杭州华三通信技术有限公司 Method and device for realizing distributed type multi-tenant virtual network
CN105991445A (en) * 2016-03-31 2016-10-05 杭州华三通信技术有限公司 Link aggregation group setting method and device
CN108259345A (en) * 2016-12-30 2018-07-06 新华三技术有限公司 port generation method and device
CN109617818A (en) * 2019-01-31 2019-04-12 新华三技术有限公司 A kind of message forwarding method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6156737B2 (en) * 2013-08-19 2017-07-05 APRESIA Systems株式会社 Network relay system and switch device
US20170118108A1 (en) * 2015-10-27 2017-04-27 Futurewei Technologies, Inc. Real Time Priority Selection Engine for Improved Burst Tolerance

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103179044A (en) * 2011-12-23 2013-06-26 北京网康科技有限公司 Method, device and system for achieving flow management
CN103905325A (en) * 2012-12-26 2014-07-02 中兴通讯股份有限公司 Two-layer network data transmission method and network node
CN104283756A (en) * 2013-07-02 2015-01-14 杭州华三通信技术有限公司 Method and device for realizing distributed type multi-tenant virtual network
CN105991445A (en) * 2016-03-31 2016-10-05 杭州华三通信技术有限公司 Link aggregation group setting method and device
CN108259345A (en) * 2016-12-30 2018-07-06 新华三技术有限公司 port generation method and device
CN109617818A (en) * 2019-01-31 2019-04-12 新华三技术有限公司 A kind of message forwarding method and device

Also Published As

Publication number Publication date
CN110995621A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
US8855116B2 (en) Virtual local area network state processing in a layer 2 ethernet switch
CN103297560B (en) A kind of method and server of data flow classification
KR20170060102A (en) Data forwarding method, device and system in software-defined networking
CN101873269B (en) Data retransmission device and method for distributing buffer to ports
CN100433682C (en) Resource managing device, cut-in system and method for securing multiple service quality
CN101094185A (en) Method and device for forwarding message based on multilink
WO2016194089A1 (en) Communication network, communication network management method and management system
US10050906B2 (en) Virtual node having separate control and data planes
US9565112B2 (en) Load balancing in a link aggregation
JP7101308B2 (en) High-speed transfer table creation
CN104301226A (en) Designated routing bridge (DRB) election method, equipment and system
EP3086588A1 (en) Configuration processing and configuration method and device for binding link
CN109088822B (en) Data flow forwarding method, device, system, computer equipment and storage medium
US20150043911A1 (en) Network Depth Limited Network Followed by Compute Load Balancing Procedure for Embedding Cloud Services in Software-Defined Flexible-Grid Optical Transport Networks
CN103595638A (en) Method and device for MAC address learning
CN102571586B (en) Method and device for setting customer virtual local area network (CVLAN) in transparent interconnect of lots of links (TRILL) network
US20170034739A1 (en) Method and device for processing to share network resources, and method, device and system for sharing network resources
CN114221781A (en) Flow filtering method and system, electronic device and storage medium
CN103945015A (en) Node logic ID distribution device and method and communication system
CN110995621B (en) Method and switch for selecting uplink port to communicate
CN116318554A (en) Network transmission method and device
CN107508730B (en) SDN network-based data center interconnection method and device
CN113938955B (en) Data transmission method, device, equipment and system
US20220060392A1 (en) Network Management System and Method
CN111327543A (en) Message forwarding method and device, storage medium and electronic device

Legal Events

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