Method, device, network equipment and storage medium for determining message forwarding path
By adding a type field to the next hop table entry, the isomorphic design is realized and the nested cascade of APS and ECMP is supported, which solves the problem of reliability and insufficient bandwidth when network equipment forwards, and improves network reliability and bandwidth utilization. .
Patent Information
- Application Number
- CN202211697900.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-12-28
Smart Images

Figure CN116074231B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method, device, network equipment and storage medium for determining a message forwarding path. Background Art
[0002] In the prior art, as the demand for network scale continues to grow, network equipment software and hardware technology has developed rapidly. Network equipment completes data interaction between user clients and data servers by forwarding messages or data packets. Due to the limited forwarding capacity of network equipment, message or data packet forwarding timeouts often occur, and more seriously, some messages or data packets are discarded.
[0003] However, packet loss in network devices is a very serious network problem that directly affects the user experience. At present, commonly used technical means to improve the forwarding reliability of network devices, such as Automatic Protection Switching (APS) technology, improve network reliability by automatically switching between the primary and backup working paths, allowing network devices to automatically recover from failures.
[0004] In addition, Equal-Cost Multipath Routing (ECMP) technology is also often used to increase transmission bandwidth or improve network reliability. It includes multiple ECMP members, and each ECMP member transmits different messages to increase transmission bandwidth, thereby improving network resource utilization.
[0005] Although automatic protection switching or equal-cost multi-path routing is often used to improve the transmission bandwidth and reliability of network devices, the two redundant backup technologies, automatic protection switching and equal-cost multi-path routing, cannot be flexibly nested. Summary of the invention
[0006] In view of this, the purpose of the present invention is to provide a method, device, network device and storage medium for determining a message forwarding path, which can realize the isomorphic design of next hop table entries by adding the next hop table entry type in the next hop table entry, and the information formats of any two next hop table entries are compatible and matched, so as to facilitate the flexible nested cascading of APS and ECMP, thereby improving network reliability and increasing network bandwidth.
[0007] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0008] In a first aspect, the present invention provides a method for determining a message forwarding path, which is applied to a network device, and the method comprises:
[0009] Receive messages to be forwarded;
[0010] The next hop table entry of the message to be forwarded is obtained step by step; the next hop table entry includes the next hop table entry type and the next hop table entry address of the child level; the next hop table entry type includes automatic protection switching APS and equal cost multi-path routing ECMP;
[0011] Determine the corresponding next hop forwarding path according to the next hop table entry type and the next hop table entry address of each level respectively;
[0012] All of the next-hop forwarding paths constitute a forwarding path for the message to be forwarded, and the message to be forwarded is forwarded through the forwarding path.
[0013] In an optional implementation manner, the step of obtaining the next hop table entry of the message to be forwarded step by step includes:
[0014] Obtaining a forwarding table for the message to be forwarded; the forwarding table is used to record the first-level next hop table entry type and the first-level next hop table entry address;
[0015] Determine a first-level next hop table entry according to the first-level next hop table entry type and the first-level next hop table entry address; the first-level next hop table entry is a type of next hop table entry;
[0016] According to the first-level next-hop table entry, the next-hop table entry of the to-be-forwarded message is acquired level by level.
[0017] In an optional implementation manner, when the next hop table entry type is APS, the step of determining the corresponding next hop forwarding path according to the next hop table entries at each level includes:
[0018] Obtaining a path identifier in the next hop table entry; the path identifier is used to indicate whether the message to be forwarded is forwarded through a backup path;
[0019] A corresponding next-hop forwarding path is determined according to the path identifier.
[0020] In an optional implementation manner, when the next hop table entry type is ECMP, the step of determining the corresponding next hop forwarding path according to the next hop table entries at each level includes:
[0021] Calculate the ECMP hash value according to the message to be forwarded;
[0022] Determine a target ECMP member according to the ECMP hash value and the number of members of the ECMP group in the next hop table entry; the ECMP group includes at least one ECMP member;
[0023] A corresponding next-hop forwarding path is determined according to the target ECMP member.
[0024] In an optional implementation, when the type of the next hop table entry at the previous level is APS and the next hop table entry at the next level is ECMP, the step of determining the corresponding next hop forwarding path according to the next hop table entry at each level includes:
[0025] Obtaining a parent path identifier in an APS table; the APS table refers to a next hop table entry whose next hop table entry type is APS; the parent path identifier is a type of the path identifier;
[0026] Determine a parent forwarding path according to the parent path identifier; the parent forwarding path refers to a forwarding path of the message to be forwarded from the APS table to the next-level next-hop table entry;
[0027] Read the next hop table entry type in the APS table, and obtain that the next hop table entry type of the next level is ECMP;
[0028] Calculate the ECMP hash value according to the message to be forwarded;
[0029] Determine the target ECMP member according to the ECMP hash value and the number of ECMP group members in the ECMP table; the ECMP table refers to the next hop table entry whose next hop table entry type is ECMP; the ECMP group includes at least one ECMP member;
[0030] A corresponding sub-forwarding path is determined according to the target ECMP member; the sub-forwarding path is a type of the forwarding path.
[0031] In a second aspect, the present invention provides a packet forwarding path determination device, applied to a network device, the device comprising:
[0032] A receiving module, used for receiving messages to be forwarded;
[0033] A decision module is used to obtain the next hop table entry of the message to be forwarded level by level; the next hop table entry includes the next hop table entry type and the next hop table entry address of the child level; the next hop table entry type includes automatic protection switching APS and equal cost multi-path routing ECMP; according to the next hop table entry type and the next hop table entry address of each level, the corresponding next hop forwarding path is determined; all the next hop forwarding paths constitute the forwarding path of the message to be forwarded, and the message to be forwarded is forwarded through the forwarding path.
[0034] In an optional implementation manner, the decision module is specifically used to:
[0035] Obtain a forwarding table for the message to be forwarded; the forwarding table is used to record a first-level next hop table entry type and a first-level next hop table entry address; determine a first-level next hop table entry according to the first-level next hop table entry type and the first-level next hop table entry address; the first-level next hop table entry is a type of next hop table entry; according to the first-level next hop table entry, obtain the next hop table entry of the message to be forwarded step by step.
[0036] In an optional implementation manner, when the next hop table entry type is APS, the decision module is specifically configured to:
[0037] Obtain a path identifier in the next hop table entry; the path identifier is used to indicate whether the message to be forwarded is forwarded through a backup path; and determine a corresponding next hop forwarding path according to the path identifier.
[0038] In a third aspect, the present invention provides a network device, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the method for determining a message forwarding path as described in any one of the aforementioned implementation modes when calling the computer program.
[0039] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for determining a message forwarding path as described in any one of the aforementioned implementations.
[0040] Compared with the prior art, the message forwarding path determination method, device, network device and storage medium provided by the embodiments of the present invention receive messages to be forwarded; obtain the next hop table items of the messages to be forwarded step by step; the next hop table items contain the next hop table item types and next hop table item addresses of the sub-levels; the next hop table item types include automatic protection switching APS and equal cost multi-path routing ECMP; determine the corresponding next hop forwarding path according to the next hop table item types and next hop table item addresses of each level; all next hop forwarding paths constitute the forwarding path of the message to be forwarded, and forward the message to be forwarded through the forwarding path. This scheme realizes the isomorphic design of the next hop table items by adding the next hop table item types in the next hop table items, and the information formats of any two next hop table items are compatible and matched, which facilitates the flexible nesting and cascading of APS and ECMP, thereby improving network reliability and increasing network bandwidth.
[0041] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 A schematic diagram of a process for determining a message forwarding path provided by an embodiment of the present invention is shown.
[0044] Figure 2 Shows Figure 1 A schematic flow chart of a sub-step of step S101.
[0045] Figure 3 A schematic diagram of the homogeneous design of next hop table entries is shown.
[0046] Figure 4 A schematic diagram of a cascade of next hop table entries of the first level where the next hop table entry type is ECMP is shown.
[0047] Figure 5 A schematic diagram of a cascade of next hop table entries of the first level with the next hop table entry type of APS is shown.
[0048] Figure 6 A schematic diagram showing ECMP members cascading APS for backup.
[0049] Figure 7 A block diagram of a packet forwarding path determination device 200 according to an embodiment of the present invention is shown.
[0050] Figure 8 A block diagram of a network device provided by an embodiment of the present invention is shown.
[0051] Icons: 100 - network device; 110 - memory; 120 - processor; 130 - communication module; 200 - message forwarding path determination device; 201 - receiving module; 202 - decision module. DETAILED DESCRIPTION
[0052] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0053] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0054] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0055] Existing technologies usually use automatic protection switching and redundant backup technology of equal-cost multi-path routing to improve network reliability and network resource utilization, thereby solving the problem of packet loss in network devices. However, currently, there is still no breakthrough in the market for multi-level nested applications of automatic protection switching and equal-cost multi-path routing.
[0056] Based on this, the embodiments of the present invention provide a method, device, network device and storage medium for determining a message forwarding path provided by the embodiments of the present invention. By adding the next hop table item type in the next hop table item, the isomorphic design of the next hop table item is realized, and the information formats of any two next hop table items are compatible and matched, which facilitates the flexible nesting cascading of APS and ECMP, thereby improving network reliability and increasing network bandwidth.
[0057] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0058] Please refer to Figure 1 , Figure 1 A schematic diagram of a process for determining a message forwarding path provided by an embodiment of the present invention is shown, and the method comprises the following steps:
[0059] Step S101, receiving a message to be forwarded.
[0060] In the embodiment of the present invention, the user plans a network forwarding scheme based on actual applications, and generates a cascade next hop table entry of the network device according to the user's network forwarding scheme. When the network device receives a message to be forwarded, it forwards the message according to the cascade next hop table entry of the network device.
[0061] Step S102, obtaining the next hop table entry of the message to be forwarded level by level.
[0062] The next hop table entry includes the next hop table entry type and the next hop table entry address of the child level; the next hop table entry types include automatic protection switching APS and equal cost multi-path routing ECMP.
[0063] In an embodiment of the present invention, after receiving a message to be forwarded, the network device obtains the next hop table entry of the message to be forwarded step by step. The information formats of different types of next hop table entries may be different. In order to realize cascaded next hop forwarding, this solution performs a homogeneous design on the next hop table entry, and adds a next hop table entry type field to the next hop table entry, thereby realizing the parsing of different types of next hop table entries, and then realizing compatible matching of the information formats of any two next hop table entries.
[0064] Step S103: Determine the corresponding next hop forwarding path according to the next hop table entry type and the next hop table entry address of each level.
[0065] In an embodiment of the present invention, the next-hop table entry of the next level can be obtained according to the next-hop table entry address recorded in the next-hop table entry of the previous level, the type of the next-hop table entry of the next level can be known according to the next-hop table entry type recorded in the next-hop table entry of the previous level, and the corresponding information format is parsed according to the type, and then the corresponding next-hop forwarding path is determined according to the parsed information.
[0066] Step S104: All next-hop forwarding paths constitute a forwarding path for the message to be forwarded, and the message to be forwarded is forwarded through the forwarding path.
[0067] In the embodiment of the present invention, after all forwarding paths are obtained according to the cascaded next hop table entries, the to-be-forwarded message received by the network device is forwarded via the forwarding path and finally outputted from the egress port.
[0068] In summary, the method for determining a message forwarding path provided by an embodiment of the present invention receives a message to be forwarded; obtains the next hop table entry of the message to be forwarded step by step; the next hop table entry includes the next hop table entry type and the next hop table entry address of the child level; the next hop table entry type includes automatic protection switching APS and equal cost multi-path routing ECMP; the corresponding next hop forwarding path is determined according to the next hop table entry type and the next hop table entry address of each level; all next hop forwarding paths constitute the forwarding path of the message to be forwarded, and the message to be forwarded is forwarded through the forwarding path. This scheme realizes the isomorphic design of the next hop table entry by adding the next hop table entry type in the next hop table entry, and the information formats of any two next hop table entries are compatible and matched, which facilitates the flexible nesting and cascading of APS and ECMP, thereby improving network reliability and increasing network bandwidth.
[0069] Optionally, in actual applications, the address and type of the first-level next-hop table entry are recorded in the forwarding table, and before forwarding the message through the next hop, the forwarding table needs to be obtained. Figure 1 Based on Figure 2 The sub-steps of step S101 may include:
[0070] Step S1021, obtaining a forwarding table for the message to be forwarded.
[0071] The forwarding table is used to record the first-level next-hop table entry type and the first-level next-hop table entry address.
[0072] In the embodiment of the present invention, before the message is forwarded through the cascaded next hop table entry, it is necessary to first obtain the forwarding table, and obtain the first-level next hop table entry address and the first-level next hop table entry type through the forwarding table.
[0073] Step S1022: Determine a first-level next hop entry according to the first-level next hop entry type and the first-level next hop entry address.
[0074] The first-level next hop entry is a type of next hop entry.
[0075] In an embodiment of the present invention, a first-level next hop table entry is obtained according to the first-level next hop table entry address, and the first-level next hop table entry information is parsed according to the first-level next hop table entry type, and relevant information of the first-level next hop forwarding path, as well as the next-level next hop table entry type and the next-level next hop table entry address are obtained from the first-level next hop table entry information.
[0076] Step S1023: According to the first-level next-hop table entry, the next-hop table entry of the message to be forwarded is obtained level by level.
[0077] In the embodiment of the present invention, in order to improve the reliability of network transmission and the utilization rate of network resources, and increase the network service bandwidth, a cascade next hop solution of APS and ECMP flexible nesting is adopted to forward the message, and the address of the next level next hop table item and the type of the next level next hop table item are recorded in the previous level next hop table item, thereby, the next hop table item can be obtained step by step, and the next hop table item information can be parsed according to the next hop table item type. Then, the next hop forwarding path is determined according to the next hop table item information at each level.
[0078] Optionally, in practical applications, APS technology can be used to improve the reliability of network next-hop forwarding. When the next-hop table entry type is APS, Figure 1 Step S103 may include:
[0079] Get the path identifier in the next hop table entry.
[0080] The path identifier is used to indicate whether the message to be forwarded is forwarded through the backup path.
[0081] Determine the corresponding next-hop forwarding path according to the path identifier.
[0082] In the embodiment of the present solution, when the next hop table entry type is APS, the next hop table entry will record the primary path information and the backup path information, and the next hop forwarding path of the message is selected according to the path identifier.
[0083] In order to achieve flexible nesting of APS and ECMP, different next-hop table entries are designed to be isomorphic. Figure 3 For example, Figure 3 A schematic diagram of the homogeneous design of next hop table entries is shown. Assume that the APS type next hop table entry is defined as the DsAPS table, the ECMP type next hop table entry is defined as the DsECMPGroup table, and the basic type next hop table entry is defined as the DsDest table. Different types of next hop table entries are parsed according to the next hop table entry type, so that APS and ECMP can realize flexible nested cascade next hop table entries.
[0084] As an implementation method, the next hop table entry type is added to the next hop table entry index destination. The structure of destination can be {dsType[1:0], tablePtr[18:0] / destmap[18:0]}. The size of the index destination is 21 bits, where destination[20:19] is used to store the next hop table entry type; destination[18:0] is used to store the egress port address or the next-level next hop table entry address. When dsType is 0, the lower 19 bits of destination store the outbound port address, which is represented by destmap; when dsType is 1, the lower 19 bits of destination store the address of the next-hop table entry DsDest at the next level, indicating that the next-hop forwarding needs to continue; when dsType is 2, the lower 19 bits of destination store the address of the next-hop table entry DsAPS at the next level, indicating that the next-hop forwarding needs to continue; when dsType is 3, the lower 19 bits of destination store the address of the next-hop table entry DsECMPGroup at the next level, indicating that the next-hop forwarding needs to continue.
[0085] Specifically, the DsDest table may include the field destination[20:0] and the field nexthopPtr[19:0]. The specific meaning of the lower 19 bits of destination is determined according to destination[20:19]. When destination[20:19] is 0, it means that the lower 19 bits of destination store the egress port address of the message. At this time, nexthopPtr[19:0] stores the editing information of the next hop message. In this case, the message is edited using the format of the editing information of the next hop message, and then forwarded through the egress port. When destination[20:19] is not 0, it means that the lower 19 bits of destination store the address of the next-level next hop table entry.
[0086] It should be noted that nexthopPtr is read to obtain the editing information of the next hop message only when destination[20:19] is 0. In other cases, nexthopPtr is generally not read.
[0087] Specifically, the DsAPS table may include a field destination_w[20:0], a field nexthopPtr_w[19:0], a field destination_p[20:0], a field nexthopPtr_p[19:0], and a field protect_en[0]. Among them, the field protect_en is a path identifier, which is used to indicate whether the message to be forwarded is forwarded through a backup path. When protect_en is 0, it indicates that the primary path is selected to forward the message, and the field destination_w[20:0] and the field nexthopPtr_w[19:0] are used to record the next hop information of the primary path. When protect_en is 1, it indicates that the backup path is selected to forward the message, and the field destination_p[20:0] and the field nexthopPtr_p[19:0] are used to record the next hop information of the backup path. The usage of destination_w and destination_p is similar to that of destination, and the usage of nexthopPtr_w and nexthopPtr_p is similar to that of nexthopPtr, which will not be repeated here.
[0088] Specifically, the DsECMPGroup table may include a field destination[20:0] and a field mem_num. The field mem_num indicates the number of ECMP members in the ECMP group. Assuming that destination[20:19] in the DsECMPGroup table can only be 1, it indicates that the next hop table entry type of the ECMP member can only be the DsDest table. Then destination[18:0] is used to record the starting address of the ECMP member table DsDest.
[0089] Optionally, in practical applications, ECMP technology can be used to increase network bandwidth and improve network resource utilization. When the next hop table entry type is ECMP, Figure 1 Step S103 may include:
[0090] The ECMP hash value is calculated based on the message to be forwarded.
[0091] The target ECMP member is determined according to the ECMP hash value and the number of members of the ECMP group in the next hop table entry.
[0092] The ECMP group includes at least one ECMP member.
[0093] Determine the corresponding next-hop forwarding path based on the target ECMP member.
[0094] In the embodiment of the present invention, when the next hop table entry type is ECMP, it indicates that the message is forwarded by the ECMP group for the next hop. The ECMP hash value of the message to be forwarded is calculated, and the target ECMP member for forwarding the message is determined according to the ECMP hash value and the number of members of the ECMP group, and finally the corresponding next hop forwarding path is determined according to the target ECMP member address recorded in the next hop table entry.
[0095] Optionally, in practical applications, APS and ECMP can be flexibly nested to implement cascaded next-hop forwarding. When the next-hop table entry type of the previous level is APS and the next-hop table entry of the next level is ECMP, Figure 1 Step S103 may include:
[0096] Get the parent path ID in the APS table.
[0097] The APS table refers to a next hop table entry whose next hop table entry type is APS; and the parent path identifier is a type of path identifier.
[0098] According to the parent path identifier, the parent forwarding path is determined.
[0099] The parent forwarding path refers to the forwarding path of the message to be forwarded from the APS table to the next-level next-hop table entry.
[0100] The next hop entry type in the APS table is read, and the next hop entry type of the next level is obtained as ECMP.
[0101] The ECMP hash value is calculated based on the message to be forwarded.
[0102] The target ECMP member is determined based on the ECMP hash value and the number of ECMP group members in the ECMP table.
[0103] The ECMP table refers to a next hop table entry whose next hop table entry type is ECMP; and the ECMP group includes at least one ECMP member.
[0104] The corresponding sub-forwarding path is determined according to the target ECMP member.
[0105] Among them, the sub-forwarding path is a type of forwarding path.
[0106] In the embodiment of the present invention, the APS cascade ECMP mode is adopted for next-hop forwarding, the APS table is parsed according to the next-hop table entry type, and it is determined whether to use the backup path to forward the message according to the path identifier in the APS table. If it is determined to use the backup path for the next-hop forwarding of the message, the next-level next-hop table entry type and the next-level next-hop table entry address recorded in the backup path are obtained, and the next-level next-hop table entry is obtained according to the next-level next-hop table entry address. The next-level next-hop table entry is parsed according to the next-level next-hop table entry type ECMP, the ECMP hash value of the message to be forwarded is calculated, and then the destination ECMP member participating in the next-hop forwarding message is determined according to the ECMP hash value and the number of ECMP members, and finally the next-hop table entry of the target ECMP member is obtained according to the next-hop table entry address of the target ECMP member recorded in the ECMP table, so as to realize the subsequent cascade next-hop forwarding of the message.
[0107] As an implementation method, Figure 4 and Figure 5 For example, Figure 4 A schematic diagram showing a cascade of next hop table entries in which the first level next hop table entry is an APS next hop table entry, Figure 5 FIG. 4 shows a schematic diagram of a cascade of next hop table entries in which the first level next hop table entry is an ECMP next hop table entry. Figure 4 and Figure 5It can be seen that the isomorphic design of the next hop table entry is achieved by adding the next hop table entry type in the next hop table entry. After the isomorphic design, the information formats of any two next hop table entries are compatible and matched, which facilitates the flexible nesting and cascading of APS and ECMP. The master and backup member information of APS can record the final egress port, the next-level ECMP, or the next-level APS. Similarly, the member information of ECMP can be the final egress port, the next-level ECMP, or the next-level APS. Therefore, according to the needs of network deployment, the next hop table entry can be flexibly nested, whether it is APS or ECMP, and then realize cascaded next-hop forwarding, improving network reliability and network resource utilization.
[0108] Specifically, in a network containing tunnels, such as data center network applications, different redundant backup technologies are used for different network layers or different message forwarding paths of the OverLay network or UnderLay network according to business needs, greatly improving network reliability and increasing network bandwidth.
[0109] As an implementation method, the application of ECMP in a data center is used as an example for explanation. Figure 6 Assume that the upstream egress of the data center is a group of ECMPs with a total of 4 ECMP members. In order to prevent the link disconnection of the ECMP member egress and cause network disconnection, a cascaded APS method is used to add a backup egress for each ECMP member.
[0110] According to the next hop entry type destination[20:19] recorded in the forwarding table, it can be known that the next hop entry type of the forwarded message is ECMP. The ECMP hash value of the message can be calculated according to the characteristic field of the message in the message inlet processing engine, and then the ECMP table is read through the next hop entry address destination[18:0] recorded in the forwarding table, that is, the DsECMPGroup table mentioned above. Then the target ECMP member is determined by the member decision algorithm, such as taking the modulus of the ECMP hash value of the message and the number of ECMP members, and determining the target ECMP member according to the modulus result. According to the next hop entry address of the target ECMP member recorded in the ECMP table, the next hop entry DsDest table of the target ECMP member is read. According to the destination[20:19] field in the DsDest table, it is known that the next hop entry type is APS. Then, according to the destination[18:0] field in the DsDest table, the next hop entry address is obtained, and the APS table is read according to the next hop entry address, that is, the DsAPS table mentioned above. The next hop forwarding path is determined according to the path identifier protect_en field in the DsAPS table. Assuming that when protect_en is 0, the primary path is selected to forward the message, and the final egress port and next hop editing information of the message are obtained according to the fields destination_w and nexthopPtr_w of the primary path information. When protect_en is 1, the backup path is selected to forward the message, and the final egress port and next hop editing information of the message are obtained according to the fields destination_p and nexthopPtr_p of the backup path information.
[0111] It should be noted that, whether the next-hop forwarding type of the ECMP member is APS or ECMP, it is necessary to obtain the next-level next-hop table entry related information by accessing the next-hop table entry DsDest table of the ECMP member.
[0112] It can be seen that by adding the next hop table entry type to the next hop table entry, the isomorphic design of the next hop table entry is realized, and the information formats of any two next hop table entries are compatible and matched, which facilitates the flexible nesting and cascading of APS and ECMP, thereby improving network reliability and increasing network bandwidth.
[0113] Based on the same inventive concept, the embodiment of the present invention also provides a message forwarding path determination device, please refer to Figure 7 , Figure 7 The block diagram of the packet forwarding path determination device 200 according to the embodiment of the present invention is shown. The packet forwarding path determination device 200 is applied to a network device, and the packet forwarding path determination device 200 comprises a receiving module 201 and a decision module 202 .
[0114] The receiving module 201 is used to receive a message to be forwarded.
[0115] The decision module 202 is used to obtain the next hop table entry of the message to be forwarded step by step; the next hop table entry includes the next hop table entry type and the next hop table entry address of the child level; the next hop table entry type includes automatic protection switching APS and equal cost multi-path routing ECMP; according to the next hop table entry type and the next hop table entry address of each level, the corresponding next hop forwarding path is determined; all the next hop forwarding paths constitute the forwarding path of the message to be forwarded, and the message to be forwarded is forwarded through the forwarding path.
[0116] Optionally, the decision module 202 is specifically used to obtain a forwarding table for the message to be forwarded; the forwarding table is used to record the first-level next hop table item type and the first-level next hop table item address; the first-level next hop table item is determined according to the first-level next hop type and the first-level next hop type; the first-level next hop table item is a type of next hop table item; according to the first-level next hop table item, the next hop table items of the message to be forwarded are obtained step by step.
[0117] Optionally, when the next hop table entry type is APS, the decision module 202 is specifically used to obtain a path identifier in the next hop table entry; the path identifier is used to indicate whether the message to be forwarded is forwarded through a backup path; and determine the corresponding next hop forwarding path according to the path identifier.
[0118] Optionally, when the next hop table entry type is ECMP, the decision module 202 is specifically used to calculate an ECMP hash value based on the message to be forwarded; determine the target ECMP member based on the ECMP hash value and the number of members of the ECMP group in the next hop table entry; the ECMP group includes at least one ECMP member; and determine the corresponding next hop forwarding path based on the target ECMP member.
[0119] Optionally, when the next hop table item type of the previous level is APS and the next hop table item of the next level is ECMP, the decision module 202 is specifically used to obtain the parent path identifier in the APS table; the APS table refers to the next hop table item whose next hop table item type is APS; the parent path identifier is a type of path identifier; according to the parent path identifier, the parent forwarding path is determined; the parent forwarding path refers to the forwarding path of the message to be forwarded from the APS table to the next hop table item of the next level; the next hop table item type in the APS table is read to obtain the next level next hop table item type of ECMP; according to the message to be forwarded, the ECMP hash value is calculated; according to the ECMP hash value and the number of ECMP group members in the ECMP table, the target ECMP member is determined; the ECMP table refers to the next hop table item whose next hop table item type is ECMP; the ECMP group contains at least one ECMP member; the corresponding sub-forwarding path is determined according to the target ECMP member; the sub-forwarding path is a type of forwarding path.
[0120] Please refer to Figure 8 , is a block diagram of a network device 100 provided in an embodiment of the present invention. The network device 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, the processor 120, and the communication module 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0121] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.
[0122] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions. For example, when the computer program stored in the memory 110 is executed by the processor 120, the packet forwarding path determination method disclosed in the above embodiments can be implemented.
[0123] The communication module 130 is used to establish a communication connection between the network device 100 and other communication terminals through the network, and to send and receive data through the network.
[0124] It should be understood that Figure 8 The structure shown is only a schematic diagram of the structure of the network device 100. The network device 100 may also include Figure 8 More or fewer components as shown, or with Figure 8 Different configurations are shown. Figure 8 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0125] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the processor 120, the method for determining a message forwarding path disclosed in the above embodiments is implemented.
[0126] In summary, the method, device, network device and storage medium for determining the message forwarding path provided by the embodiments of the present invention receive the message to be forwarded; obtain the next hop table entry of the message to be forwarded step by step; the next hop table entry contains the next hop table entry type and the next hop table entry address of the child level; the next hop table entry type includes automatic protection switching APS and equal cost multi-path routing ECMP; determine the corresponding next hop forwarding path according to the next hop table entry type and the next hop table entry address of each level respectively; all next hop forwarding paths constitute the forwarding path of the message to be forwarded, and forward the message to be forwarded through the forwarding path. This scheme realizes the isomorphic design of the next hop table entry by adding the next hop table entry type in the next hop table entry, and the information formats of any two next hop table entries are compatible and matched, which facilitates the flexible nesting and cascading of APS and ECMP, thereby improving network reliability and increasing network bandwidth.
[0127] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0128] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0129] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0130] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for determining a message forwarding path, characterized in that: Applied to a network device, the method comprises: Receive messages to be forwarded; The next hop table entry of the message to be forwarded is obtained step by step; the next hop table entry includes the next hop table entry type and the next hop table entry address of the child level; the next hop table entry type includes automatic protection switching APS and equal cost multi-path routing ECMP; Determine the corresponding next hop forwarding path according to the next hop table entry type and the next hop table entry address of each level respectively; All of the next-hop forwarding paths constitute a forwarding path for the message to be forwarded, and the message to be forwarded is forwarded through the forwarding path.
2. The method for determining a message forwarding path according to claim 1, characterized in that: The step of obtaining the next hop table entry of the message to be forwarded step by step includes: Obtaining a forwarding table for the message to be forwarded; the forwarding table is used to record the first-level next hop table entry type and the first-level next hop table entry address; Determine a first-level next hop table entry according to the first-level next hop table entry type and the first-level next hop table entry address; the first-level next hop table entry is a type of next hop table entry; According to the first-level next-hop table entry, the next-hop table entry of the to-be-forwarded message is acquired level by level.
3. The method for determining a message forwarding path according to claim 1, characterized in that: In the case where the next hop table entry type is APS, the step of determining the corresponding next hop forwarding path according to the next hop table entries at each level includes: Obtaining a path identifier in the next hop table entry; the path identifier is used to indicate whether the message to be forwarded is forwarded through a backup path; A corresponding next-hop forwarding path is determined according to the path identifier.
4. The method for determining a message forwarding path according to claim 1, characterized in that: In the case where the next hop table entry type is ECMP, the step of determining the corresponding next hop forwarding path according to the next hop table entries at each level includes: Calculate the ECMP hash value according to the message to be forwarded; Determine a target ECMP member according to the ECMP hash value and the number of members of the ECMP group in the next hop table entry; the ECMP group includes at least one ECMP member; A corresponding next-hop forwarding path is determined according to the target ECMP member.
5. The method for determining a message forwarding path according to any one of claims 1 to 4, characterized in that: In the case where the type of the next hop table entry at the previous level is APS and the next hop table entry at the next level is ECMP, the step of determining the corresponding next hop forwarding path according to the next hop table entry at each level includes: Obtaining a parent path identifier in an APS table; the APS table refers to a next hop table entry whose next hop table entry type is APS; the parent path identifier is a type of the path identifier; Determine a parent forwarding path according to the parent path identifier; the parent forwarding path refers to a forwarding path of the message to be forwarded from the APS table to the next-level next-hop table entry; Read the next hop table entry type in the APS table, and obtain that the next hop table entry type of the next level is ECMP; Calculate the ECMP hash value according to the message to be forwarded; Determine the target ECMP member according to the ECMP hash value and the number of ECMP group members in the ECMP table; the ECMP table refers to the next hop table entry whose next hop table entry type is ECMP; the ECMP group includes at least one ECMP member; A corresponding sub-forwarding path is determined according to the target ECMP member; the sub-forwarding path is a type of the forwarding path.
6. A device for determining a message forwarding path, characterized in that: Applied to network equipment, the device comprises: A receiving module, used for receiving messages to be forwarded; A decision module is used to obtain the next hop table entry of the message to be forwarded level by level; the next hop table entry includes the next hop table entry type and the next hop table entry address of the child level; the next hop table entry type includes automatic protection switching APS and equal cost multi-path routing ECMP; according to the next hop table entry type and the next hop table entry address of each level, the corresponding next hop forwarding path is determined; all the next hop forwarding paths constitute the forwarding path of the message to be forwarded, and the message to be forwarded is forwarded through the forwarding path.
7. The device for determining a message forwarding path according to claim 6, characterized in that: The decision module is used to obtain the forwarding table of the message to be forwarded; the forwarding table is used to record the first-level next hop table entry type and the first-level next hop table entry address; according to the first-level next hop table entry type and the first-level next hop table entry address, determine the first-level next hop table entry; The first-level next hop table entry is a type of next hop table entry; according to the first-level next hop table entry, the next hop table entry of the message to be forwarded is acquired level by level.
8. The device for determining a message forwarding path according to claim 6, wherein: In the case where the next hop table entry type is APS, the decision module is used to obtain a path identifier in the next hop table entry; the path identifier is used to indicate whether the message to be forwarded is forwarded through a backup path; A corresponding next-hop forwarding path is determined according to the path identifier.
9. A network device, characterized in that: The network device includes a memory and a processor, the memory is used to store a computer program, and the processor is used to execute the message forwarding path determination method according to any one of claims 1 to 5 when calling the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for determining a message forwarding path as described in any one of claims 1 to 5 is implemented.
