CN109347734B - Message sending method, device, network equipment and computer readable medium - Google Patents

Message sending method, device, network equipment and computer readable medium Download PDF

Info

Publication number
CN109347734B
CN109347734B CN201810998252.6A CN201810998252A CN109347734B CN 109347734 B CN109347734 B CN 109347734B CN 201810998252 A CN201810998252 A CN 201810998252A CN 109347734 B CN109347734 B CN 109347734B
Authority
CN
China
Prior art keywords
identification information
port
forwarded
corresponding relation
message
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
CN201810998252.6A
Other languages
Chinese (zh)
Other versions
CN109347734A (en
Inventor
刘永奎
王伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Information Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201810998252.6A priority Critical patent/CN109347734B/en
Publication of CN109347734A publication Critical patent/CN109347734A/en
Application granted granted Critical
Publication of CN109347734B publication Critical patent/CN109347734B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

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

Abstract

The present disclosure provides a message sending method, device, network device and computer readable medium, which relates to the technical field of communication devices, and includes: after acquiring an STP protocol message to be forwarded, inquiring a first corresponding relation between first identification information and a first target port, wherein the first target port is a port which is in communication connection with network equipment in main DR equipment corresponding to the first identification information; if the first corresponding relation is inquired, inquiring a port corresponding to the first identification information based on the first corresponding relation; and determining a port to be forwarded from the inquired ports corresponding to the first identification information, and transmitting the STP protocol message through the port to be forwarded. The method and the system are used for forwarding the STP protocol message through the main DR equipment so as to reduce transparent transmission of the protocol message, improve the bandwidth use of the IPL link and ensure the stability of a DR system.

Description

Message sending method, device, network equipment and computer readable medium
Technical Field
The present disclosure relates to the field of communications devices, and in particular, to a method and an apparatus for sending a packet, a network device, and a computer-readable medium.
Background
The DRNI (Distributed resource Network Interconnect) technique connects two physical devices by ethernet link aggregation to virtualize the devices into a logical device, thereby implementing cross-device link aggregation. The two physical devices forming the distributed aggregation aggregate real-time synchronous data through the Ethernet link, and equipment-level redundancy protection is provided. Two physical devices in the RNI typical network are aggregated by ethernet links to form a DR System (Distributed-Relay System).
As shown in fig. 1, after the DR system is normally established, when an aggregation port on the device C selects a port to send an STP (Spanning Tree Protocol) packet, the STP packet is randomly selected according to the hash, and if the hash is performed on the port on the link 2, the STP packet is sent to the device B (slave DR device) first, then the device B is then thoroughly sent to the device a (master DR device), and finally the STP packet is processed on the device a. If the model is a PVST (Per-VLAN Spanning Tree) model, a large number of PVST protocol messages are sent when a large number of VLANs are enabled, and a large number of protocol messages are transmitted to the device a on the device B, which affects the bandwidth usage of an IPL (Intra-Portal Link) Link, and even affects the stability of a DR system.
Disclosure of Invention
In view of this, the present disclosure aims to provide a packet sending method, an apparatus, a network device and a computer readable medium, which are used to forward an STP protocol packet through a host DR device, so as to reduce transparent transmission of the protocol packet, improve bandwidth usage of an IPL link, and ensure stability of a DR system.
In a first aspect, an embodiment of the present disclosure provides a packet sending method, applied to a network device, including: after acquiring an STP protocol message to be forwarded, inquiring a first corresponding relation between first identification information and a first target port, wherein the first target port is a port which is in communication connection with the network equipment in main DR equipment corresponding to the first identification information; if the first corresponding relation is inquired, inquiring a port corresponding to the first identification information based on the first corresponding relation; and determining a port to be forwarded from the inquired ports corresponding to the first identification information, and sending the STP protocol message through the port to be forwarded.
Further, the method further comprises: if the first corresponding relation is not inquired, inquiring a second corresponding relation between second identification information and a second target port, wherein the second target port is a port which is in communication connection with the network equipment in the slave DR equipment and corresponds to the second identification information; and if the second corresponding relation exists, determining a port to be forwarded from the second target port, and sending the STP protocol message through the port to be forwarded.
Further, determining a port to be transferred from the queried ports corresponding to the first identification information includes: and performing hash calculation on the inquired port corresponding to the first identification information so as to determine the port to be forwarded from the corresponding port according to a hash calculation result.
Further, if the LACP message acquired by the network device carries the first identification information, the first corresponding relationship is determined by the following method: acquiring an LACP message which is sent by the main DR equipment and carries first identification information; and establishing a corresponding relation between first identification information carried in the LACP message and a first target port corresponding to the first identification information to obtain the first corresponding relation.
Further, establishing a correspondence between first identification information carried in the LACP message and a first target port corresponding to the first identification information, and obtaining the first correspondence includes: grouping each LACP message carrying the first identification information according to the aggregation group where the main DR equipment is located, so that the LACP messages belonging to the same aggregation group are divided into the same group, and a plurality of groups belonging to each aggregation group are obtained; and establishing a corresponding relation between the first identification information carried by the LACP messages in each group and the corresponding first target port to obtain a first corresponding relation corresponding to each aggregation group.
In a second aspect, an embodiment of the present disclosure further provides a packet sending apparatus, which is disposed in a network device, and includes: a first query unit, configured to query a first corresponding relationship between first identification information and a first target port after acquiring an STP protocol packet to be forwarded, where the first target port is a port in communication connection with the network device in a main DR device corresponding to the first identification information; a second query unit, configured to query, if the first corresponding relationship is queried, a port corresponding to the first identification information based on the first corresponding relationship; and the determining unit is used for determining a port to be forwarded from the inquired ports corresponding to the first identification information and sending the STP protocol message through the port to be forwarded.
Further, the apparatus is further configured to: if the first corresponding relation is not inquired, inquiring a second corresponding relation between second identification information and a second target port, wherein the second target port is a port which is in communication connection with the network equipment in the slave DR equipment and corresponds to the second identification information; and if the second corresponding relation exists, determining a port to be forwarded from the second target port, and sending the STP protocol message through the port to be forwarded.
Further, the determining unit is configured to: and performing hash calculation on the inquired port corresponding to the first identification information so as to determine the port to be forwarded from the corresponding port according to a hash calculation result.
Further, the apparatus is further configured to: determining the first corresponding relationship by the following method when the first identification information is carried in the LACP message acquired by the network device: acquiring an LACP message which is sent by the main DR equipment and carries first identification information; and establishing a corresponding relation between first identification information carried in the LACP message and a first target port corresponding to the first identification information to obtain the first corresponding relation.
Further, the apparatus is further configured to: grouping each LACP message carrying the first identification information according to the aggregation group where the main DR equipment is located, so that the LACP messages belonging to the same aggregation group are divided into the same group, and a plurality of groups belonging to each aggregation group are obtained; and establishing a corresponding relation between the first identification information carried by the LACP messages in each group and the corresponding first target port to obtain a first corresponding relation corresponding to each aggregation group.
In a third aspect, an embodiment of the present disclosure further provides a network device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the method of any one of the above first aspects when executing the computer program.
In a fourth aspect, the disclosed embodiments provide a computer-readable medium having non-volatile program code executable by a processor, the program code causing the processor to perform the method of any of the first aspect.
In the embodiment of the present disclosure, after acquiring an STP protocol packet to be forwarded, a first corresponding relationship between first identification information and a first target port is queried, where the first target port is a port in communication connection with a network device in a main DR device corresponding to the first identification information; if the first corresponding relation is inquired, inquiring a port corresponding to the first identification information based on the first corresponding relation; and determining the port to be forwarded from the inquired ports corresponding to the first identification information, and transmitting the STP protocol message through the port to be forwarded.
As can be seen from the above description, in this embodiment, by querying the first corresponding relationship, the STP protocol packet can be forwarded by the main DR device when the port of the main DR device is queried based on the queried first corresponding relationship, so as to reduce transparent transmission of the protocol packet, improve bandwidth usage of the IPL link, and ensure stability of the DR system, thereby solving the technical problems in the prior art that DR stability is affected when the DR device is transmitted to the main DR device, and bandwidth usage of the IPL link is affected.
Additional features and advantages of the disclosure will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the disclosure. The objectives and other advantages of the disclosure will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings used in the following description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a diagram of an exemplary DRNI networking;
FIG. 2 is a schematic diagram of the operation of an exemplary DRNI networking;
FIG. 3 is a flow chart of a method of sending a message according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of the operation of an exemplary DRNI networking according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a message sending apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram of a network device according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the embodiments of the present disclosure will be described in detail and completely with reference to the accompanying drawings. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
Two physical devices in a DRNI typical networking aggregate through ethernet links to form a DR system. On the network, the DR system appears externally as one device.
As shown in fig. 1, the DR system includes the following parts:
DR device (Distributed Relay device): the DR devices are physical devices for constituting the DR system and are neighbors of each other. Currently a distributed aggregation system supports only two member devices. As shown in fig. 1, Device a (hereinafter referred to as Device a in the embodiment) and Device B (hereinafter referred to as Device B in the embodiment) are both member devices of the DR system.
DR interface (Distributed Relay interface): the DR interface is a two-layer aggregation interface connected to an external device.
DR group (Distributed-Relay group): and the member equipment and the external equipment are connected with each other, and the member equipment and the external equipment belong to the distributed aggregation group.
IPL (Intra-Portal Link, internal control Link): and the two-layer aggregation link between the member devices of the DR system is used for transmitting DRNI protocol messages between the DR devices. Only one IPL can exist within a system.
IPP (Intra-Portal Port, internal control Link Port): and the two-layer aggregation interface of the two-layer aggregation link where the IPL is positioned receives and transmits the protocol message of the DRNI through the port.
Keep alive link: and the keep-alive link of the DR system detects the state of the DR equipment through the link.
In order to ensure reliability, network equipment needs to consider redundancy backup of links when accessing a network, and the method can be realized by deploying MSTP and the like, but the utilization rate of the links is very low in the method, and a large amount of bandwidth resources are wasted. To achieve redundant backup while increasing link utilization. As shown in fig. 1, DRNI is deployed between a device and B device, implementing device aggregation. Therefore, the device A and the device B form load sharing to jointly transmit the flow, and when one device fails, the flow can be quickly switched to the other device, so that the normal operation of the service is ensured.
At present, 2-layer aggregation ports are used in a DR system, and are inevitably combined with 2-layer loop protocols such as MSTP (multiple spanning Tree protocol) and the like for preventing loops. The DR system is treated as a device when STP is calculated, at present, a DR interface only participates in STP calculation on the main DR device, and a DR interface on the slave DR device does not participate in STP calculation, so that STP protocol messages received from the DR device need to be thoroughly transmitted to the main DR device through an IPL link. For example, as shown in fig. 2, the STP protocol message is sent to device B (slave DR device) first, and then device B is then passed through to device a (master DR device). At this time, a large amount of protocol messages are transmitted to the slave DR device on the master DR device, which may affect the bandwidth usage of the IPL link, and even affect the stability of the DR system. Based on this, in this embodiment, a packet sending method is provided, where the method is used to forward an STP protocol packet through a host DR device, so as to reduce transparent transmission of the protocol packet, improve bandwidth usage of an IPL link, and ensure stability of a DR system.
The present application provides an embodiment of a messaging method, it should be noted that the steps shown in the flowchart of the figure may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different than here.
Fig. 3 is a flowchart of a message sending method according to an embodiment of the present disclosure. In the present embodiment, the following steps S302 to S306 may be applied to an apparatus C as shown in fig. 2, which may be connected to a DR apparatus in at least one DR system. As shown in fig. 3, the method comprises the steps of:
step S302, after acquiring the STP protocol packet to be forwarded, querying a first corresponding relationship between first identification information and a first target port, where the first target port is a port in the main DR device corresponding to the first identification information, the port being in communication connection with the network device.
In this embodiment, the first corresponding relationship between the first identification information and the first destination port may be reflected in a mapping table. The mapping table includes identification information and a port list corresponding to the identification information. The identification information is used for representing whether the device to which the corresponding port belongs is a master DR device, a slave DR device or a non-DR device in the DR system. For example, it is first identification information (e.g., 01) for characterizing the master DR device, it is second identification information (e.g., 10) for characterizing the slave DR device, and it is third identification information (e.g., 00) for characterizing the common device.
It should be noted that, in this embodiment, the mapping table may only include the first corresponding relationship between the first identification information and the first destination port. In addition, the mapping table may further include a correspondence between the second identification information and the corresponding port (i.e., a second correspondence described below), or the mapping table may further include a correspondence between the third identification information and the corresponding port.
Further, the device C may be communicatively connected to a plurality of DR systems at the same time, or to a plurality of general devices at the same time. In the present disclosure, the mapping table is constructed according to a DR system, for example, a port list is formed by the first identification information corresponding to the master DR device in the same DR system and the ports of the master DR device, which are in communication connection with the network device.
In this embodiment, the identification information is field information that is set in advance in an LACP (Link Aggregation Control Protocol) message. The LACP message is a message sent from a port of the DR device or the non-DR device to the network device. The LACP is a Protocol for implementing Link dynamic convergence, and the LACP Protocol exchanges information with an opposite end through an LACPDU (Link Aggregation Control Protocol Data Unit).
After the LACP protocol of a certain port is enabled, the port informs the opposite end of the own system priority, system MAC address, port priority, port number and operation Key by sending LACPDU. After receiving the information, the opposite end compares the information with the information stored in other ports to select the port capable of aggregation, so that the two parties can reach the agreement of the port joining or exiting a certain dynamic aggregation group (or DR group). Therefore, in this embodiment, the network device may determine, through the LACP packet, a port communicatively connected to the LACP packet in the device to which the LACP packet is sent.
Step S304, if the first corresponding relation is inquired, inquiring a port corresponding to the first identification information based on the first corresponding relation;
step S306, determining a port to be forwarded from the inquired ports corresponding to the first identification information, and sending the STP protocol message through the port to be forwarded.
As can be seen from the above description, in this embodiment, by querying the first corresponding relationship, the STP protocol packet can be forwarded by the main DR device when the port of the main DR device is queried based on the queried first corresponding relationship, so as to reduce transparent transmission of the protocol packet, improve bandwidth usage of the IPL link, and ensure stability of the DR system, thereby solving the technical problems in the prior art that DR stability is affected when the DR device is transmitted to the main DR device, and bandwidth usage of the IPL link is affected.
In this embodiment, when the network device executes the methods described in the above steps S302 to S306, the first corresponding relationship needs to be established first. And then, after acquiring the STP protocol message to be forwarded, querying a port corresponding to the first identification information based on the queried first corresponding relation.
In an alternative implementation of this embodiment, the first corresponding relationship may be constructed by a method described by the following steps:
acquiring an LACP message which is sent by the main DR equipment and carries first identification information;
and establishing a corresponding relation between first identification information carried in the LACP message and a first target port corresponding to the first identification information to obtain the first corresponding relation.
Optionally, establishing a correspondence between first identification information carried in the LACP message and a first target port corresponding to the first identification information, where obtaining the first correspondence includes:
grouping each LACP message carrying the first identification information according to the aggregation group where the main DR equipment is located, so that the LACP messages belonging to the same aggregation group are divided into the same group, and a plurality of groups belonging to each aggregation group are obtained; and establishing a corresponding relation between the first identification information carried by the LACP messages in each group and the corresponding first target port to obtain a first corresponding relation corresponding to each aggregation group.
Specifically, the identification information is field information set in advance in the LACP message.
In this embodiment, the LACP message needs to be extended, a field role is newly added to a reserved field of the LACP message, and then the added field is used to enable the LACP message to carry identification information (i.e., the first identification information) of the master and slave DR devices. Currently, the reserved field of the LACP message has 3 bytes. In this embodiment, 1bit or 2 bits thereof may be selected. For example, 00(0) indicates that the LACP packet does not carry the identification information (e.g., the third identification information) of the master and slave DR devices, and is consistent with the original one; 01(1) indicating that the LACP message carries identification information of a master DR device in the DR system (i.e., the first identification information); 10(2) that the LACP message carries identification information (e.g., second identification information) of the slave DR device in the DR system.
Based on this, in this embodiment, after the DR system is established, the DR interface is connected to an opposite device (for example, device C in fig. 2), an LACP message sent by the DR device in the DR system may carry a newly added field, a role value carried by the master DR device is 1, a role value carried by the slave DR device is 2, and a role value carried by the normal device is 0.
It should be noted that, in this embodiment, it is not limited that the first identification information is set to be 1, the second identification information is set to be 2, and the third identification information is set to be 0, and other numerical values or symbols may also be used for the first identification information, the second identification information, and the third identification information, which is not specifically limited in this embodiment.
After receiving the LACP message, the device C establishes a correspondence between the first identification information carried in the LACP message and the first target port corresponding to the first identification information, thereby obtaining a first correspondence.
Specifically, in this embodiment, each LACP message may be grouped according to the carried identification information, and the LACP messages carrying the same identification information are grouped into the same group, so as to obtain a plurality of groups. For example, the LACP messages carrying the first identification information are grouped into one group to obtain a group a1, or the LACP messages carrying the second identification information are grouped into one group to obtain a group a2, or the LACP messages carrying the third identification information are grouped into one group to obtain a group A3.
After the above-mentioned group a1, a2, or A3 is obtained, the corresponding relationship between the first identification information in the group a1 and the corresponding first destination port can be established, so as to obtain the first corresponding relationship. And establishing a corresponding relationship between the second identification information in the packet a2 and a second destination port corresponding to the second identification information, to obtain a second corresponding relationship, where the second destination port is a port, in the slave DR device, corresponding to the second identification information, and communicatively connected to the network device. And establishing a corresponding relationship between the third identification information in the packet a3 and a third destination port corresponding to the third identification information, to obtain a third corresponding relationship, where the third destination port is a port connected to the network device in the non-DR device corresponding to the third identification information.
It is further noted that, since one network device may be connected to a plurality of DR systems (i.e., aggregation group), each DR system includes a master DR device and a slave DR device. Based on this, in this embodiment, each LACP packet carrying identification information may also be grouped according to an aggregation group, so as to belong to the same aggregation group, and the LACP packets carrying the same identification information are divided into the same group, so as to obtain a plurality of groups. For example, LACP messages with role value of 2 in the same aggregation group are grouped into one group, LACP messages with role value of 1 are grouped into another group, and LACP messages with role value of 0 are grouped into a third group. After obtaining the plurality of packets, a mapping table may be determined based on the plurality of packets.
In this embodiment, in a manner of grouping each LACP packet carrying identification information according to an aggregation group, packets from devices of the same type in the same aggregation group can be grouped into one group, and then, when determining a mapping table based on a plurality of groups, it is not necessary to group the mapping table according to the aggregation group, and the mapping table can be directly determined by a plurality of groups, which is simple and fast.
For example, the correspondence relationship may be expressed as:
DR group 1:
in the DR group 1, first identification information (e.g., 01) corresponding to a master DR device and a first corresponding relationship between ports of the master DR device, which are in communication connection with a network device;
and in the DR group 1, the slave DR equipment corresponds to second identification information (for example, 10) and second corresponding relations of ports, which are in communication connection with the network equipment, in the slave DR equipment.
DR group 2:
in the DR group 2, first identification information (e.g., 01) corresponding to a master DR device and a first corresponding relationship between ports of the master DR device, which are in communication connection with a network device;
and in the DR group 2, the slave DR equipment corresponds to second identification information (for example, 10) and second corresponding relations of ports, which are in communication connection with the network equipment, in the slave DR equipment.
General apparatus 1:
the third identification information (for example, 00) corresponding to the generic device 1, and a third corresponding relationship between ports of the generic device 1, which are in communication connection with the network device.
In this embodiment, after obtaining the correspondence relationship, after obtaining the STP protocol packet to be forwarded, first querying a first correspondence relationship between the first identification information and the first target port. And after the first corresponding relation is inquired, inquiring the port corresponding to the first identification information based on the first corresponding relation.
It should be further noted that, in this embodiment, the first corresponding relationship is not fixed but dynamically changed, and the network device may dynamically adjust the first target port corresponding to the first identification information in the first corresponding relationship according to the LACP packet acquired from the main DR device.
In this embodiment, if a port corresponding to the first identification information is queried based on the first correspondence relationship; determining a port to be forwarded from the inquired ports corresponding to the first identification information, and sending the STP protocol message through the port to be forwarded.
Specifically, in this embodiment, hash calculation may be performed on corresponding ports, so as to determine the port to be forwarded from the corresponding ports according to a hash calculation result.
In another alternative embodiment, the method further comprises the steps of:
step S21, if the first corresponding relationship is not found, finding a second corresponding relationship between second identification information and a second target port, where the second target port is a port communicatively connected to the network device in the slave DR device corresponding to the second identification information;
step S22, if the second corresponding relationship exists, determining a port to be forwarded from the second target port, and sending the STP protocol packet through the port to be forwarded.
In this embodiment, if the first corresponding relationship is not found in the mapping table, it indicates that there is no port of the master DR device in the mapping table, that is, the link between the network device and the master DR device in the DR system is not through. At this time, a second corresponding relationship between the second identification information and the second target port is queried. And if the second corresponding relation exists, determining a port to be forwarded from the second target port, and sending the STP protocol message through the port to be forwarded.
As can be seen from the above description, in this embodiment, when the hash of the data packet is performed, the hash value is kept consistent with the original hash value, and the role value is not distinguished. When hash calculation is carried out on which port to send the STP protocol message, the hash selection is preferentially carried out from the group with the role value of 1 (first identification information), if the group is not empty, the role value is taken into account during the hash, and the hashed value is ensured to be only a plurality of ports in the group; if the group with role 1 is null, it indicates that the link between the device and the master-slave DR device of the DR system is not through, and the role value is not considered, in this case, an optional embodiment is to determine the port for forwarding the packet according to the manner described in step S21 and step S22, and another optional embodiment is to keep the hash calculation consistent with the initial one, where the initial refers to performing the hash calculation according to the original hash algorithm without considering the role.
By the processing mode, the situation that the first corresponding relation is not inquired, and the port obtained by performing the hash calculation according to the original hash algorithm is also in the disconnection state can be avoided, and the port of normal communication can still be determined for the STP protocol message to be forwarded to perform message forwarding.
As can be seen from the above description, in this embodiment, a field is added in the LACP message sent by the DR device or the non-DR device to distinguish whether the LACP message is sent by the DR device or the slave DR device of the DR system, or sent by the normal device. After receiving the LACP message, the network device records the corresponding marks for grouping, and when the physical port used by the hash for sending the STP protocol message, the interfaces receiving role 1 are preferentially selected for hashing, so that the hashed result is ensured to be in the interfaces, transparent transmission of the protocol message on the slave DR device is reduced, the bandwidth use of the IPL link is improved, and the stability of the DR system is improved. By the technical scheme, under the condition that the link of the main DR equipment exists, the hash to the port of the link connected with the main D equipment can be ensured, the transparent transmission of the protocol message is reduced, the bandwidth use of the IPL link is improved, and the stability of a DR system is improved.
The above embodiments are further explained below, and will be specifically explained with reference to fig. 2 and 4.
As shown in fig. 2, a device a is a master DR device, a device B is a slave DR device, and before optimization, an aggregation port on the device C hashes to a port on a link 2 when sending an STP protocol packet, so that the STP protocol packet will be transmitted from the DR device C to the device B, and then the device B transparently transmits the STP protocol packet to the device a, which is equivalent to a bypass of the protocol packet, thereby increasing the load of an IPL link.
After the method provided by this embodiment is adopted, the LACP messages sent by the device a and the device B carry the newly added field role, where the device a sends the LACP message carrying the identification information 1 (first identification information), and the device B sends the LACP message carrying the identification information 2 (second identification information). After receiving the LACP messages, the device C groups the same aggregation group, where role is a group of 1 and role is a group of 2. When an aggregation port of the device C selects a member port to send an STP protocol packet, a corresponding aggregation group is first searched, and if a port with role 1 is not empty, the ports with role 1 are preferably selected to perform hashing, so as to ensure that the last hashed interface is in the group with role 1. Thus, the output interface hashed on the device C is the port of the link 1, the STP protocol message is sent to the DR system through the port, and the device a can directly receive the STP protocol message without transparent transmission through the device B. The transparent transmission of protocol messages is reduced in the DR system, the bandwidth usage of IPL links is reduced, and the stability of the DR system is improved. The optimized packet forwarding is shown in fig. 4.
The embodiment of the present disclosure further provides a message sending apparatus, which is mainly used for executing the message sending method provided in the foregoing content of the embodiment of the present disclosure, and the following provides a specific description of the message sending apparatus provided in the embodiment of the present disclosure.
Fig. 5 is a schematic diagram of a message sending apparatus according to an embodiment of the present disclosure, as shown in fig. 5, the message sending apparatus mainly includes a first querying unit 10, a second querying unit 20 and a determining unit 30, where:
a first query unit, configured to query a first corresponding relationship between first identification information and a first target port after acquiring an STP protocol packet to be forwarded, where the first target port is a port in communication connection with the network device in the main DR device corresponding to the first identification information;
a second query unit, configured to query, if the first correspondence is queried, a port corresponding to the first identification information based on the first correspondence;
and the determining unit is used for determining a port to be forwarded from the inquired ports corresponding to the first identification information and sending the STP protocol message through the port to be forwarded.
As can be seen from the above description, in this embodiment, by querying the first corresponding relationship, the STP protocol packet can be forwarded by the main DR device when the port of the main DR device is queried based on the queried first corresponding relationship, so as to reduce transparent transmission of the protocol packet, improve bandwidth usage of the IPL link, and ensure stability of the DR system, thereby solving the technical problems in the prior art that DR stability is affected when the DR device is transmitted to the main DR device, and bandwidth usage of the IPL link is affected.
Optionally, the apparatus is further configured to: if the first corresponding relation is not inquired, inquiring a second corresponding relation between second identification information and a second target port, wherein the second target port is a port which is in communication connection with the network equipment in the slave DR equipment and corresponds to the second identification information; and if the second corresponding relation exists, determining a port to be forwarded from the second target port, and sending the STP protocol message through the port to be forwarded.
Optionally, the determining unit is configured to: and performing hash calculation on the inquired port corresponding to the first identification information so as to determine the port to be forwarded from the corresponding port according to a hash calculation result.
Optionally, the apparatus is further configured to: determining the first corresponding relationship by the following method when the first identification information is carried in the LACP message acquired by the network device: acquiring an LACP message which is sent by the main DR equipment and carries first identification information; and establishing a corresponding relation between first identification information carried in the LACP message and a first target port corresponding to the first identification information to obtain the first corresponding relation.
Optionally, the apparatus is further configured to: grouping each LACP message carrying the first identification information according to the aggregation group where the main DR equipment is located, so that the LACP messages belonging to the same aggregation group are divided into the same group, and a plurality of groups belonging to each aggregation group are obtained; and establishing a corresponding relation between the first identification information carried by the LACP messages in each group and the corresponding first target port to obtain a first corresponding relation corresponding to each aggregation group.
The device provided by the embodiment of the present disclosure has the same implementation principle and technical effect as the foregoing method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the foregoing method embodiments for the parts of the embodiment of the device that are not mentioned.
Referring to fig. 6, an embodiment of the present disclosure further provides a network device 100, including: a processor 60, a memory 61, a bus 62 and a communication interface 63, wherein the processor 60, the communication interface 63 and the memory 61 are connected through the bus 62; the processor 60 is arranged to execute executable modules, such as computer programs, stored in the memory 61.
The Memory 61 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 63 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used.
The bus 62 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. XX, but this does not indicate only one bus or one type of bus.
The memory 61 is used for storing a program 601, the processor 60 executes the program 601 after receiving an execution instruction, and the method executed by the apparatus defined by the flow process disclosed in any embodiment of the foregoing disclosure may be applied to the processor 60, or implemented by the processor 60.
The processor 60 may be an integrated circuit chip having signal processing capabilities. In implementing the above method steps may be performed by instructions in the form of hardware, integrated logic circuits or software in the processor 60. The Processor 60 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present disclosure may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present disclosure may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in ram, flash memory, rom, prom, or eprom, registers, among other storage media that are well known in the art. The storage medium is located in a memory 61, and the processor 60 reads the information in the memory 61 and, in combination with its hardware, performs the steps of the above method.
In addition, in the description of the embodiments of the present disclosure, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through an intermediary, or they may be interconnected between two elements. The specific meaning of the above terms in the present disclosure can be understood in a specific case to those of ordinary skill in the art.
In the description of the present disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", and the like indicate orientations or positional relationships indicated on the basis of the drawings, and are only for convenience of description and simplification of description, but do not indicate or imply that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and thus, should not be construed as limiting the present disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical functional division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may also be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used for illustrating the technical solutions of the present disclosure and not for limiting the same, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can still modify or easily conceive of changes in the technical solutions described in the foregoing embodiments or equivalent substitutions of some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present disclosure, and should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (12)

1. A message sending method is applied to network equipment and comprises the following steps:
after acquiring an STP protocol message to be forwarded, inquiring a first corresponding relation between first identification information and a first target port, wherein the first target port is a port which is in communication connection with the network equipment in main distributed aggregation member equipment (main DR equipment) corresponding to the first identification information;
if the first corresponding relation is inquired, inquiring a port corresponding to the first identification information based on the first corresponding relation;
and determining a port to be forwarded from the inquired ports corresponding to the first identification information, and sending the STP protocol message through the port to be forwarded.
2. The method of claim 1, further comprising:
if the first corresponding relation is not inquired, inquiring a second corresponding relation between second identification information and a second target port, wherein the second target port is a port which is in communication connection with the network device and corresponds to the second identification information and is in communication connection with the slave distributed aggregation member device (slave DR device);
and if the second corresponding relation exists, determining a port to be forwarded from the second target port, and sending the STP protocol message through the port to be forwarded.
3. The method of claim 1, wherein determining a port to be forwarded from the queried ports corresponding to the first identification information comprises:
and performing hash calculation on the inquired port corresponding to the first identification information so as to determine the port to be forwarded from the corresponding port according to a hash calculation result.
4. The method according to claim 1, wherein if the LACP packet acquired by the network device carries the first identification information, the first correspondence is determined by:
acquiring an LACP message which is sent by the main DR equipment and carries first identification information;
and establishing a corresponding relation between first identification information carried in the LACP message and a first target port corresponding to the first identification information to obtain the first corresponding relation.
5. The method of claim 4, wherein establishing a correspondence between first identification information carried in the LACP message and a first target port corresponding to the first identification information, and obtaining the first correspondence comprises:
grouping each LACP message carrying the first identification information according to the aggregation group where the main DR equipment is located, so that the LACP messages belonging to the same aggregation group are divided into the same group, and a plurality of groups belonging to each aggregation group are obtained;
and establishing a corresponding relation between the first identification information carried by the LACP messages in each group and the corresponding first target port to obtain a first corresponding relation corresponding to each aggregation group.
6. A message sending apparatus, provided in a network device, includes:
a first query unit, configured to query a first corresponding relationship between first identification information and a first target port after acquiring an STP protocol packet to be forwarded, where the first target port is a port in communication connection with the network device in a main distributed aggregation member device (main DR device) corresponding to the first identification information;
a second query unit, configured to query, if the first corresponding relationship is queried, a port corresponding to the first identification information based on the first corresponding relationship;
and the determining unit is used for determining a port to be forwarded from the inquired ports corresponding to the first identification information and sending the STP protocol message through the port to be forwarded.
7. The apparatus of claim 6, wherein the apparatus is further configured to:
if the first corresponding relation is not inquired, inquiring a second corresponding relation between second identification information and a second target port, wherein the second target port is a port which is in communication connection with the network device and corresponds to the second identification information and is in communication connection with the slave distributed aggregation member device (slave DR device);
and if the second corresponding relation exists, determining a port to be forwarded from the second target port, and sending the STP protocol message through the port to be forwarded.
8. The apparatus of claim 6, wherein the determining unit is configured to:
and performing hash calculation on the inquired port corresponding to the first identification information so as to determine the port to be forwarded from the corresponding port according to a hash calculation result.
9. The apparatus of claim 6, wherein the apparatus is further configured to:
determining the first corresponding relationship by the following method when the first identification information is carried in an LACP message acquired by the network device:
acquiring an LACP message which is sent by the main DR equipment and carries first identification information;
and establishing a corresponding relation between first identification information carried in the LACP message and a first target port corresponding to the first identification information to obtain the first corresponding relation.
10. The apparatus of claim 9, wherein the apparatus is further configured to:
grouping each LACP message carrying the first identification information according to the aggregation group where the main DR equipment is located, so that the LACP messages belonging to the same aggregation group are divided into the same group, and a plurality of groups belonging to each aggregation group are obtained;
and establishing a corresponding relation between the first identification information carried by the LACP messages in each group and the corresponding first target port to obtain a first corresponding relation corresponding to each aggregation group.
11. A network device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of the preceding claims 1 to 2 when executing the computer program.
12. A computer-readable medium having non-volatile program code executable by a processor, the program code causing the processor to perform the method of any of the preceding claims 1 to 5.
CN201810998252.6A 2018-08-29 2018-08-29 Message sending method, device, network equipment and computer readable medium Active CN109347734B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810998252.6A CN109347734B (en) 2018-08-29 2018-08-29 Message sending method, device, network equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810998252.6A CN109347734B (en) 2018-08-29 2018-08-29 Message sending method, device, network equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN109347734A CN109347734A (en) 2019-02-15
CN109347734B true CN109347734B (en) 2021-05-07

Family

ID=65292000

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810998252.6A Active CN109347734B (en) 2018-08-29 2018-08-29 Message sending method, device, network equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN109347734B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109951819A (en) * 2019-03-19 2019-06-28 新华三技术有限公司 A kind of message forwarding method and device
CN112953883A (en) * 2019-12-10 2021-06-11 中兴通讯股份有限公司 Equipment protocol intercommunication method, equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101753453A (en) * 2009-12-23 2010-06-23 中兴通讯股份有限公司 Networking method for ring network of packet transport network
CN102710507A (en) * 2012-05-17 2012-10-03 杭州华三通信技术有限公司 Method and network equipment for achieving consistency of message forwarding paths
CN103152210A (en) * 2013-03-29 2013-06-12 杭州华三通信技术有限公司 Method for repairing spanning tree protocol (STP) forwarding state abnormalities and stacking equipment
CN103501250A (en) * 2013-09-30 2014-01-08 杭州华三通信技术有限公司 Data flow processing method and device in distribution type link aggregation network
CN103532851A (en) * 2013-09-30 2014-01-22 杭州华三通信技术有限公司 Method and device for processing data flow in distributed link aggregation network
CN107547452A (en) * 2017-07-11 2018-01-05 新华三技术有限公司 A kind of distributed communication equipment and its message forwarding method and device
CN107995111A (en) * 2016-10-26 2018-05-04 中兴通讯股份有限公司 Business forwarding, link change notifying method, convergence device and access device
CN108259299A (en) * 2017-06-23 2018-07-06 新华三技术有限公司 A kind of forwarding-table item generation method, device and machine readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7317722B2 (en) * 2003-08-20 2008-01-08 3Com Corporation System and method for distributed multicast routing
US8780943B2 (en) * 2011-10-17 2014-07-15 Golba Llc Method and system for utilizing multiplexing to increase throughput in a network of distributed transceivers with array processing
US9503316B2 (en) * 2013-04-23 2016-11-22 Telefonaktiebolaget L M Ericsson (Publ) Method and system for updating distributed resilient network interconnect (DRNI) states

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101753453A (en) * 2009-12-23 2010-06-23 中兴通讯股份有限公司 Networking method for ring network of packet transport network
CN102710507A (en) * 2012-05-17 2012-10-03 杭州华三通信技术有限公司 Method and network equipment for achieving consistency of message forwarding paths
CN103152210A (en) * 2013-03-29 2013-06-12 杭州华三通信技术有限公司 Method for repairing spanning tree protocol (STP) forwarding state abnormalities and stacking equipment
CN103501250A (en) * 2013-09-30 2014-01-08 杭州华三通信技术有限公司 Data flow processing method and device in distribution type link aggregation network
CN103532851A (en) * 2013-09-30 2014-01-22 杭州华三通信技术有限公司 Method and device for processing data flow in distributed link aggregation network
CN107995111A (en) * 2016-10-26 2018-05-04 中兴通讯股份有限公司 Business forwarding, link change notifying method, convergence device and access device
CN108259299A (en) * 2017-06-23 2018-07-06 新华三技术有限公司 A kind of forwarding-table item generation method, device and machine readable storage medium
CN107547452A (en) * 2017-07-11 2018-01-05 新华三技术有限公司 A kind of distributed communication equipment and its message forwarding method and device

Also Published As

Publication number Publication date
CN109347734A (en) 2019-02-15

Similar Documents

Publication Publication Date Title
US9461928B2 (en) LACP negotiation processing method, relay node, and system
US8839023B2 (en) Transmitting network information using link or port aggregation protocols
EP2961112B1 (en) Message forwarding system, method and device
CN108632099B (en) Fault detection method and device for link aggregation
US11477087B2 (en) Monitoring apparatus, network system, topology management method, and computer readable medium
EP2798800B1 (en) Expanding member ports of a link aggregation group between clusters
CN103684716A (en) Method for transmitting messages in a redundantly operable industrial communication network and communication device for the redundantly operable industrial communication network
CN111726293B (en) Message transmission method and device
CN109347734B (en) Message sending method, device, network equipment and computer readable medium
WO2021093797A1 (en) Information reporting method and information processing method, and device
EP3213441B1 (en) Redundancy for port extender chains
WO2016074151A1 (en) Sas system, traversal method and device thereof
WO2018219103A1 (en) Method and device for determining link state
US20140092725A1 (en) Method and first network node for managing an ethernet network
US20210266229A1 (en) Monitoring apparatus, network system, topology management method, and computer readable medium
CN114615179A (en) Message transmission method, device and system
US10652097B2 (en) Virtual network probing
WO2023011047A1 (en) Processing method and apparatus
WO2015062484A1 (en) Calculating shortest path first tree
WO2016138705A1 (en) Method and device for managing link in load sharing
CN112751755B (en) Equipment virtualization method, device, system, equipment and storage medium
CN115333991A (en) Cross-device link aggregation method, device, system and computer-readable storage medium
WO2023160619A1 (en) Link information sending method, and communication apparatus and system
CN113141265B (en) Cross-equipment link aggregation method and equipment
WO2022257854A1 (en) Message publishing method and apparatus, and forwarding path processing method and apparatus

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
TR01 Transfer of patent right

Effective date of registration: 20230625

Address after: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: H3C INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 310052 Changhe Road, Binjiang District, Hangzhou, Zhejiang Province, No. 466

Patentee before: NEW H3C TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right