Message processing method and device, electronic equipment and storage medium
By using the information in the SID list in the routing extension header of the SRv6 message for forwarding and modifying, the problem of cumbersome packet processing and increased resource configuration in the general IPv6 segment routing technology is solved, and simplified packet processing and efficient packet processing are achieved. Forward.
Patent Information
- Application Number
- CN202411266926.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-10
AI Technical Summary
When using the general IPv6 segment routing technology, it is necessary to add the continuous compression behavior attribute, resulting in the cumbersome packet processing process of network nodes and the increase in resource configuration.
By using the last address in the SID list to indicate the length and compressed value of the G-SID in the routing extension header of the SRv6 message, the message forwarding process is simplified, and the COC attributes are avoided, and the information in the SRH header is directly forwarded and modified based on the information in the SRH header is directly .
It simplifies the message processing process, saves resource configuration, and improves the forwarding efficiency of SRv6 messages.
Smart Images

Figure CN119211125A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a message processing method, device, electronic device and storage medium. Background Art
[0002] At present, the programmable capability of Internet Protocol version 6 (IPv6) Segment Routing IPv6 (SRv6) is increasingly recognized. However, the use of SRv6 technology will cause problems such as large SRv6 message overhead. The industry has proposed the Generalized Segment Routing IPv6 (G-SRv6) technology. G-SRv6 technology is a hybrid coding technology, that is, it supports the encoding of ordinary 128-bit segment identifiers (Segment Identifier, SID) and generalized segment identifiers (Generalized Segment Identifier, G-SID, also known as compressed SID, for example, compressed to 32-bit SID) at the same time, thereby optimizing the performance of SRv6 on the basis of supporting SRv6 functions and better realizing network-scale deployment.
[0003] When using G-SRv6 technology, it is necessary to add the Continue of Compression Flavor (COC) attribute to indicate whether the next SID is a compressed SID. This requires the corresponding network node to apply for the relevant SIDs configured with the COC attribute and the relevant SIDs not configured with the COC attribute, and the processing flow of processing G-SRv6 messages is relatively cumbersome. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present application provides a message processing method, device, electronic device and storage medium.
[0005] According to a first aspect of an embodiment of the present application, a message processing method is provided, the method being applied to a network node, the method comprising:
[0006] Receive messages;
[0007] If the message is a data message, when it is determined that the message needs to be forwarded through the SRv6-Traffic Engineering (TE) policy, and there is a network node configured with a G-SID among the network nodes on the forwarding path corresponding to the target SRv6-TE policy, a first SID list corresponding to the forwarding path is generated, and based on the first SID list, the message is encapsulated as an SRv6 message and forwarded to the next hop network node, wherein the last first address in the first SID list in the Segment Routing Header (SRH) header of the SRv6 message indicates the existence of a G-SID in the first SID list, the length of a common prefix, the length of a G-SID, and the compressed values corresponding to the other first addresses in the first SID list except the last first address, and the compressed value is used to represent the total number of G-SIDs included in the corresponding address;
[0008] If the message is an SRv6 message, the message includes an IPv6 header and an SRH header, it is determined that the message needs to be modified, the Segment Left (SL) value in the SRH header is not 0, and the last second address in the second SID list in the SRH header indicates that a G-SID exists in the second SID list, then when the address indicated by the SL value is the second address, according to the destination address in the IPv6 header, the second SID list, the compressed value corresponding to the address indicated by the SL value minus 1, and the length of a common prefix indicated by the second address and the length of a G-SID, the message is modified and sent to the next hop network node; or,
[0009] When the address indicated by the SL value is not the second address, the message is modified based on at least the destination address in the IPv6 header, the SL value, the second SID list, the length of a common prefix indicated by the second address, the length of a G-SID, the first compression value corresponding to the address indicated by the SL value, and the second compression value corresponding to the address indicated by the SL value minus 1, and the modified message is sent to the next-hop network node.
[0010] According to a second aspect of an embodiment of the present application, a message processing device is provided, the device being applied to a network node, the device comprising:
[0011] A receiving module, used for receiving messages;
[0012] An encapsulation module, for, if the message is a data message, generating a first SID list corresponding to the forwarding path when it is determined that the message needs to be forwarded through a target SRv6-Traffic Engineering TE policy, and there is a network node configured with a G-SID among the network nodes on the forwarding path corresponding to the target SRv6-TE policy, and encapsulating the message into an SRv6 message based on the first SID list and forwarding it to a next-hop network node, wherein the last first address in the first SID list in the SRH header of the SRv6 message indicates the existence of a G-SID in the first SID list, the length of a common prefix, the length of a G-SID, and the compression values corresponding to the other first addresses in the first SID list except the last first address, and the compression value is used to represent the total number of G-SIDs included in the corresponding address;
[0013] a processing module, configured to, if the message is an SRv6 message, the message includes an IPv6 header and an SRH header, it is determined that the message needs to be modified, the SL value in the SRH header is not 0, and the last second address in the second SID list in the SRH header indicates that a G-SID exists in the second SID list, then when the address indicated by the SL value is the second address, modify the message according to the destination address in the IPv6 header, the second SID list, the compressed value corresponding to the address indicated by the SL value minus 1, and the length of a common prefix and a length of a G-SID indicated by the second address, and send the modified message to a next-hop network node; or,
[0014] When the address indicated by the SL value is not the second address, the message is modified based on at least the destination address in the IPv6 header, the SL value, the second SID list, the length of a common prefix indicated by the second address, the length of a G-SID, the first compression value corresponding to the address indicated by the SL value, and the second compression value corresponding to the address indicated by the SL value minus 1, and the modified message is sent to the next-hop network node.
[0015] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement the method steps of the above-mentioned message processing method.
[0016] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps of the above-mentioned message processing method are implemented.
[0017] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0018] In the embodiment of the present application, it is no longer necessary to add the COC attribute, saving resource configuration. In addition, the last address in the SID list in the SRH header is used to indicate the existence of a G-SID in the SID list, and the forwarding of the SRv6 message is guided based on the length of a G-SID indicated by the last address in the SID list in the SRH header and the compression value corresponding to each address in the SID list, thereby simplifying the message processing process.
[0019] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in the specification and constitute a part of this application, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.
[0021] Figure 1 A flowchart of a message processing method provided in an embodiment of the present application;
[0022] Figure 2 A schematic diagram of the transmission process of data message 1 provided in an embodiment of the present application;
[0023] Figure 3 A schematic diagram of the structure of a message processing device provided in an embodiment of the present application;
[0024] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0026] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0027] It should be understood that, although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" or "if" as used herein may be interpreted as "at the time of" or "when...".
[0028] Next, the embodiments of the present application are described in detail.
[0029] The present application embodiment provides a message processing method, which is applied to a network node, such as Figure 1 As shown, the method may include the following steps:
[0030] S11. Receive message.
[0031] S12. If the message is a data message, when it is determined that the message needs to be forwarded through the target SRv6-TE policy and there is a network node configured with G-SID among the network nodes on the forwarding path corresponding to the target SRv6-TE policy, a first SID list corresponding to the forwarding path is generated, and based on the first SID list, the message is encapsulated as an SRv6 message and forwarded to the next hop network node.
[0032] In this step, the last first address in the first SID list in the SRH header of the message indicates the existence of a G-SID in the first SID list, the length of a common prefix (Common Prefix Length), the length of a G-SID, and the compressed values corresponding to other first addresses in the first SID list except the last first address, and the compressed value is used to represent the total number of G-SIDs included in the corresponding address.
[0033] S13. If the message is an SRv6 message, the message includes an IPv6 header and an SRH header, it is determined that the message needs to be modified, the SL value in the SRH header is not 0, and the last second address in the second SID list in the SRH header indicates that a G-SID exists in the second SID list, then when the address indicated by the SL value is the last second address, the message is modified according to the destination address in the IPv6 header, the second SID list, the compressed value corresponding to the address indicated by the SL value minus 1, and the length of a common prefix indicated by the second address and the length of a G-SID, and the modified message is sent to the next-hop network node; or, when the address indicated by the SL value is not the second address, the message is modified at least according to the destination address in the IPv6 header, the SL value, the second SID list, the length of a common prefix indicated by the second address, the length of a G-SID, the first compressed value corresponding to the address indicated by the SL value, and the second compressed value corresponding to the address indicated by the SL value minus 1, and the modified message is sent to the next-hop network node.
[0034] Specifically, in the above step S12, for the network node, for the last first address in the first SID list in the routing extension header SRH header of the SRv6 message, the first byte (Byte) in this address can be used to indicate the presence of a G-SID in the first SID list, for example, 0xFD; the highest bit in the second byte (Byte) in this address can be used to indicate the length of a G-SID, and the remaining bits indicate the length of a common prefix (Common Prefix); starting from the third Byte, every 4 bits indicate a compressed value corresponding to a first address, and the indication order of the compressed values is the same as the arrangement order of other first addresses in the first SID list except the last first address.
[0035] It should be noted that, in the above step S12, the specific forwarding process of encapsulating the message into an SRv6 message and then forwarding it to the next-hop network node is a prior art and will not be described in detail here.
[0036] Specifically, in the above step S13, the network node may determine whether the message needs to be modified in the following manner:
[0037] If a common SID is configured for itself, when the destination address included in the IPv6 header is its own common SID, it is determined that the message needs to be modified;
[0038] If the G-SID is configured for itself, when the destination address included in the IPv6 header includes the common prefix corresponding to its own G-SID and its own G-SID, it is determined that the message needs to be modified.
[0039] In an example, the normal SID is a 128-bit SID, and the G-SID is a 32-bit SID.
[0040] In addition, in the above step S13, when the network node modifies the message according to the destination address in the IPv6 header, the second SID list, the compressed value corresponding to the address indicated by the SL value minus 1, and the length of a common prefix indicated by the second address and the length of a G-SID, it can be specifically implemented in the following manner:
[0041] If the compression value corresponding to the address indicated by the SL value minus 1 is 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value minus 1 in the second SID list;
[0042] If the compressed value corresponding to the address indicated by the SL value minus 1 is not 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the target address, wherein the target address sequentially includes the common prefix included in the destination address before the update obtained based on the length of a common prefix indicated by the second address, the last G-SID included in the address indicated by the SL value minus 1 obtained from the second SID list based on the length of a G-SID indicated by the second address, and the segment index SI corresponding to the last G-SID.
[0043] When the network node modifies the message according to at least the destination address in the IPv6 header, the SL value, the second SID list, the length of a common prefix indicated by the second address, the length of a G-SID, the first compression value corresponding to the address indicated by the SL value, and the second compression value corresponding to the address indicated by the SL value minus 1, it can be specifically implemented in the following manner:
[0044] If the SL value is greater than 1, when the first compressed value corresponding to the address indicated by the SL value indicated by the second address is 0, and the second compressed value corresponding to the address indicated by the SL value indicated by the second address after deducting 1 is not 0, the SL value is deducted by 1, and the destination address in the IPv6 header is updated to the first address, wherein the first address sequentially includes the first common prefix included in the address indicated by the SL value obtained based on the length of a common prefix indicated by the second address, the last first G-SID included in the address indicated by the SL value obtained from the second SID list based on the length of a G-SID indicated by the second address after deducting 1, and the first SI corresponding to the first G-SID; or,
[0045] When both the first compression value and the second compression value are 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value reduced by 1 in the second SID list; or,
[0046] When the first compression value is not 0, if the second SI included in the destination address in the IPv6 header is not 0, then when the second compression value is 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value reduced by 1 in the second SID list, or, when the second compression value is not 0, the destination address in the IPv6 header is updated to the second address, wherein the second address includes the second common prefix included in the destination address before the update, the third G-SID and the third SI in the address indicated by the SL value obtained from the second SID list based on the length of a G-SID indicated by the second address, and the third SI is the second SI reduced by 1;
[0047] If the second SI is 0, when the second compression value is 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value reduced by 1 in the second SID list, or, when the second compression value is not 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the third address, wherein the third address sequentially includes the third common prefix included in the destination address before the update, the last fourth G-SID included in the address indicated by the SL value reduced by 1 obtained from the second SID list based on the length of a G-SID indicated by the second address, and the fourth SI corresponding to the fourth G-SID;
[0048] If the SL value is equal to 1, when the first compression value and the second compression value are both 0, if the second last segment pop-up SRH PSP behavior is supported, the destination address in the IPv6 header is updated to the address indicated by the SL value minus 1 in the second SID list, and the SRH header is popped out; if the PSP behavior is not supported, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value minus 1 in the second SID list; or,
[0049] When the first compression value is not 0 and the second compression value is 0, if the first compression value is equal to 1, then when the PSP behavior is supported, the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1, and the SRH header is discarded, or, when the PSP behavior is not supported, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1;
[0050] If the first compression value is greater than 1 and the fifth SI included in the destination address in the IPv6 header is not 0, the destination address in the IPv6 header is updated to a fourth address, wherein the fourth address includes a fourth common prefix included in the destination address before the update, a fifth G-SID located in front of the G-SID included in the destination address before the update in the address indicated by the SL value obtained from the second SID list based on the length of a G-SID indicated by the second address, and a sixth SI corresponding to the fifth G-SID, where the sixth SI is the fifth SI minus 1;
[0051] If the first compression value is greater than 1 and the fifth SI included in the destination address in the IPv6 header is 0, then when it supports PSP behavior, the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1, and the SRH header is discarded. Alternatively, when it does not support PSP behavior, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1.
[0052] It should be noted that, when the SL value is greater than 1, if the first compression value corresponding to the address indicated by the SL value indicated by the second SID is 0, and the second compression value corresponding to the address indicated by the SL value indicated by the second SID minus 1 is not 0, this indicates that the address corresponding to the first compression value is an ordinary SID, and there are second compression value G-SIDs in the address corresponding to the second compression value, and the above-mentioned network node and the network node corresponding to the second compression value G-SID are located in the same compression domain.
[0053] If the first compressed value and the second compressed value are both 0, this indicates that the addresses corresponding to the first compressed value and the second compressed value are both common SIDs.
[0054] Furthermore, in the embodiment of the present application, the network node may also perform the following operations:
[0055] When the message is an SRv6 message, the message includes an IPv6 header and an SRH header, and the SL value in the G-SRH header is 0, the IPv6 header and the G-SRH header of the message are discarded, and the discarded message is forwarded.
[0056] It should be noted that, when the message is an SRv6 message, the message includes an IPv6 header and an SRH header, and the SL value in the G-SRH header is 0, it means that the network node is the previous-hop device of the destination network node of the data message carried in the SRv6 message, and the previous-hop network node of the network node does not support PSP behavior.
[0057] Furthermore, in the embodiment of the present application, the network node may also perform the following operations:
[0058] When the message is an SRv6 message, the message only includes an IPv6 header, and the destination address in the IPv6 header is its own SID, the IPv6 header of the message is ejected, and the message after being ejected is forwarded.
[0059] It should be noted that, when the message is an SRv6 message, the message only includes an IPv6 header, and the destination address in the IPv6 header is its own SID, it means that the network node is the previous-hop device of the destination network node of the data message carried in the SRv6 message, and the previous-hop network node of the network node supports PSP behavior.
[0060] The above message processing method is described in detail below in conjunction with specific embodiments.
[0061] like Figure 2 As shown, it is assumed that the network nodes on the forwarding path corresponding to SRv6-TE policy 1 are network node A (denoted as A), network node C1 (denoted as C1), network node C2 (denoted as C2), network node C3 (denoted as C3), network node C4 (denoted as C4), network node C5 (denoted as C5), network node C6 (denoted as C6), network node D1 (denoted as D1), network node D2 (denoted as D2), network node D3 (denoted as D3), network node D4 (denoted as D4), network node D5 (denoted as D5), network node D6 (denoted as D6) and network node B (denoted as B).
[0062] Also, assume that network node A is configured with a common SID, for example, A::1.
[0063] Network nodes C1 to C6 are located in a compression domain and share a common prefix with a length of 64 bits. Network node C1 is configured with a common SID, for example, C::1:1:0:0; network nodes C2 to C6 are configured with a G-SID with a length of 32 bits, for example, 2:1, 3:1, 4:1, 5:1 and 6:1.
[0064] Network nodes D1 to D6 are located in another compression domain and share another common prefix. Network node D1 is configured with a common SID, for example, D::1:1:0:0; network nodes D2 to D6 are configured with G-SIDs, for example, 2:1, 3:1, 4:1, 5:1 and 6:1 in sequence; network node D6 supports PSP behavior.
[0065] The network node B is configured with an End.DT4 address for the virtual private network (VPN) instance 100, for example, B::200.
[0066] Here, network node A (denoted as A) and network node B (denoted as B) may both be provider edge (PE) devices.
[0067] Assume that network node A receives data message 1 and determines that the message needs to be forwarded through SRv6-TE policy 1, and there is a network node configured with G-SID among the network nodes on the forwarding path corresponding to SRv6-TE policy 1. At this time, network node A generates a SID list corresponding to the forwarding path (for example, SID list 1), and encapsulates the data message into SRv6 message 1 (for example, SID list 1) based on SID list 1. Figure 2 As shown in FIG. 1 , the SRv6 packet 1 is forwarded to the next-hop network node. That is, the network node A sends the SRv6 packet 1 to the network node C1.
[0068] Here, the source address (Source Address, SA) in the IPv6 header of SRv6 message 1 is A::1, the destination address (Destination Address, DA) is C::1:1:0:0, and it also carries a payload.
[0069] In the last address in SID list 1 in the SRH header of SRv6 message 1, the first byte (ie, “FD”) indicates that there is a G-SID in SID list 1.
[0070] The second byte (ie, "C0") indicates the length of the common prefix and the length of a G-SID.
[0071] The "0" in the third byte (i.e., "01") indicates that the compressed value corresponding to the address with an SL value of 0 is 0, that is, the address indicated by an SL value of 0 is a normal SID; the "1" in "01" indicates that the compressed value corresponding to the address with an SL value of 1 is 1, that is, the address indicated by an SL value of 1 includes 1 G-SID, and the rest are padding bits.
[0072] The "4" in the fourth byte (i.e., "40") indicates that the compressed value corresponding to the address with an SL value of 2 is 4, that is, the address indicated by the SL value of 2 includes 4 G-SIDs; the "0" in "40" indicates that the compressed value corresponding to the address with an SL value of 3 is 0, that is, the address indicated by the SL value of 3 is a normal SID.
[0073] The "1" in the fifth byte (i.e., "14") indicates that the compressed value corresponding to the address with an SL value of 4 is 1, that is, there is one G-SID in the address indicated by the SL value of 1, and the rest are padding bits; the "4" in "14" indicates that the compressed value corresponding to the address with an SL value of 5 is 4, that is, the address indicated by the SL value of 5 includes 4 G-SIDs.
[0074] The remaining bytes are all 0.
[0075] The network node C1 receives the SRv6 message 1 and finds that the SRv6 message 1 includes an IPv6 header and an SRH header, that the SRv6 message 1 needs to be modified, that the SL value in the SRH header of the SRv6 message 1 is 6 (i.e., not 0), and that the last address in the SID list 1 in the SRH header indicates that there is a G-SID in the SID list 1. At this time, the network node C1 further finds that the address indicated by the SL value is the last address, and that the compression value corresponding to the address indicated by the SL value after being reduced by 1 (i.e., SL=5) is 4 (i.e., not 0), which means that the address indicated by the SL value after being reduced by 1 includes 4 G-SIDs, and the network nodes corresponding to these 4 G-SIDs and the destination address in the IPv6 header are in a compression domain. In this case, the network node C1 reduces the SL value by 1, and updates the destination address in the IPv6 header to C::2:1:0:3, obtains the SRv6 message 2, and sends the SRv6 message 2 to the next-hop network node (i.e., the network node C2).
[0076] Here, C::2:1:0:3 includes the common prefix in C::1:1:0:0 obtained by the network node C1 based on the length of a common prefix indicated by the last address, the last G-SID (i.e., 2:1) included in the address indicated by the SL value minus 1 (i.e., SL=5) obtained by the network node C1 from SID list 1 based on the length of a G-SID indicated by the last address, and the SI corresponding to 2:1 (i.e., 3).
[0077] Network node C2 receives SRv6 message 2, and finds that SRv6 message 2 includes an IPv6 header and an SRH header, SRv6 message 2 needs to be modified, the SL value in the SRH header of SRv6 message 2 is 5 (i.e., not 0), and the last address in SID list 1 in the SRH header indicates that there is a G-SID in SID list 1. At this time, network node C2 further finds that the address indicated by the SL value is not the last address, the compression value corresponding to the address indicated by the SL value (i.e., SL=5) is 4 (i.e., not 0), and the SI included in the destination address in the IPv6 header is 3 (i.e., not 0). In this case, network node C2 updates the destination address in the IPv6 header to C::3:1:0:2, obtains SRv6 message 3, and sends SRv6 message 3 to the next-hop network node (i.e., network node C3).
[0078] Here, C::3:1:0:2 includes the common prefix in C::2:1:0:3, the G-SID (i.e., 3:1) in front of the G-SID (i.e., 2:1) included in the destination address before the update (i.e., C::2:1:0:3) in the address indicated by the SL value obtained by the network node C2 from SID list 1 based on the length of a G-SID indicated by the last address, and the SI corresponding to 3:1 (i.e., 2).
[0079] Network node C3 receives SRv6 message 3, and finds that SRv6 message 3 includes an IPv6 header and an SRH header, that SRv6 message 3 needs to be modified, that the SL value in the SRH header of SRv6 message 3 is 5 (i.e., not 0), and that the last address in SID list 1 in the SRH header indicates that there is a G-SID in SID list 1. At this time, network node C3 further finds that the address indicated by the SL value is not the last address, that the compression value corresponding to the address indicated by the SL value (i.e., SL=5) is 4 (i.e., not 0), and that the SI included in the destination address in the IPv6 header is 2 (i.e., not 0). In this case, network node C3 updates the destination address in the IPv6 header to C::4:1:0:1, obtains SRv6 message 4, and sends SRv6 message 4 to the next-hop network node (i.e., network node C4).
[0080] Here, C::4:1:0:1 includes the common prefix in C::3:1:0:2, the G-SID (i.e., 4:1) in front of the G-SID (i.e., 3:1) included in the destination address before the update (i.e., C::3:1:0:2) in the address indicated by the SL value obtained by the network node C3 from SID list 1 based on the length of a G-SID indicated by the last address, and the SI corresponding to 4:1 (i.e., 1).
[0081] Network node C4 receives SRv6 message 4, and finds that SRv6 message 4 includes an IPv6 header and an SRH header, that SRv6 message 4 needs to be modified, that the SL value in the SRH header of SRv6 message 4 is 5 (i.e., not 0), and that the last address in SID list 1 in the SRH header indicates that there is a G-SID in SID list 1. At this time, network node C4 further finds that the address indicated by the SL value is not the last address, that the compression value corresponding to the address indicated by the SL value (i.e., SL=5) is 4 (i.e., not 0), and that the SI included in the destination address in the IPv6 header is 1 (i.e., not 0). In this case, network node C4 updates the destination address in the IPv6 header to C::5:1:0:0, obtains SRv6 message 5, and sends SRv6 message 5 to the next-hop network node (i.e., network node C5).
[0082] Here, C::5:1:0:0 includes the common prefix in C::4:1:0:1, the G-SID (i.e., 5:1) in front of the G-SID (i.e., 4:1) included in the destination address before the update (i.e., C::4:1:0:1) in the address indicated by the SL value obtained by the network node C4 from SID list 1 based on the length of a G-SID indicated by the last address, and the SI corresponding to 5:1 (i.e., 0).
[0083] The network node C5 receives the SRv6 message 5 and finds that the SRv6 message 5 includes an IPv6 header and an SRH header, that the SRv6 message 5 needs to be modified, that the SL value in the SRH header of the SRv6 message 5 is 5 (i.e., not 0), and that the last address in the SID list 1 in the SRH header indicates that there is a G-SID in the SID list 1. At this time, the network node C5 further finds that the address indicated by the SL value is not the last address, that the compression value corresponding to the address indicated by the SL value (i.e., SL=5) is 4 (i.e., not 0), and that the SI included in the destination address in the IPv6 header is The compression value corresponding to the address indicated by the SL value minus 1 (i.e., SL=4) is 0 and is 1 (i.e., not 0). This indicates that the network node C5 and the network node corresponding to the G-SID (i.e., 6:1) included in the address indicated by the SL value minus 1 (i.e., network node D6) are located in the same compression domain. In this case, the network node C5 subtracts 1 from the SL value (i.e., SL=4), updates the destination address in the IPv6 header to C::6:1:0:3, obtains SRv6 message 6, and sends SRv6 message 6 to the next-hop network node (i.e., network node C6).
[0084] Here, C::6:1:0:3 includes the common prefix in C::5:1:0:0, the last G-SID (i.e., 6:1) included in the address indicated by the SL value obtained by the network node C5 from SID list 1 based on the length of a G-SID indicated by the last second address minus 1 (i.e., SL=4), and the SI corresponding to 6:1 (i.e., 3).
[0085] Network node C6 receives SRv6 message 6 and finds that SRv6 message 6 includes an IPv6 header and an SRH header, that SRv6 message 6 needs to be modified, that the SL value in the SRH header of SRv6 message 6 is 4 (i.e., not 0), and that the last address in SID list 1 in the SRH header indicates that there is a G-SID in SID list 1. At this time, network node C6 further finds that the address indicated by the SL value is not the last address, that the compression value corresponding to the address indicated by the SL value (i.e., SL=4) is 1 (i.e., not 0), and that the destination address in the IPv6 header contains The enclosed SI is 3 (i.e., not 0), and the compressed value corresponding to the address indicated by the SL value minus 1 (i.e., SL=3) is 0, which means that the next-hop network node corresponding to network node C6 (i.e., network node D1) is configured with a normal SID. In this case, network node C6 subtracts 1 from the SL value (i.e., SL=3), updates the destination address in the IPv6 header to the address indicated by SL=3 in SID list 1 (i.e., D::1:1:0:0), obtains SRv6 message 7, and sends SRv6 message 7 to the next-hop network node (i.e., network node D1).
[0086] The network node D1 receives the SRv6 message 7 and finds that the SRv6 message 7 includes an IPv6 header and an SRH header, that the SRv6 message 7 needs to be modified, that the SL value in the SRH header of the SRv6 message 7 is 3 (i.e., not 0), and that the last address in the SID list 1 in the SRH header indicates that there is a G-SID in the SID list 1. At this time, the network node D1 further finds that the address indicated by the SL value is not the last address, that the compression value corresponding to the address indicated by the SL value is 0, and that the SL value minus 1 (i.e., SL=2) indicates The compression value corresponding to the address is 4 (i.e., not 0), which means that the address indicated by the SL value minus 1 includes 4 G-SIDs. These 4 G-SIDs are in a compression domain with the network node corresponding to the destination address in the IPv6 header (i.e., network node D1). In this case, network node D1 subtracts 1 from the SL value (i.e., SL=2), and updates the destination address in the IPv6 header to D::2:1:0:3, obtains SRv6 message 8, and sends SRv6 message 8 to the next-hop network node (i.e., network node D2).
[0087] Here, D::2:1:0:3 includes the common prefix in D::1:1:0:0 obtained by the network node D1 based on the length of a common prefix indicated by the last address, the last G-SID (i.e., 2:1) included in the address indicated by the SL value minus 1 (i.e., SL=2) obtained by the network node D1 from SID list 1 based on the length of a G-SID indicated by the last address, and the SI corresponding to 2:1 (i.e., 3).
[0088] Network node D2 receives SRv6 message 8, and finds that SRv6 message 8 includes an IPv6 header and an SRH header, that SRv6 message 8 needs to be modified, that the SL value in the SRH header of SRv6 message 8 is 2 (i.e., not 0), and that the last address in SID list 1 in the SRH header indicates that there is a G-SID in SID list 1. At this time, network node D2 further finds that the address indicated by the SL value is not the last address, that the compression value corresponding to the address indicated by the SL value (i.e., SL=2) is 4 (i.e., not 0), and that the SI included in the destination address in the IPv6 header is 3 (i.e., not 0). In this case, network node D2 updates the destination address in the IPv6 header to D::3:1:0:2, obtains SRv6 message 9, and sends SRv6 message 9 to the next-hop network node (i.e., network node D3).
[0089] Here, D::3:1:0:2 includes the common prefix in D::2:1:0:3, the G-SID (i.e., 3:1) in front of the G-SID (i.e., 2:1) included in the destination address before the update (i.e., D::2:1:0:3) in the address indicated by the SL value obtained by the network node D2 from SID list 1 based on the length of a G-SID indicated by the last address, and the SI corresponding to 3:1 (i.e., 2).
[0090] Network node D3 receives SRv6 message 9, and finds that SRv6 message 9 includes an IPv6 header and an SRH header, that SRv6 message 9 needs to be modified, that the SL value in the SRH header of SRv6 message 9 is 2 (i.e., not 0), and that the last address in SID list 1 in the SRH header indicates that there is a G-SID in SID list 1. At this time, network node D3 further finds that the address indicated by the SL value is not the last address, that the compression value corresponding to the address indicated by the SL value (i.e., SL=2) is 4 (i.e., not 0), and that the SI included in the destination address in the IPv6 header is 2 (i.e., not 0). In this case, network node D3 updates the destination address in the IPv6 header to D::4:1:0:1, obtains SRv6 message 10, and sends SRv6 message 10 to the next-hop network node (i.e., network node D4).
[0091] Here, D::4:1:0:1 includes the common prefix in D::3:1:0:2, the G-SID (i.e., 4:1) in front of the G-SID (i.e., 3:1) included in the destination address before the update (i.e., D::3:1:0:2) in the address indicated by the SL value obtained by the network node D3 from SID list 1 based on the length of a G-SID indicated by the last address, and the SI corresponding to 4:1 (i.e., 1).
[0092] Network node D4 receives SRv6 message 10, and finds that SRv6 message 10 includes an IPv6 header and an SRH header, that SRv6 message 10 needs to be modified, that the SL value in the SRH header of SRv6 message 10 is 2 (i.e., not 0), and that the last address in SID list 1 in the SRH header indicates that there is a G-SID in SID list 1. At this time, network node D4 further finds that the address indicated by the SL value is not the last address, that the compression value corresponding to the address indicated by the SL value (i.e., SL=2) is 4 (i.e., not 0), and that the SI included in the destination address in the IPv6 header is 1 (i.e., not 0). In this case, network node D4 updates the destination address in the IPv6 header to D::5:1:0:0, obtains SRv6 message 11, and sends SRv6 message 11 to the next-hop network node (i.e., network node D5).
[0093] Here, D::5:1:0:0 includes the common prefix in D::4:1:0:1, the G-SID (i.e., 5:1) in front of the G-SID (i.e., 4:1) included in the destination address before the update (i.e., D::4:1:0:1) in the address indicated by the SL value obtained by network node D4 from SID list 1 based on the length of a G-SID indicated by the last address, and the SI corresponding to 5:1 (i.e., 0).
[0094] The network node D5 receives the SRv6 message 11 and finds that the SRv6 message 11 includes an IPv6 header and an SRH header, that the SRv6 message 11 needs to be modified, that the SL value in the SRH header of the SRv6 message 11 is 2 (i.e., not 0), and that the last address in the SID list 1 in the SRH header indicates that there is a G-SID in the SID list 1. At this time, the network node D5 further finds that the address indicated by the SL value is not the last address, that the compression value corresponding to the address indicated by the SL value (i.e., SL=2) is 4 (i.e., not 0), and that the S I is 0, and the compression value corresponding to the address indicated by the SL value minus 1 (i.e., SL=4) is 1 (i.e., not 0), which means that network node D5 and the network node corresponding to the G-SID (i.e., 6:1) included in the address indicated by the SL value minus 1 (i.e., network node D6) are located in the same compression domain. In this case, network node D5 subtracts 1 from the SL value (i.e., SL=1), updates the destination address in the IPv6 header to D::6:1:0:3, obtains SRv6 message 12, and sends SRv6 message 12 to the next-hop network node (i.e., network node D6).
[0095] Here, D::6:1:0:3 includes the common prefix in D::5:1:0:0, the last G-SID (i.e., 6:1) included in the address indicated by the SL value obtained by the network node D5 from SID list 1 based on the length of a G-SID indicated by the last second address minus 1 (i.e., SL=1), and the SI corresponding to 6:1 (i.e., 3).
[0096] The network node D6 receives the SRv6 message 12 and finds that the SRv6 message 12 includes an IPv6 header and an SRH header, that the SRv6 message 12 needs to be modified, that the SL value in the SRH header of the SRv6 message 12 is 1 (that is, not 0), and that the last address in the SID list 1 in the SRH header indicates that there is a G-SID in the SID list 1. At this time, the network node D6 further finds that the address indicated by the SL value is not the last address, that the compression value corresponding to the address indicated by the SL value (that is, SL=1) is 1, and that the S The compression value corresponding to the address indicated by the L value minus 1 (i.e., SL=0) is 0, and the network node D6 supports PSP behavior, which means that the next-hop network node corresponding to the network node D6 (i.e., network node B) is configured with a normal SID. In this case, the network node D6 updates the destination address in the IPv6 header to the address indicated by the SL value minus 1 (SL=0) in the SID list 1 (i.e., B::200) and pops off the SRH header to obtain the SRv6 message 13, and sends the SRv6 message 13 to the network node B.
[0097] When network node B receives SRv6 message 13 and finds that SRv6 message 13 only includes an IPv6 header and the destination address in the IPv6 header is its own ordinary SID, it pops off the IPv6 header of SRv6 message 13, obtains data message 1, and forwards data message 1. The specific forwarding process is the existing technology and will not be described in detail here.
[0098] It can be seen from the above technical solutions that in the embodiment of the present application, it is no longer necessary to add the COC attribute, saving resource configuration. In addition, the last address in the SID list in the SRH header is used to indicate the existence of a G-SID in the SID list, and the length of a G-SID indicated by the last address in the SID list in the SRH header and the compression value corresponding to each address in the SID list are used to guide the forwarding of the SRv6 message, thereby simplifying the message processing process.
[0099] Based on the same inventive concept, the present application also provides a message processing device, which is applied to a network node, and its structural diagram is as follows: Figure 3 As shown, specifically including:
[0100] A receiving module 31, used for receiving messages;
[0101] An encapsulation module 32 is used for, if the message is a data message, then when it is determined that the message needs to be forwarded through a target SRv6-TE policy, and there is a network node configured with a G-SID among the network nodes on the forwarding path corresponding to the target SRv6-TE policy, generating a first SID list corresponding to the forwarding path, and based on the first SID list, encapsulating the message into an SRv6 message and forwarding it to the next-hop network node, wherein the last first address in the first SID list in the SRH header of the SRv6 message indicates the existence of a G-SID in the first SID list, the length of a common prefix, the length of a G-SID, and the compression values corresponding to the other first addresses in the first SID list except the last first address, and the compression value is used to represent the total number of G-SIDs included in the corresponding address;
[0102] A processing module 33 is configured to, if the message is an SRv6 message, the message includes an IPv6 header and an SRH header, it is determined that the message needs to be modified, the SL value in the SRH header is not 0, and the last second address in the second SID list in the SRH header indicates that a G-SID exists in the second SID list, then when the address indicated by the SL value is the second address, modify the message according to the destination address in the IPv6 header, the second SID list, the compressed value corresponding to the address indicated by the SL value minus 1, and the length of a common prefix and a length of a G-SID indicated by the second address, and send the modified message to the next hop network node; or,
[0103] When the address indicated by the SL value is not the second address, the message is modified based on at least the destination address in the IPv6 header, the SL value, the second SID list, the length of a common prefix indicated by the second address, the length of a G-SID, the first compression value corresponding to the address indicated by the SL value, and the second compression value corresponding to the address indicated by the SL value minus 1, and the modified message is sent to the next-hop network node.
[0104] Preferably, the processing module 33 is specifically configured to determine whether the message needs to be modified in the following manner:
[0105] If a common SID is configured for itself, when the destination address included in the IPv6 header is its own common SID, it is determined that the message needs to be modified;
[0106] If the G-SID is configured itself, when the destination address included in the IPv6 header includes the common prefix corresponding to its own G-SID and its own G-SID, it is determined that the message needs to be modified.
[0107] Preferably, the processing module 33 is specifically used to implement the step of modifying the message according to the destination address in the IPv6 header, the second SID list, the compressed value corresponding to the address indicated by the SL value minus 1, and the length of a common prefix indicated by the second address and the length of a G-SID in the following manner:
[0108] If the compression value corresponding to the address indicated by the SL value minus 1 is 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value minus 1 in the second SID list;
[0109] If the compression value corresponding to the address indicated by the SL value minus 1 is not 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the target address;
[0110] Among them, the target address includes, in sequence, the common prefix included in the destination address before the update, which is obtained based on the length of a common prefix indicated by the second address, the last G-SID included in the address indicated by the SL value minus 1 obtained from the second SID list based on the length of a G-SID indicated by the second address, and the segment index SI corresponding to the last G-SID.
[0111] Preferably, the processing module 33 is specifically used to implement the step of modifying the message according to at least the destination address in the IPv6 header, the SL value, the second SID list, the length of a common prefix indicated by the second address, the length of a G-SID, the first compressed value corresponding to the address indicated by the SL value, and the second compressed value corresponding to the address indicated by the SL value minus 1 in the following manner:
[0112] If the SL value is greater than 1, when the first compressed value corresponding to the address indicated by the SL value indicated by the second address is 0 and the second compressed value corresponding to the address indicated by the SL value indicated by the second address after deducting 1 is not 0, the SL value is deducted by 1, and the destination address in the IPv6 header is updated to the first address, wherein the first address sequentially includes the first common prefix included in the address indicated by the SL value obtained based on the length of a common prefix indicated by the second address, the last first G-SID included in the address indicated by the SL value obtained from the second SID list based on the length of a G-SID indicated by the second address after deducting 1, and the first SI corresponding to the first G-SID; or,
[0113] When the first compression value and the second compression value are both 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value reduced by 1 in the second SID list; or,
[0114] When the first compression value is not 0, if the second SI included in the destination address in the IPv6 header is not 0, then when the second compression value is 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value reduced by 1 in the second SID list, or, when the second compression value is not 0, the destination address in the IPv6 header is updated to the second address, wherein the second address includes the second common prefix included in the destination address before the update, the third G-SID and the third SI in the address indicated by the SL value obtained from the second SID list based on the length of a G-SID indicated by the second address, and the third SI is the second SI reduced by 1;
[0115] If the second SI is 0, when the second compression value is 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value reduced by 1 in the second SID list, or, when the second compression value is not 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the third address, wherein the third address sequentially includes the third common prefix included in the destination address before the update, the last fourth G-SID included in the address indicated by the SL value reduced by 1 obtained from the second SID list based on the length of a G-SID indicated by the second address, and the fourth SI corresponding to the fourth G-SID;
[0116] If the SL value is equal to 1, when the first compression value and the second compression value are both 0, if the second last segment pop-up SRH PSP behavior is supported, the destination address in the IPv6 header is updated to the address indicated by the SL value minus 1 in the second SID list, and the SRH header is popped out; if the PSP behavior is not supported, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value minus 1 in the second SID list; or,
[0117] When the first compression value is not 0 and the second compression value is 0, if the first compression value is equal to 1, then when the PSP behavior is supported, the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1, and the SRH header is discarded, or, when the PSP behavior is not supported, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1;
[0118] If the first compression value is greater than 1 and the fifth SI included in the destination address in the IPv6 header is not 0, the destination address in the IPv6 header is updated to a fourth address, wherein the fourth address includes a fourth common prefix included in the destination address before the update, a fifth G-SID located in front of the G-SID included in the destination address before the update in the address indicated by the SL value obtained from the second SID list based on the length of a G-SID indicated by the second address, and a sixth SI corresponding to the fifth G-SID, wherein the sixth SI is the fifth SI minus 1;
[0119] If the first compression value is greater than 1 and the fifth SI included in the destination address in the IPv6 header is 0, then when it supports PSP behavior, the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1, and the SRH header is discarded; or, when it does not support PSP behavior, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1.
[0120] Preferably, the processing module 33 is further used for:
[0121] When the message is an SRv6 message, the message includes an IPv6 header and an SRH header, and the SL value in the G-SRH header is 0, the IPv6 header and the G-SRH header of the message are discarded, and the discarded message is forwarded; or,
[0122] When the message is an SRv6 message, the message only includes an IPv6 header, and the destination address in the IPv6 header is its own SID, the IPv6 header of the message is ejected, and the message after being ejected is forwarded.
[0123] It can be seen from the above technical solutions that in the embodiment of the present application, it is no longer necessary to add the COC attribute, saving resource configuration. In addition, the last address in the SID list in the SRH header is used to indicate the existence of a G-SID in the SID list, and the length of a G-SID indicated by the last address in the SID list in the SRH header and the compression value corresponding to each address in the SID list are used to guide the forwarding of the SRv6 message, thereby simplifying the message processing process.
[0124] The present application also provides an electronic device, such as Figure 4 As shown, it includes a processor 41 and a machine-readable storage medium 42, wherein the machine-readable storage medium 42 stores machine-executable instructions that can be executed by the processor 41, and the processor 41 is prompted by the machine-executable instructions to implement the steps of the above-mentioned message processing method.
[0125] The machine-readable storage medium may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage. Optionally, the machine-readable storage medium may also be at least one storage device located away from the processor.
[0126] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0127] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned message processing method are implemented.
[0128] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A message processing method, characterized in that: The method is applied to a network node, and the method comprises: Receive messages; If the message is a data message, when it is determined that the message needs to be forwarded through the target Internet Protocol Version 6 IPv6 segment routing SRv6-traffic engineering TE policy, and there is a network node configured with a general segment identifier G-SID among the network nodes on the forwarding path corresponding to the target SRv6-TE policy, a first SID list corresponding to the forwarding path is generated, and based on the first SID list, the message is encapsulated as an SRv6 message and then forwarded to the next-hop network node, wherein the last first address in the first SID list in the routing extension header SRH header of the SRv6 message indicates the existence of G-SID in the first SID list, the length of a common prefix, the length of a G-SID, and the compressed values corresponding to the other first addresses in the first SID list except the last first address, and the compressed value is used to represent the total number of G-SIDs included in the corresponding address; If the message is an SRv6 message, the message includes an IPv6 header and an SRH header, it is determined that the message needs to be modified, the SL value of the remaining segment in the SRH header is not 0, and the last second address in the second SID list in the SRH header indicates that a G-SID exists in the second SID list, then when the address indicated by the SL value is the second address, according to the destination address in the IPv6 header, the second SID list, the compressed value corresponding to the address indicated by the SL value minus 1, and the length of a common prefix indicated by the second address and the length of a G-SID, the message is modified and sent to the next hop network node; or, When the address indicated by the SL value is not the second address, the message is modified based on at least the destination address in the IPv6 header, the SL value, the second SID list, the length of a common prefix indicated by the second address, the length of a G-SID, the first compression value corresponding to the address indicated by the SL value, and the second compression value corresponding to the address indicated by the SL value minus 1, and the modified message is sent to the next-hop network node.
2. The method according to claim 1, characterized in that Determine whether the message needs to be modified by: If a common SID is configured for itself, when the destination address included in the IPv6 header is its own common SID, it is determined that the message needs to be modified; If the G-SID is configured itself, when the destination address included in the IPv6 header includes the common prefix corresponding to its own G-SID and its own G-SID, it is determined that the message needs to be modified.
3. The method according to claim 1, characterized in that Modifying the message according to the destination address in the IPv6 header, the second SID list, the compressed value corresponding to the address indicated by the SL value minus 1, and the length of a common prefix and a length of a G-SID indicated by the second address, specifically comprising: If the compression value corresponding to the address indicated by the SL value minus 1 is 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value minus 1 in the second SID list; If the compression value corresponding to the address indicated by the SL value minus 1 is not 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the target address; Among them, the target address includes, in sequence, the common prefix included in the destination address before the update, which is obtained based on the length of a common prefix indicated by the second address, the last G-SID included in the address indicated by the SL value minus 1 obtained from the second SID list based on the length of a G-SID indicated by the second address, and the segment index SI corresponding to the last G-SID.
4. The method according to claim 1, characterized in that: The message is modified according to at least the destination address in the IPv6 header, the SL value, the second SID list, the length of a common prefix indicated by the second address, the length of a G-SID, a first compressed value corresponding to the address indicated by the SL value, and a second compressed value corresponding to the address indicated by the SL value minus 1, specifically including: If the SL value is greater than 1, when the first compressed value corresponding to the address indicated by the SL value indicated by the second address is 0 and the second compressed value corresponding to the address indicated by the SL value indicated by the second address after deducting 1 is not 0, the SL value is deducted by 1, and the destination address in the IPv6 header is updated to the first address, wherein the first address sequentially includes the first common prefix included in the address indicated by the SL value obtained based on the length of a common prefix indicated by the second address, the last first G-SID included in the address indicated by the SL value obtained from the second SID list based on the length of a G-SID indicated by the second address after deducting 1, and the first SI corresponding to the first G-SID; or, When the first compression value and the second compression value are both 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value reduced by 1 in the second SID list; or, When the first compression value is not 0, if the second SI included in the destination address in the IPv6 header is not 0, then when the second compression value is 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value reduced by 1 in the second SID list, or, when the second compression value is not 0, the destination address in the IPv6 header is updated to the second address, wherein the second address includes the second common prefix included in the destination address before the update, the third G-SID and the third SI in the address indicated by the SL value obtained from the second SID list based on the length of a G-SID indicated by the second address, and the third SI is the second SI reduced by 1; If the second SI is 0, when the second compression value is 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value reduced by 1 in the second SID list, or, when the second compression value is not 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the third address, wherein the third address sequentially includes the third common prefix included in the destination address before the update, the last fourth G-SID included in the address indicated by the SL value reduced by 1 obtained from the second SID list based on the length of a G-SID indicated by the second address, and the fourth SI corresponding to the fourth G-SID; If the SL value is equal to 1, when the first compression value and the second compression value are both 0, if the second last segment pop-up SRH PSP behavior is supported, the destination address in the IPv6 header is updated to the address indicated by the SL value minus 1 in the second SID list, and the SRH header is popped out; if the PSP behavior is not supported, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value minus 1 in the second SID list; or, When the first compression value is not 0 and the second compression value is 0, if the first compression value is equal to 1, then when the PSP behavior is supported, the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1, and the SRH header is discarded, or, when the PSP behavior is not supported, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1; If the first compression value is greater than 1 and the fifth SI included in the destination address in the IPv6 header is not 0, the destination address in the IPv6 header is updated to a fourth address, wherein the fourth address includes a fourth common prefix included in the destination address before the update, a fifth G-SID located in front of the G-SID included in the destination address before the update in the address indicated by the SL value obtained from the second SID list based on the length of a G-SID indicated by the second address, and a sixth SI corresponding to the fifth G-SID, wherein the sixth SI is the fifth SI minus 1; If the first compression value is greater than 1 and the fifth SI included in the destination address in the IPv6 header is 0, then when it supports PSP behavior, the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1, and the SRH header is discarded; or, when it does not support PSP behavior, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1.
5. The method according to claim 1, characterized in that The method further comprises: When the message is an SRv6 message, the message includes an IPv6 header and an SRH header, and the SL value in the G-SRH header is 0, the IPv6 header and the G-SRH header of the message are discarded, and the discarded message is forwarded; or, When the message is an SRv6 message, the message only includes an IPv6 header, and the destination address in the IPv6 header is its own SID, the IPv6 header of the message is ejected, and the message after being ejected is forwarded.
6. A message processing device, characterized in that: The device is applied to a network node, and the device includes: A receiving module, used for receiving messages; an encapsulation module, for, if the message is a data message, generating a first SID list corresponding to the forwarding path when it is determined that the message needs to be forwarded through a target Internet Protocol Version 6 IPv6 segment routing SRv6-Traffic Engineering TE policy, and a network node configured with a general segment identifier G-SID exists among the network nodes on the forwarding path corresponding to the target SRv6-TE policy, and encapsulating the message into an SRv6 message based on the first SID list and forwarding it to a next-hop network node, wherein the last first address in the first SID list in the routing extension header SRH header of the SRv6 message indicates the existence of a G-SID in the first SID list, the length of a common prefix, the length of a G-SID, and the compression values corresponding to the other first addresses in the first SID list except the last first address, and the compression value is used to represent the total number of G-SIDs included in the corresponding address; A processing module, configured to, if the message is an SRv6 message, the message includes an IPv6 header and an SRH header, it is determined that the message needs to be modified, the SL value of the remaining segment in the SRH header is not 0, and the last second address in the second SID list in the SRH header indicates that a G-SID exists in the second SID list, then when the address indicated by the SL value is the second address, modify the message according to the destination address in the IPv6 header, the second SID list, the compressed value corresponding to the address indicated by the SL value minus 1, and the length of a common prefix and a length of a G-SID indicated by the second address, and send the modified message to a next-hop network node; or, When the address indicated by the SL value is not the second address, the message is modified based on at least the destination address in the IPv6 header, the SL value, the second SID list, the length of a common prefix indicated by the second address, the length of a G-SID, the first compression value corresponding to the address indicated by the SL value, and the second compression value corresponding to the address indicated by the SL value minus 1, and the modified message is sent to the next-hop network node.
7. The device according to claim 6, characterized in that The processing module is specifically used for: If the compression value corresponding to the address indicated by the SL value minus 1 is 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value minus 1 in the second SID list; If the compression value corresponding to the address indicated by the SL value minus 1 is not 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the target address; Among them, the target address includes, in sequence, the common prefix included in the destination address before the update, which is obtained based on the length of a common prefix indicated by the second address, the last G-SID included in the address indicated by the SL value minus 1 obtained from the second SID list based on the length of a G-SID indicated by the second address, and the segment index SI corresponding to the last G-SID.
8. The device according to claim 6, characterized in that The processing module is specifically used for: If the SL value is greater than 1, when the first compressed value corresponding to the address indicated by the SL value indicated by the second address is 0 and the second compressed value corresponding to the address indicated by the SL value indicated by the second address after deducting 1 is not 0, the SL value is deducted by 1, and the destination address in the IPv6 header is updated to the first address, wherein the first address sequentially includes the first common prefix included in the address indicated by the SL value obtained based on the length of a common prefix indicated by the second address, the last first G-SID included in the address indicated by the SL value obtained from the second SID list based on the length of a G-SID indicated by the second address after deducting 1, and the first SI corresponding to the first G-SID; or, When the first compression value and the second compression value are both 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value reduced by 1 in the second SID list; or, When the first compression value is not 0, if the second SI included in the destination address in the IPv6 header is not 0, then when the second compression value is 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value reduced by 1 in the second SID list, or, when the second compression value is not 0, the destination address in the IPv6 header is updated to the second address, wherein the second address includes the second common prefix included in the destination address before the update, the third G-SID and the third SI in the address indicated by the SL value obtained from the second SID list based on the length of a G-SID indicated by the second address, and the third SI is the second SI reduced by 1; If the second SI is 0, when the second compression value is 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value reduced by 1 in the second SID list, or, when the second compression value is not 0, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the third address, wherein the third address sequentially includes the third common prefix included in the destination address before the update, the last fourth G-SID included in the address indicated by the SL value reduced by 1 obtained from the second SID list based on the length of a G-SID indicated by the second address, and the fourth SI corresponding to the fourth G-SID; If the SL value is equal to 1, when the first compression value and the second compression value are both 0, if the second last segment pop-up SRH PSP behavior is supported, the destination address in the IPv6 header is updated to the address indicated by the SL value minus 1 in the second SID list, and the SRH header is popped out; if the PSP behavior is not supported, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value minus 1 in the second SID list; or, When the first compression value is not 0 and the second compression value is 0, if the first compression value is equal to 1, then when the PSP behavior is supported, the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1, and the SRH header is discarded, or, when the PSP behavior is not supported, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1; If the first compression value is greater than 1 and the fifth SI included in the destination address in the IPv6 header is not 0, the destination address in the IPv6 header is updated to a fourth address, wherein the fourth address includes a fourth common prefix included in the destination address before the update, a fifth G-SID located in front of the G-SID included in the destination address before the update in the address indicated by the SL value obtained from the second SID list based on the length of a G-SID indicated by the second address, and a sixth SI corresponding to the fifth G-SID, wherein the sixth SI is the fifth SI minus 1; If the first compression value is greater than 1 and the fifth SI included in the destination address in the IPv6 header is 0, then when it supports PSP behavior, the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1, and the SRH header is discarded; or, when it does not support PSP behavior, the SL value is reduced by 1, and the destination address in the IPv6 header is updated to the address indicated by the SL value in the second SID list minus 1.
9. An electronic device, characterized in that: The method comprises a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement the method steps described in any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps of any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Message forwarding method and device of SRV6 protocol, electronic equipment and medium
CN113726654A
Message processing method and device, electronic equipment and medium
CN113973074A
Message forwarding method and device
CN115037675A
Message forwarding method and device
CN115460123A
Data transmission method, related equipment and computer storage medium
CN115701054A
