Message forwarding method and device, readable storage medium and electronic equipment
Patent Information
- Application Number
- CN202210014141.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-06
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-01-06
AI Technical Summary
[0005]本申请的目的是提供一种报文转发方法、装置、可读存储介质以及电子设备,能够解决在索引值不属于当前路由节点的SRGB配置范围的情况下,当前路由节点无法转发待发送报文的问题
[0017]In this application, when the first message to be sent is transmitted to the current routing node, the current routing node first obtains the first message to be sent and a first Multiprotocol Label Switching (MPLS) label. The first MPLS label includes a first label value and a first transformation value. Then, based on the first label value and the first transformation value, the node looks up the target record corresponding to the first message to be sent in the MPLS forwarding table. Next, based on the second label value, the second transformation value, the destination index value, and the second sRGB range value in the target record, a second MPLS label is generated. Finally, based on the second MPLS label, the first message to be sent is forwarded. Thus, the MPLS forwarding table is used to store at least one message record. The label value of the outgoing label of the next-hop routing node in the message record can adapt to different sRGB configuration ranges, so that even if the destination index value of the first message to be sent does not belong to the first sRGB configuration range, the current routing node can still forward the first message to be sent, thereby improving the compatibility of the communication network with bearer network devices with different sRGB configuration ranges.
Smart Images

Figure CN116455810B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a message forwarding method, apparatus, readable storage medium, and electronic device. Background Technology
[0002] Segment routing (SR) is a packet forwarding technology. Specifically, it uses a source path selection mechanism to pre-encapsulate packet path information for the packet to be sent at the source node. This packet path information includes the order of the routing nodes to be passed through and the segment identifier. When the packet to be sent passes through each routing node, it is forwarded according to the forwarding table corresponding to the segment identifier of the routing node.
[0003] In Multi-Protocol Label Switching (MPLS) networks, SR (Segment Redirect) technology can be used to assign tags as segment identifiers and forward packets to be sent according to the forwarding table corresponding to the tags. The tags can be assigned according to the destination Internet Protocol (IP) address prefix of the packets to be sent.
[0004] In related technologies, the label of a routing node is obtained by adding an index value to the initial value in the Segment Routing Global Block (SRGB) configuration range of the current routing node. Since the bearer network devices corresponding to each routing node can independently determine their SRGB configuration range during communication, meaning the SRGB configuration ranges for each routing node are unrelated, different routing nodes may correspond to different SRGB configuration ranges. If the index value does not belong to the current routing node's SRGB configuration range, it may cause the current routing node to be unable to identify the destination IP address of the packet to be sent corresponding to the index value, thus preventing the current routing node from forwarding the packet. Summary of the Invention
[0005] The purpose of this application is to provide a message forwarding method, apparatus, readable storage medium, and electronic device that can solve the problem that the current routing node cannot forward the message to be sent when the index value does not belong to the sRGB configuration range of the current routing node.
[0006] To achieve the above objectives, this application adopts the following technical solution:
[0007] Firstly, this application provides a message forwarding method applied to a current routing node. The method includes: obtaining a first message to be sent and a first Multiprotocol Label Switching (MPLS) label, wherein the first MPLS label includes a first label value and a first transformation value, the first transformation value being a value representing the mapping relationship between a first index value and a destination index value, the destination index value corresponding to the destination address of the first message to be sent, and the first label value being the sum of the first index value and the initial value of a first segment routing global block (SRGB), the first SRGB being a pre-configurable range of segment routing global blocks in the current routing node; and searching for the target record corresponding to the first message to be sent in an MPLS forwarding table based on the first label value and the first transformation value, wherein the MPLS forwarding table is used to store at least one message record, and the message record is used to record the message index and node parameters of a second message to be sent, the node parameters including: The current routing node's translation parameters, the current routing node's ingress label, the outgress label for hopping to the next-hop routing node, and the target record are at least one packet record that meets preset conditions. The preset conditions are: the ingress label of the current routing node has a first label value, and the translation parameters of the current routing node have a first translation value. A second MPLS label is generated based on the second label value, the second translation value, the destination index value, and the range value of the second sRGB. The second label value is the label value of the outgress label for hopping to the next-hop routing node in the target record, the second translation value is the translation value of the translation parameters for hopping to the next-hop routing node in the target record, and the second sRGB is the preset configurable range of the segment routing global block in the next-hop routing node in the target record. The first packet to be sent is forwarded based on the second MPLS label.
[0008] Optionally, the first MPLS label includes a first outer label, or the first MPLS label includes a first outer label and a first inner label; the preset encoding format includes a first label bit and a second label bit; obtaining the first label value and the first conversion value in the first multi-protocol label switching (MPLS) label includes: if the label value of the first label bit in the first outer label is not a first preset value, determining the first label value according to the preset label encoding format as: the label value of the first label bit, and determining the first conversion value as null; if the label value of the first label bit in the first outer label is a first preset value, determining the first conversion value according to the preset label encoding format as: the label value of the second label bit in the first outer label; and determining the first label value according to the preset label encoding format as: the label value of the first label bit in the first inner label.
[0009] Optionally, the above message forwarding method further includes: before searching for the target record corresponding to the first message to be sent in the MPLS forwarding table based on the first tag value and the first transformation value, generating a message record based on the second index value, the first sRGB range value and the third sRGB range value, wherein the second index value is the index value of the message index of the second message to be sent, and the third sRGB is the configurable range of the pre-set segment route global block in the next-hop routing node corresponding to the second message to be sent; merging the message records to generate an MPLS forwarding table.
[0010] Optionally, a message record is generated based on the second index value, the first sRGB range value, and the third sRGB range value, including: obtaining the label value of the incoming label of the current routing node and the conversion value of the conversion parameters of the current routing node based on the comparison result between the second index value and the first sRGB range value; obtaining the label value of the outgoing label of the next-hop routing node and the conversion value of the conversion parameters of the next-hop routing node based on the second index value and the third sRGB range value; and generating a message record based on the second index value, the label value of the incoming label of the current routing node, the conversion value of the conversion parameters of the current routing node, the label value of the outgoing label of the next-hop routing node, the conversion value of the conversion parameters of the next-hop routing node, and the message outgoing interface corresponding to the next-hop routing node.
[0011] Optionally, based on the comparison result between the second index value and the range value of the first sRGB, the label value of the incoming label of the current routing node and the conversion value of the conversion parameter of the current routing node are obtained, including: if the second index value is less than or equal to the range value of the first sRGB, the label value of the incoming label of the current routing node is determined to be the sum of the second index value and the initial value of the first sRGB, and the conversion value of the conversion parameter of the current routing node is null; if the second index value is greater than the range value of the first sRGB, the label value of the incoming label of the current routing node is determined to be the sum of the third index value and the range value of the first sRGB, and the third index value satisfies: the product of the third conversion value and the second preset value, plus the third index value, equals the second index value, and the conversion value of the conversion parameter of the current routing node is determined to be the third conversion value.
[0012] Optionally, based on the second index value and the range value of the third sRGB, the label value of the outgoing label for jumping to the next-hop routing node and the conversion value of the conversion parameters for jumping to the next-hop routing node are obtained, including: if the second index value is less than or equal to the range value of the third sRGB, the label value of the outgoing label for jumping to the next-hop routing node is determined to be the sum of the initial values of the second index value and the third sRGB; if the second index value is greater than the range value of the third sRGB, the label value of the outgoing label for jumping to the next-hop routing node is determined to be the sum of the initial values of the fourth index value and the third sRGB, wherein the fourth index value satisfies the condition that the product of the fourth conversion value and the second preset value, plus the fourth index value, equals the second index value, and the conversion value of the conversion parameters for jumping to the next-hop routing node is determined to be the fourth conversion value.
[0013] Optionally, a message record is generated based on the second index value, the first sRGB range value, and the third sRGB range value, including: if the destination index value is less than or equal to the second sRGB range value, determining that the second MPLS label includes a second outer label, encoding the second label value in the first label bit of the second outer label, and generating the second MPLS label; if the destination index value is greater than the second sRGB range value, determining that the second MPLS label includes a second outer label and a second inner label, encoding the first preset data in the first label bit of the second outer label, encoding the second conversion value in the second outer label, and encoding the second label value in the first label bit of the second inner label, and generating the second MPLS label.
[0014] Secondly, this application provides a message forwarding apparatus, comprising: an acquisition unit, a lookup unit, a generation unit, and a forwarding unit; the acquisition unit is configured to acquire a first message to be sent and a first Multiprotocol Label Switching (MPLS) label, the first MPLS label including a first label value and a first transformation value, the first label value identifying the destination address of the first message to be sent in the current routing node, the first transformation value representing the mapping relationship between a first index value and a destination index value, the destination index value corresponding to the destination address of the first message to be sent, the first label value being the sum of the first index value and the initial value of the first segment routing global block (SRGB), the first SRGB being a pre-configurable range of the segment routing global block in the current routing node; the lookup unit is configured to look up the target record corresponding to the first message to be sent in the MPLS forwarding table according to the first label value and the first transformation value, the MPLS forwarding table being configured to store at least one message record, the message record being configured to record a second message to be sent. The message index and node parameters of the packet include: the translation parameters of the current routing node, the ingress label of the current routing node, the outgress label of the next-hop routing node, and the translation parameters of the next-hop routing node. The target record is a record that meets a preset condition in at least one packet record. The preset condition is: the label value of the ingress label of the current routing node is a first label value, and the parameter value of the translation parameters of the current routing node is a first translation value. The generation unit is used to generate a second MPLS label based on the second label value, the second translation value, the destination index value, and the range value of the second sRGB. The second label value is the label value of the outgress label of the next-hop routing node in the target record, the second translation value is the translation value of the translation parameters of the next-hop routing node in the target record, and the second sRGB is the preset configurable range of the segment routing global block in the next-hop routing node in the target record. The forwarding unit is used to forward the first packet to be sent based on the second MPLS label.
[0015] Thirdly, this application provides a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0016] Fourthly, this application provides an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0017] In this application, when the first message to be sent is transmitted to the current routing node, the current routing node first obtains the first message to be sent and a first Multiprotocol Label Switching (MPLS) label. The first MPLS label includes a first label value and a first transformation value. Then, based on the first label value and the first transformation value, the node looks up the target record corresponding to the first message to be sent in the MPLS forwarding table. Next, based on the second label value, the second transformation value, the destination index value, and the second sRGB range value in the target record, a second MPLS label is generated. Finally, based on the second MPLS label, the first message to be sent is forwarded. Thus, the MPLS forwarding table is used to store at least one message record. The label value of the outgoing label of the next-hop routing node in the message record can adapt to different sRGB configuration ranges, so that even if the destination index value of the first message to be sent does not belong to the first sRGB configuration range, the current routing node can still forward the first message to be sent, thereby improving the compatibility of the communication network with bearer network devices with different sRGB configuration ranges. Attached Figure Description
[0018] Figure 1 One of the flowcharts of a message forwarding method provided in this application embodiment;
[0019] Figure 2 A schematic diagram illustrating a preset label format provided in an embodiment of this application;
[0020] Figure 3 One of the schematic diagrams illustrating the routing node relationship provided in this application embodiment;
[0021] Figure 4 A second schematic flowchart illustrating a message forwarding method provided in an embodiment of this application;
[0022] Figure 5 The third flowchart illustrates a message forwarding method provided in this application embodiment;
[0023] Figure 6 A schematic diagram illustrating a process for generating an MPLS forwarding table, provided as an embodiment of this application;
[0024] Figure 7 This is a second schematic diagram illustrating a routing node relationship provided in an embodiment of this application.
[0025] Figure 8 This is a schematic diagram of the structure of a message forwarding device provided in an embodiment of this application;
[0026] Figure 9 This is a hardware schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] It should be noted that any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0029] To facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish the same or similar items with essentially the same function and effect. Those skilled in the art can understand that the terms "first" and "second" are not intended to limit the quantity or execution order.
[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0031] The message forwarding method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0032] For packet forwarding scenarios, the network devices involved include: packet senders, packet receivers, and routing nodes. A packet forwarding path is generated based on the IP address of the packet sender, the IP address of the packet receiver, and the routing table. This forwarding path includes multiple routing nodes. The routing table includes identifiers for these routing nodes. When using SR technology for packet forwarding in an MPLS network, each routing node can independently set the sRGB range and its corresponding value domain. The first label value corresponding to the destination index value of the packet to be sent is obtained by adding the initial sRGB value of each routing node to the destination index value. Therefore, if all routing nodes on the packet forwarding path have the same initial sRGB value, the first label value corresponding to the destination index value will be the same when forwarding the packet on the packet path, allowing the packet to be forwarded based on the first label value.
[0033] However, in practical applications, due to limitations of the current network, equipment manufacturing capabilities, or manufacturer business strategies, the initial sRGB values, sRGB range values, and corresponding value domains of all routing nodes on the packet forwarding path are configured differently. If the index value does not belong to the sRGB configuration range of the current routing node, it may cause the current routing node to be unable to identify the destination IP address of the packet to be sent corresponding to the index value, thereby causing the current routing node to be unable to forward the packet to be sent.
[0034] To solve the above technical problems, a special processing mechanism for the destination index value and an extended definition of MPLS labels and MPLS forwarding tables are used to enable the forwarding of packets even when multiple routing nodes in the packet forwarding route correspond to different sRGB range values and the value domains of the range values.
[0035] like Figure 1 As shown in the figure, this application provides a message forwarding method, which may include steps 101 to 104 as described below. The method will be executorically described below using a message forwarding device as the executing entity.
[0036] Step 101: The message forwarding device acquires the first message to be sent and the first Multiprotocol Label Switching (MPLS) label.
[0037] In this embodiment, the first MPLS label includes a first label value and a first transformation value. The first transformation value represents the mapping relationship between the first index value and the destination index value. The destination index value corresponds to the destination address of the first message to be sent. The first label value is the sum of the first index value and the initial value of the first segment routing global block (SRGB). The first SRGB is the configurable range of the segment routing global block preset in the current routing node. The first SRGB includes the initial value and the range value of the first SRGB. Specifically, the range value of the first SRGB is the number of configurable index values, and the initial value of the first SRGB refers to the minimum value in the value range corresponding to the first SRGB range value. For example, if the range value of the first SRGB is 8000, the value range corresponding to the first SRGB range value is [16000, 23999], and the value range corresponding to the first SRGB range value is 16000.
[0038] It should be noted that the first message to be sent is a data unit exchanged and transmitted in the network, that is, a data block that a station will send at one time, which contains the complete data information to be sent. The first MPLS label is used to forward the first message to be sent.
[0039] In this embodiment of the application, the routing node that forwards the first packet to be sent in the MPLS network no longer looks up routes based on IP addresses. Instead, it establishes a virtual forwarding channel by assigning labels to each routing node along the packet forwarding path, thereby achieving the forwarding of the first packet to be sent. The packet forwarding device is any routing node in the aforementioned packet forwarding path.
[0040] It is understood that the content of the first message to be sent does not affect the message forwarding process. Therefore, in this embodiment, there are no limitations on the message format, message content, and forwarding time of the first message to be sent.
[0041] In this embodiment, if the first conversion value is null, then the first MPLS label includes a first outer label; if the first conversion value is not null, then the first MPLS label includes a first outer label and a first inner label. Both the first outer label and the second inner label are encoded according to a preset encoding format.
[0042] In this embodiment of the application, the preset encoding format includes a first tag bit and a second tag bit. For example... Figure 2 As shown, the preset label format includes the label value `label` (corresponding to the first label bit), the experimental value `Exp` (corresponding to the second label bit), the stack bottom value `S`, and the Time to Live (TTL). The preset label format also allows setting the corresponding bits for each part: 20 bits for `label`, 3 bits for `Exp`, 1 bit for `S`, and 8 bits for `TTL`. After converting the binary value stored in the 20 bits corresponding to `label` into a decimal value, the sixteen values from 0 to 15 are used to mark special purposes. The value 0 represents "Internet Protocol version 4 (IPv4) explicit null tag", the value 1 represents "routing alarm tag", the value 2 represents "IPv6 explicit null tag", the value 3 represents "fuzzy null tag", and the values 4-15 are undefined values that can mark special purposes.
[0043] Optionally, this step specifically includes: if the tag value of the first tag position in the first outer tag is not a first preset value, determine the first tag value as the tag value of the first tag position according to the preset tag encoding format, and determine the first conversion value as an empty value; if the tag value of the first tag position in the first outer tag is the first preset value, determine the first conversion value as the tag value of the second tag position in the first outer tag according to the preset tag encoding format; and determine the first tag value as the tag value of the first tag position in the first inner tag according to the preset tag encoding format. For example, the first preset value can be 4.
[0044] In one example, if the tag value of the first tag bit in the first outer tag is not a first preset value, that is, if the first outer tag is not used to mark a special purpose, then the first tag value can be determined to be: the tag value of the first tag bit.
[0045] In another example, when the tag value of the first tag bit in the first outer tag is a first preset value, i.e., the first outer tag is used to mark a special purpose, the first conversion value is determined to be the tag value of the second tag bit (i.e., the Exp corresponding to bits 20 to 23) in the first outer tag. Then, it is determined that the first MPLS tag includes both the first outer tag and the first inner tag, and the first tag value is then determined to be the tag value of the first tag bit in the first inner tag.
[0046] Step 102: The message forwarding device searches for the target record corresponding to the first message to be sent in the MPLS forwarding table based on the first tag value and the first conversion value.
[0047] In this embodiment, the MPLS forwarding table is used to store at least one packet record. The packet record includes a packet index and node parameters corresponding to the index value of the packet index. The node parameters include: the transformation parameters of the current routing node, the ingress label of the current routing node, the egress label of the next-hop routing node, and the transformation parameters of the next-hop routing node. The target record is the record that meets the preset conditions among the at least one packet record. The preset conditions are: the label value of the ingress label of the current routing node is a first label value, and the parameter value of the transformation parameters of the current routing node is a first transformation value.
[0048] In this embodiment, when generating the first message to be sent, a message forwarding path is also generated based on the IP address of the message sender, the IP address of the message receiver, and the routing table. The selection criteria for routing nodes in the message forwarding path can be: link cost, physical distance between routing nodes, or network resource usage ratio of each routing node. The sRGB range value of the message receiver, the corresponding value range of the sRGB range, and the destination index value of the first message to be sent are announced to other routing nodes on the message forwarding path via the Interior Gateway Protocol (IGP). Then, based on the sRGB range value and initial sRGB value of each routing node on the message forwarding path, and according to a special processing mechanism for receiving and processing index values, the node parameters of the current routing node are calculated.
[0049] For example, such as Figure 3The diagram illustrates the routing node relationships. The sRGB range values for routing nodes A, B, and F are [16000, 23999], while the sRGB range value for routing node D is [17000, 24999]. The loopback address of routing node F is 1.1.1.100, and its index value corresponding to the first packet to be sent is 100. In the SR domain, the label value of the incoming label for each routing node is the sum of the initial sRGB value and the index value of the current routing node. Simultaneously, the label value of the outgoing label in the MPLS forwarding table corresponding to each routing node, which jumps to the next-hop routing node, depends on the sRGB range value of the next-hop routing node. Therefore, for the first packet to be sent to routing node F, label 16100 is first pushed onto routing node A, and the packet is forwarded along the packet forwarding path with the lowest link cost, i.e., ABDF. After the message is sent to routing node B, MPLS label switching will be performed, changing 16100 to 17100, because the next-hop routing node D expects to receive a label value of 17000 + 100 = 17100 for index value 100.
[0050] In this embodiment of the application, multiple first messages to be sent may need to be forwarded simultaneously in the network. The message receivers of these first messages are different, and the corresponding message forwarding paths are also different. These different forwarding paths may have some overlap. For example... Figure 3 As shown, the forwarding path can be ABDF, ABDE, ABCE, etc. For routing node B, the next hop node can be C or D, and the corresponding message receiver can be E or F. Therefore, after determining the above three forwarding paths, the MPLS forwarding table of routing node B includes three next hop routing nodes, namely D, D, and C.
[0051] In this embodiment of the application, the tag value of the incoming tag of the current routing node in the node parameters is determined based on the destination index value corresponding to the first message to be sent and the first SRGB initial value of the current routing node.
[0052] Step 103: The message forwarding device generates a second MPLS tag based on the second tag value, the second conversion value, the destination index value, and the second sRGB legal entity range value.
[0053] In this embodiment, the second tag value is the tag value of the outgoing tag in the target record that jumps to the next-hop routing node, the second transformation value is the transformation value of the transformation parameter in the target record that jumps to the next-hop routing node, and the second sRGB is the configurable range of the pre-set segment routing global block in the next-hop routing node in the target record. Similar to the first sRGB, the second sRGB corresponds to the initial value of the second sRGB and the range value of the second sRGB. Specifically, the range value of the second sRGB is the number of configurable index values, and the initial value of the second sRGB refers to the minimum value in the value range corresponding to the second sRGB range value. For example, if the range value of the second sRGB is 11000, the value range corresponding to the second sRGB range value is [16000, 26999], and the value range corresponding to the second sRGB range value is 16000.
[0054] Optionally, in this embodiment of the application, according to step 101... Figure 2 The description of generating the second MPLS label specifically includes: when the destination index value is less than or equal to the range value of the second sRGB, determining that the second MPLS label includes a second outer label, encoding the second label value in the first label bit of the second outer label, and generating the second MPLS label; when the destination index value is greater than the range value of the second sRGB, determining that the second MPLS label includes a second outer label and a second inner label, encoding the first preset data in the first label bit of the second outer label, encoding the second conversion value in the second outer label, and encoding the second label value in the first label bit of the second inner label, and generating the second MPLS label.
[0055] It is understandable that when the destination index value is greater than the second sRGB range value, the second MPLS tag is set as a nested two-layer tag, including a second outer tag and a second inner tag.
[0056] Step 104: The message forwarding device forwards the first message to be sent according to the second MPLS tag.
[0057] In this embodiment of the application, the first message to be sent is forwarded according to the second MPLS tag and the communication protocol.
[0058] In the message transmission method provided in this application embodiment, when the first message to be sent is transmitted to the current routing node, the current routing node first obtains the first message to be sent and a first Multiprotocol Label Switching (MPLS) label. The first MPLS label includes a first label value and a first transformation value. Then, based on the first label value and the first transformation value, the node searches for the target record corresponding to the first message to be sent in the MPLS forwarding table. Next, based on the second label value, the second transformation value, the destination index value, and the second sRGB range value in the target record, a second MPLS label is generated. Finally, based on the second MPLS label, the first message to be sent is forwarded. Thus, the MPLS forwarding table is used to store at least one message record. The label value of the outgoing label of the next-hop routing node in the message record can adapt to different sRGB configuration ranges, so that even if the destination index value of the first message to be sent does not belong to the first sRGB configuration range, the current routing node can still forward the first message to be sent, thereby improving the compatibility of the communication network with bearer network devices with different sRGB configuration ranges.
[0059] Optional, in Figure 1 On the basis of, such as Figure 4 As shown in the embodiments of this application, before step 102, the message forwarding method provided in the embodiments of this application may further include steps 401 and 402.
[0060] Step 401: The message forwarding device generates a message record based on the second index value, the first sRGB range value, and the third sRGB range value.
[0061] Step 402: The message forwarding device merges message records and generates an MPLS forwarding table.
[0062] In this embodiment, the second index value is the index value of the message index of the second message to be sent, and the third sRGB is the configurable range of the pre-set segment routing global block in the next-hop routing node corresponding to the second message to be sent. Similar to the first sRGB, the third sRGB includes the initial value and the range value of the third sRGB. Specifically, the range value of the third sRGB is the number of configurable index values, and the initial value of the third sRGB refers to the minimum value in the value range corresponding to the third sRGB range value. For example, if the range value of the third sRGB is 9000, the value range corresponding to the third sRGB range value is [16000, 24999], and the value range corresponding to the third sRGB range value is 16000.
[0063] It should be noted that the MPLS forwarding table includes at least one packet record. If the current routing node may need to forward multiple second packets to be sent, then a packet record is generated for each second packet to be sent, and all packet records are stored in the MPLS forwarding table. Each packet record records the packet index and node parameters of a second packet to be sent.
[0064] In this embodiment, when generating the first message to be sent, a message forwarding path is also generated based on the IP address of the message sender, the IP address of the message receiver, and the routing table. The selection criteria for routing nodes in the message forwarding path can be: link cost, physical distance between routing nodes, or network resource usage ratio of each routing node. The sRGB range value of the message receiver, the corresponding value range of the sRGB range value, and the destination index value of the first message to be sent are announced to other routing nodes on the message forwarding path via the Interior Gateway Protocol (IGP). Then, based on the sRGB range value and initial sRGB value of each routing node on the message forwarding path, and according to a special processing mechanism for receiving and processing index values, the node parameters of the current routing node are calculated.
[0065] Further optional, such as Figure 5 As shown, step 401 can be achieved through steps 501 to 503.
[0066] Step 501: The message forwarding device obtains the tag value of the incoming label of the current routing node and the conversion value of the conversion parameter of the current routing node based on the comparison result between the second index value and the range value of the first sRGB.
[0067] In this embodiment of the application, the current routing node is the packet forwarding device that receives the first MPLS label.
[0068] In this embodiment of the application, this step specifically includes: when the second index value is less than or equal to the range value of the first sRGB, determining that the label value of the incoming label of the current routing node is the sum of the second index value and the initial value of the first sRGB, and the conversion value of the conversion parameter of the current routing node is null; when the second index value is greater than the range value of the first sRGB, determining that the label value of the incoming label of the current routing node is the sum of the third index value and the initial value of the first sRGB, wherein the third index value satisfies that the product of the third conversion value and the second preset value, plus the third index value, equals the second index value, and determining that the conversion value of the conversion parameter of the current routing node is the third conversion value.
[0069] In one scenario, where the second index value is less than or equal to the range of the first sRGB values (i.e., the second index value falls within the value range corresponding to the first sRGB values of the current routing node), the sum of the second index value and the initial value of the first sRGB value falls within the range that the current routing node can recognize. Therefore, the label value of the incoming label of the current routing node is determined to be the sum of the second index value and the initial value of the first sRGB value. Consequently, the transformation parameter of the current routing node has a null value. Of course, when generating the MPLS forwarding table, a null value can be represented by a numerical value or by a special symbol.
[0070] In another case, where the second index value is greater than the range of the first sRGB value, that is, the second index value exceeds the value range corresponding to the first sRGB value of the current routing node, in order to make the tag value of the incoming tag fall into the value range corresponding to the first sRGB value, it is necessary to recalculate the tag value of the incoming tag that conforms to the value range corresponding to the first sRGB value.
[0071] It should be noted that the maximum configurable value for either the first or third sRGB range is currently 64000, while the default and commonly used configuration is 8000. Furthermore, the sRGB range values in existing network settings are generally greater than 8000. Therefore, the second preset value can be 8000. It should also be noted that the second conversion value is an integer.
[0072] In this way, by calculating the label value of the incoming label and the conversion value of the conversion parameter of the current routing node according to the two cases corresponding to the size relationship between the destination index value and the first sRGB range value of the current routing node, the problem of not being able to forward packets due to the different value ranges corresponding to the sRGB range values of different routing nodes can be avoided. This can reduce the restrictions on routing nodes when expanding network devices and improve the success rate of forwarding packets.
[0073] Step 502: Based on the second index value and the third sRGB range value, obtain the tag value of the outgoing tag for jumping to the next hop routing node and the parameter value of the transformation parameter for jumping to the next hop routing node.
[0074] In this embodiment of the application, this step specifically includes: when the second index value is less than or equal to the range value of the third sRGB, determining that the label value of the outgoing label of the next hop routing node is the sum of the second index value and the initial value of the third sRGB; when the second index value is greater than the range value of the third sRGB, determining that the label value of the outgoing label of the next hop routing node is the sum of the fourth index value and the initial value of the third sRGB, wherein the fourth index value satisfies that the product of the fourth conversion value and the second preset value plus the fourth index value equals the second index value, and determining that the conversion value of the conversion parameter of the next hop routing node is the fourth conversion value.
[0075] In this embodiment, the third sRGB refers to the configurable range of the pre-set segment routing global block in the next-hop routing node corresponding to the second message to be sent. Since both the second and third index values are smaller than the range of the third sRGB, the sum of the initial values of the second and third sRGB, and the sum of the initial values of the third index and third sRGB, are both smaller than the range of the third sRGB. This ensures that the label value of the outgoing label of the next-hop routing node conforms to the value range corresponding to the third sRGB range that the next-hop routing node can recognize.
[0076] Step 503: Generate a packet record based on the second index value, the label value of the ingress label of the current routing node, the conversion value of the conversion parameters of the current routing node, the label value of the outgress label of the next hop routing node, the conversion value of the conversion parameters of the next hop routing node, and the packet outgress interface corresponding to the next hop routing node.
[0077] In this embodiment, the blank table has the same table structure as the MPLS forwarding table, and the index value of the packet index is the second index value. For each second index value, a packet record is obtained. All packet records obtained are stored according to the blank table structure to generate the MPLS table.
[0078] An example of the process for generating an MPLS forwarding table is as follows: Figure 6As shown, the process begins by calculating the label value of the incoming label of the current routing node. Specifically, this involves comparing the second index value with the range value of the first sRGB. If the second index value is less than or equal to the range value of the first sRGB, the label value of the incoming label of the current routing node is determined to be the sum of the second index value and the initial value of the first sRGB. The conversion value of the current routing node's conversion parameter is then null. If the second index value is greater than the range value of the first sRGB, the label value of the incoming label of the current routing node is determined to be the sum of the third index value and the initial value of the first sRGB. The third index value satisfies the condition that the product of the third conversion value and the second preset value, plus the third index value, equals the second index value. Therefore, the conversion value of the current routing node's conversion parameter is determined to be the second conversion value. After obtaining the label value of the incoming label of the current routing node, if the second index value is less than or equal to the range of the third sRGB, the label value of the outgoing label of the next-hop routing node is determined to be the sum of the second index value and the initial value of the third sRGB; if the second index value is greater than the range of the third sRGB, the label value of the outgoing label of the next-hop routing node is the sum of the fourth index value and the initial value of the third sRGB, where the fourth index value satisfies the condition that the product of the fourth transformed value and the second preset value, plus the third index value, equals the second index value. Through the above process, the attribute values of each entry in each packet record are obtained and imported into a blank table to generate an MPLS forwarding table. If the second index value is greater than the range of the third sRGB, during the generation of the second MPLS label, the label value of the outgoing label of the next-hop routing node is encapsulated as the second inner label, and the third transformed value and the special identifier (the first preset value) marking that the label is a transformed label are encapsulated as the outer label.
[0079] In this embodiment of the application, Table 1 is the MPLS forwarding table of the routing node. As shown in Table 1, the MPLS forwarding table includes the destination index, the translation parameters of the current routing node, the ingress label of the current routing node, the outgress label of the next-hop routing node, the outgress interface of the next-hop routing node, and the node name of the next-hop routing node. N / A represents a null value.
[0080] Table 1 MPLS forwarding table of routing nodes
[0081]
[0082] In this way, by comparing the second index value with the first sRGB range value of the current routing node, the label value of the incoming label of the current routing node is calculated. By comparing the second index value with the third sRGB range value of the next-hop routing node, the label value of the outgoing label and the conversion value of the conversion parameter for hopping to the next-hop routing node are calculated. This avoids the problem of packets not being forwarded due to different value ranges corresponding to the sRGB range values of different routing nodes, reduces the restrictions on routing nodes when expanding network devices, and improves the success rate of packet forwarding.
[0083] To describe in detail the transformation parameters of the current routing node in the MPLS forwarding table and the generation process of the ingress label of the current routing node, an example is given below:
[0084] In such Figure 7 In the schematic diagram of the routing node relationships shown, the sRGB values of each routing node are as follows: Routing node A has an sRGB range of 9000, corresponding to a value range of [16000, 24999]; routing nodes B, C, D, and F have an sRGB range of 8000, corresponding to a value range of [16000, 23999]; routing node E has an sRGB range of 11000, corresponding to a value range of [16000, 26999]. The loopback address of routing node E is 100.1.1.1, with a corresponding index value of 10000. The loopback address of routing node F is 100.1.1.2, with a corresponding index value of 2000. Routing nodes E and F advertise their respective index values and sRGB range values.
[0085] Assume that the loopback address of routing node E is the first destination address of the packet to be sent, and the index value E corresponding to routing node E is the index value of the first destination. Also assume that the loopback address of routing node F is the second destination address of the packet to be sent, and the index value F corresponding to routing node F is the index value of the second destination. Figure 7 It can be seen that the routing nodes in the first forwarding path of the packet to be sent are ABCE in sequence, and the routing nodes in the second forwarding path of the packet to be sent are ABDF in sequence. Assuming that the second preset value is 8000 when determining the ingress and egress labels, the following is an explanation of each routing node:
[0086] After routing node A receives index value E (10000):
[0087] In the first forwarding path, the ingress label of the current routing node corresponding to routing node A has a first destination index value (10000) that is greater than the sRGB range value A (9000). According to the above packet record generation steps, the second index value is the first destination index value (10000), the first sRGB range value is the sRGB range value A (9000), and the third index value satisfies the following: the product of the third conversion value and the second preset value, plus the third index value, equals the second index value, which is 1×8000+2000=10000. Therefore, the parameter value of the conversion parameter of the current routing node is determined to be 1, the third index value is 2000, and the label value of the ingress label of the current routing node is the sum of the third index value and the first sRGB initial value, that is, the sum of the second index value (2000) and the first sRGB initial value (16000) (18000).
[0088] In the first forwarding path, the outgoing label of the next-hop routing node corresponding to routing node A has a first destination index value (10000) that is greater than the sRGB range value B (8000) of the next-hop routing node B. According to the above packet record generation steps, the second index value is the first destination index value (10000), the second sRGB range value is the sRGB range value B (8000), and the fourth index value satisfies the following: the product of the fourth conversion value and the second preset value, plus the fourth index value, equals the second index value, which is 1×8000+2000=10000. Therefore, the conversion value of the conversion parameter for hopping to the next-hop routing node is determined to be 1, and the label value of the outgoing label for hopping to the next-hop routing node is determined to be the sum of the fourth index value and the initial value of the third sRGB, that is, the sum of the second index value (2000) and the initial value of the second sRGB (16000) (18000).
[0089] After routing node A receives the index value F(2000):
[0090] In the second forwarding path, the ingress label of the current routing node corresponding to routing node A is compared with the index value F (2000) and the sRGB range value A (9000). It is determined that the index value F is less than the sRGB range value A. The label value of the ingress label is the sum of the destination index value F (2000) and the initial value of the first sRGB (16000) (18000).
[0091] In the second forwarding path, the outgoing label of the next-hop routing node corresponding to routing node A is compared with the sum of the index value F (2000) and the sRGB range value B (8000) of the next-hop routing node B (18000).
[0092] The MPLS forwarding table of routing node A, obtained for the first and second forwarding paths, is shown in Table 2 below:
[0093] Table 2 MPLS forwarding table of routing node A
[0094]
[0095] After routing node B receives the outgoing label (18000) from routing node A, according to the calculation method above, the MPLS forwarding table of routing node B in the first forwarding path is shown in Table 3 below:
[0096] Table 3 MPLS forwarding table of routing node B
[0097]
[0098] For the first forwarding path, the second MPLS label generated by routing node A to hop to routing node B needs to be encapsulated with two layers of labels. The second inner label is the label value of the outgoing label to the next-hop routing node B, and the second outer label is a special identifier marking that the label is a transformed label, as well as the parameter value of the transformation parameters to the next-hop routing node B. After receiving the two layers of labels, routing node B first processes the special label of the outer layer, finds that the special identifier marking that the label is a transformed label, records the parameter value of the transformation parameters, and pops the outer label. Routing node B continues to process the inner label, matching the label value (18000) and the transformation multiplier (1) with the MPLS forwarding table to determine the outgoing interface and forward it. The label value of the outgoing label of the next-hop routing node needs to be encapsulated as 26000, and the next hop is routing node C. Routing node C is the penultimate hop. After receiving the label 26000, it will choose to pop the penultimate hop or replace it with an explicit empty label according to the configuration.
[0099] For the second forwarding path, the second MPLS label generated by routing node A to hop to routing node B only contains the label value (18000). Because the outgoing label value has not been modified, the values corresponding to the translation label and translation parameters are all empty. It is matched against the MPLS forwarding table to determine the outgoing interface and forward the data. The outgoing label value of the next-hop routing node is encapsulated as 18000. Routing node D, being the penultimate hop, upon receiving the label with the value 26000, will choose to either pop the penultimate hop or replace it with an explicit empty label based on its configuration. Therefore, although the incoming label values of the current routing nodes in the two MPLS forwarding tables are the same after the translation, by marking this label as a special identifier of the translated label and the first translation value, the outgoing interface for forwarding can be determined, and different services can be distinguished.
[0100] The foregoing mainly describes the solutions of the embodiments of this application from a methodological perspective. It is understood that, in order to achieve the above functions, the message forwarding device includes at least one of the hardware structures and software modules corresponding to each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0101] This application embodiment can divide the message forwarding device into functional units according to the above method example. For example, each function can be divided into separate functional units, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0102] like Figure 8 As shown in the figure, this application embodiment provides a packet forwarding device. This packet forwarding device, applied to the current routing node, includes: an acquisition unit 81, a lookup unit 82, a generation unit 83, and a forwarding unit 84;
[0103] The acquisition unit 81 is used to acquire a first message to be sent and a first Multiprotocol Label Switching (MPLS) label. The first MPLS label includes a first label value and a first transformation value. The first label value identifies the destination address of the first message to be sent in the current routing node. The first transformation value is a value that characterizes the mapping relationship between the first index value and the destination index value. The destination index value corresponds to the destination address of the first message to be sent. The first label value is the sum of the first index value and the initial value of the first segment routing global block (SRGB). The first SRGB is a preset configurable range of segment routing global blocks in the current routing node.
[0104] The lookup unit 82 is used to look up the target record corresponding to the first packet to be sent in the MPLS forwarding table according to the first tag value and the first conversion value. The MPLS forwarding table is used to store at least one packet record. The packet record is used to record the packet index and node parameters of the second packet to be sent. The node parameters include: the conversion parameters of the current routing node, the ingress tag of the current routing node, the egress tag of the next hop routing node, and the conversion parameters of the next hop routing node. The target record is the record in the at least one packet record that meets the preset conditions. The preset conditions are: the tag value of the ingress tag of the current routing node is the first tag value, and the parameter value of the conversion parameters of the current routing node is the first conversion value.
[0105] The generation unit 83 is used to generate a second MPLS label based on the second label value, the second transformation value, the destination index value, and the range value of the second sRGB. The second label value is the label value of the outgoing label of the target record that jumps to the next-hop routing node. The second transformation value is the transformation value of the transformation parameter of the target record that jumps to the next-hop routing node. The second sRGB is the configurable range of the pre-set segment routing global block in the next-hop routing node of the target record.
[0106] Forwarding unit 84 is used to forward the first message to be sent according to the second MPLS label.
[0107] Optionally, the first MPLS label includes a first outer label, or the first MPLS label includes a first outer label and a first inner label; the preset encoding format includes a first label bit and a second label bit; the acquisition unit 81 is specifically used for: when the label value of the first label bit in the first outer label is not a first preset value, determining the first label value as the label value of the first label bit according to the preset label encoding format, and determining the first conversion value as null; when the label value of the first label bit in the first outer label is a first preset value, determining the first conversion value as the label value of the second label bit in the first outer label according to the preset label encoding format; and determining the first label value as the label value of the first label bit in the first inner label according to the preset label encoding format.
[0108] Optionally, the above-mentioned message forwarding device further includes:
[0109] The generation unit 83 is further configured to generate a packet record based on a second index value, a first sRGB range value, and a third sRGB range value before searching for the target record corresponding to the first packet to be sent in the MPLS forwarding table according to the first tag value and the first conversion value. The second index value is the index value of the packet index of the second packet to be sent, and the third sRGB is the configurable range of the pre-set segment route global block in the next-hop routing node corresponding to the second packet to be sent. The packet records are then merged to generate an MPLS forwarding table.
[0110] Optionally, the generation unit 83 is further configured to: obtain the label value of the incoming label of the current routing node and the conversion value of the conversion parameter of the current routing node based on the comparison result between the second index value and the first sRGB range value; obtain the label value of the outgoing label of the next-hop routing node and the conversion value of the conversion parameter of the next-hop routing node based on the second index value and the third sRGB range value; and generate a packet record based on the second index value, the label value of the incoming label of the current routing node, the conversion value of the conversion parameter of the current routing node, the label value of the outgoing label of the next-hop routing node, the conversion value of the conversion parameter of the next-hop routing node, and the packet outgoing interface corresponding to the next-hop routing node.
[0111] Optionally, the generation unit 83 is further configured to: when the second index value is less than or equal to the range value of the first sRGB, determine that the label value of the incoming label of the current routing node is the sum of the second index value and the initial value of the first sRGB, and the conversion value of the conversion parameter of the current routing node is null; when the second index value is greater than the range value of the first sRGB, determine that the label value of the incoming label of the current routing node is the sum of the third index value and the range value of the first sRGB, and the third index value satisfies that: the product of the third conversion value and the second preset value plus the third index value equals the second index value, and determine that the conversion value of the conversion parameter of the current routing node is the third conversion value.
[0112] Optionally, the generation unit 83 is further configured to: when the second index value is less than or equal to the range value of the third sRGB, determine that the label value of the outgoing label for jumping to the next hop routing node is the sum of the second index value and the initial value of the third sRGB; when the second index value is greater than the range value of the third sRGB, determine that the label value of the outgoing label for jumping to the next hop routing node is the sum of the fourth index value and the initial value of the third sRGB, wherein the fourth index value satisfies that the product of the fourth conversion value and the second preset value, plus the fourth index value, equals the second index value, and determine that the conversion value of the conversion parameter for jumping to the next hop routing node is the fourth conversion value.
[0113] Optionally, the generation unit 83 is specifically used for: when the destination index value is less than or equal to the range value of the second sRGB, determining that the second MPLS label includes a second outer label, encoding the second label value in the first label bit of the second outer label, and generating the second MPLS label; when the destination index value is greater than the range value of the second sRGB, determining that the second MPLS label includes a second outer label and a second inner label, encoding the first preset data in the first label bit of the second outer label, encoding the second conversion value in the second outer label, and encoding the second label value in the first label bit of the second inner label, and generating the second MPLS label.
[0114] In the message forwarding apparatus provided in this application embodiment, when the first message to be sent is transmitted to the current routing node, the current routing node first obtains the first message to be sent and a first Multiprotocol Label Switching (MPLS) label. The first MPLS label includes a first label value and a first transformation value. Then, based on the first label value and the first transformation value, the node searches for the target record corresponding to the first message to be sent in the MPLS forwarding table. Next, based on the second label value, the second transformation value, the destination index value, and the second sRGB range value in the target record, a second MPLS label is generated. Finally, based on the second MPLS label, the first message to be sent is forwarded. Thus, the MPLS forwarding table is used to store at least one message record. The label value of the outgoing label of the next-hop routing node in the message record can adapt to different sRGB configuration ranges, so that even if the destination index value of the first message to be sent does not belong to the first sRGB configuration range, the current routing node can still forward the first message to be sent, thereby improving the compatibility of the communication network with bearer network devices with different sRGB configuration ranges.
[0115] This application embodiment also provides a readable storage medium storing a program or instructions, which, when executed by a processor, implements each step of the message forwarding method flow shown in the above method embodiment.
[0116] The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), registers, hard disks, optical fibers, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing, or any other form of readable storage medium in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In the embodiments of this application, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0117] An embodiment of this application provides a computer program product stored in a non-volatile storage medium, which is executed by at least one processor to implement the various steps in the message forwarding method flow shown in the above method embodiment.
[0118] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The aforementioned computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The aforementioned computer instructions can be stored in a readable storage medium or transmitted from one readable storage medium to another. For example, the aforementioned computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The aforementioned readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The aforementioned available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
[0119] Figure 9 A schematic diagram of another possible structure of the electronic device involved in the above embodiments is shown. The device includes a memory 91, a processor 92, and a program or instructions stored in the memory 91 and executable on the processor 92. When executed by the processor 92, the program or instructions implement the various steps in the message forwarding method flow shown in the above method embodiments. The electronic device may also include a communication interface 93 and a bus 94. The communication interface 93 is used to support communication between the device and other network entities, for example, to execute the steps performed by the forwarding unit 84 described above.
[0120] The processor 92 described above can also implement or execute various exemplary logic blocks, units, and circuits described in conjunction with the disclosure of this application. The processor 92 can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, units, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0121] The memory 91 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk or solid-state drive; the memory may also include combinations of the above types of memory.
[0122] Bus 94 can be an Extended Industry Standard Architecture (EISA) bus, etc. Bus 94 can be divided into address bus, data bus, control bus, etc.
[0123] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional units is used as an example. In practical applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the device can be divided into different functional units to complete all or part of the functions described above. The specific working process of the system, device and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0124] Since the electronic devices, readable storage media, and computer program products in the embodiments of this application can be applied to the above-described message forwarding method, the technical effects they can achieve can also be referred to the above-described method embodiments. The embodiments of this application will not be repeated here.
[0125] It should be noted that the above-mentioned units can be separate processors, or they can be integrated into a processor of the controller. Alternatively, they can be stored in the controller's memory as program code, and called and executed by a processor of the controller. The processor mentioned here can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0126] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0127] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0128] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0129] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling, direct coupling, or communication connections shown or discussed may be implemented through interfaces, and these interface connections may be electrical, mechanical, or other forms.
[0130] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0131] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0132] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A message forwarding method, characterized in that, Applied to the current routing node, the method includes: Obtain a first message to be sent and a first Multiprotocol Label Switching (MPLS) label. The first MPLS label includes a first label value and a first transformation value. The first transformation value is a value that represents the mapping relationship between a first index value and a destination index value. The destination index value corresponds to the destination address of the first message to be sent. The first label value is the sum of the first index value and the initial value of the first segment routing global block (SRGB). The first SRGB is the configurable range of the segment routing global block preset in the current routing node. Based on the first tag value and the first conversion value, the target record corresponding to the first packet to be sent is searched in the MPLS forwarding table. The MPLS forwarding table is used to store at least one packet record. The packet record is used to record the packet index and node parameters of the second packet to be sent. The node parameters include: the conversion parameters of the current routing node, the ingress tag of the current routing node, the egress tag for jumping to the next hop routing node, and the conversion parameters for jumping to the next hop routing node. The target record is the record among the at least one packet record that meets a preset condition. The preset condition is: the tag value of the ingress tag of the current routing node is the first tag value, and the parameter value of the conversion parameters of the current routing node is the first conversion value. A second MPLS label is generated based on the second label value, the second transformation value, the destination index value, and the range value of the second sRGB. The second label value is the label value of the outgoing label of the target record that jumps to the next-hop routing node. The second transformation value is the transformation value of the transformation parameter of the target record that jumps to the next-hop routing node. The second sRGB is the configurable range of the pre-set segment routing global block in the next-hop routing node of the target record. The first message to be sent is forwarded according to the second MPLS label.
2. The method according to claim 1, characterized in that, The first MPLS label includes a first outer label, or the first MPLS label includes a first outer label and a first inner label; the preset encoding format includes a first label bit and a second label bit; Obtain the first label value and the first transformation value from the first Multiprotocol Label Switching (MPLS) label, including: If the tag value of the first tag position in the first outer tag is not a first preset value, the first tag value is determined according to the preset encoding format as: the tag value of the first tag position, and the first conversion value is determined to be an empty value; When the tag value of the first tag position in the first outer tag is the first preset value, the first conversion value is determined according to the preset encoding format as: the tag value of the second tag position in the first outer tag; According to the preset encoding format, the first tag value is determined to be: the tag value of the first tag position in the first inner tag.
3. The method according to claim 2, characterized in that, Before searching for the target record corresponding to the first packet to be sent in the MPLS forwarding table based on the first tag value and the first conversion value, the method further includes: The message record is generated based on the second index value, the first sRGB range value, and the third sRGB range value. The second index value is the index value of the message index of the second message to be sent, and the third sRGB is the configurable range of the pre-set segment routing global block in the next-hop routing node corresponding to the second message to be sent. The message records are merged to generate the MPLS forwarding table.
4. The method according to claim 3, characterized in that, The step of generating the message record based on the second index value, the first sRGB range value, and the third sRGB range value includes: Based on the comparison result between the second index value and the first sRGB range value, the label value of the ingress label of the current routing node and the conversion value of the conversion parameter of the current routing node are obtained; Based on the second index value and the third sRGB range value, the tag value of the outgoing tag for jumping to the next hop routing node and the conversion value of the conversion parameter for jumping to the next hop routing node are obtained; The packet record is generated based on the second index value, the label value of the ingress label of the current routing node, the conversion value of the conversion parameter of the current routing node, the label value of the outgress label of the next hop routing node, the conversion value of the conversion parameter of the next hop routing node, and the packet outgress interface corresponding to the next hop routing node.
5. The method according to claim 4, characterized in that, The step of obtaining the label value of the ingress label of the current routing node and the transformation value of the transformation parameter of the current routing node based on the comparison result between the second index value and the first sRGB range value includes: If the second index value is less than or equal to the range value of the first sRGB, the label value of the ingress label of the current routing node is determined to be the sum of the second index value and the initial value of the first sRGB, and the conversion value of the conversion parameter of the current routing node is null. If the second index value is greater than the range value of the first sRGB, the label value of the ingress label of the current routing node is determined to be the sum of the third index value and the initial value of the first sRGB. The third index value satisfies the following condition: the product of the third conversion value and the second preset value, plus the third index value, equals the second index value. The conversion value of the conversion parameter of the current routing node is then determined to be the third conversion value.
6. The method according to claim 4, characterized in that, The step of obtaining the tag value of the outgoing tag and the transformation value of the transformation parameters for jumping to the next-hop routing node based on the second index value and the third sRGB range value includes: If the second index value is less than or equal to the range value of the third sRGB, the label value of the outgoing label for jumping to the next hop routing node is determined to be the sum of the second index value and the initial value of the third sRGB. If the second index value is greater than the range value of the third sRGB, the label value of the outgoing label for jumping to the next hop routing node is determined to be the sum of the fourth index value and the initial value of the third sRGB. The fourth index value satisfies the following condition: the product of the fourth conversion value and the second preset value plus the fourth index value equals the second index value. The conversion value of the conversion parameter for jumping to the next hop routing node is determined to be the fourth conversion value.
7. The method according to claim 1, characterized in that, The step of generating a second MPLS tag based on the second tag value, the second conversion value, the destination index value, and the second sRGB range value includes: If the destination index value is less than or equal to the range value of the second sRGB, it is determined that the second MPLS tag includes a second outer tag. The second tag value is encoded in the first tag bit of the second outer tag to generate the second MPLS tag. If the target index value is greater than the second sRGB range value, the second MPLS label is determined to include a second outer label and a second inner label. In the second outer label, the first label bit encodes the first preset data, the second label bit encodes the second conversion value, and the first label bit of the second inner label encodes the second label value, thereby generating the second MPLS label.
8. A message forwarding device, characterized in that, Applied to the current routing node, it includes: acquisition unit, lookup unit, generation unit, and forwarding unit; The acquisition unit is used to acquire a first packet to be sent and a first Multiprotocol Label Switching (MPLS) label. The first MPLS label includes a first label value and a first transformation value. The first label value identifies the destination address of the first packet to be sent in the current routing node. The first transformation value is a value that characterizes the mapping relationship between a first index value and a destination index value. The destination index value corresponds to the destination address of the first packet to be sent. The first label value is the sum of the first index value and the initial value of the first segment routing global block (SRGB). The first SRGB is a preset configurable range of segment routing global blocks in the current routing node. The lookup unit is used to look up the target record corresponding to the first packet to be sent in the MPLS forwarding table according to the first tag value and the first conversion value. The MPLS forwarding table is used to store at least one packet record. The packet record is used to record the packet index and node parameters of the second packet to be sent. The node parameters include: the conversion parameters of the current routing node, the ingress tag of the current routing node, the egress tag of the next hop routing node, and the conversion parameters of the next hop routing node. The target record is the record in the at least one packet record that meets the preset conditions. The preset conditions are: the tag value of the ingress tag of the current routing node is the first tag value, and the parameter value of the conversion parameters of the current routing node is the first conversion value. The generation unit is used to generate a second MPLS label based on the second label value, the second transformation value, the destination index value, and the range value of the second sRGB. The second label value is the label value of the outgoing label of the target record that jumps to the next-hop routing node. The second transformation value is the transformation value of the transformation parameter of the target record that jumps to the next-hop routing node. The second sRGB is the configurable range of the pre-set segment routing global block in the next-hop routing node of the target record. The forwarding unit is used to forward the first message to be sent according to the second MPLS label.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program or instructions that, when executed by a processor, implement the message forwarding method as described in any one of claims 1-7.
10. An electronic device, characterized in that, include: A processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the message forwarding method as described in any one of claims 1-7.
Citation Information
Patent Citations
Method for assigning prefix label and SDN controller
CN108259341A
A message processing method and apparatus
CN109067657A